Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-18-2006, 02:35 PM   #1
LQ Newbie
Registered: Jul 2006
Posts: 3

Rep: Reputation: 0
Compiling a .so on an Amd64

To be precise, the error is coming up when I run Make on the mpiJava software.

The software was made under 32bit systems and when it tries to create a shared object using the -o flag, I get an error that says:
relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC

When I edit the makefile to change the flag from -o to -fPIC and try Make again, no error is thrown, but the .so is not found. Here is the command and error:

/usr/bin/mpicc -shared -fPIC ../../lib/ \ -L/usr/lib64/MPICH/p4/gnu <list of .o's>
gcc: ../../lib/ No such file or directory
Old 07-18-2006, 04:17 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Does the -o argument give the name of the library to output?
I think you may need to keep the "-o file" output option and add the -fPIC option to your FLAGS or OPT variable. The -fPIC option tells the compiler to generate position independent code, while the -o option needs an argument. The argument is the name of the library to produce.

I don't have the mpicc command. I'm assuming that it uses similar arguments as gcc commands.
Look for a -fpic option. You may need to change from -fpic to -fPIC instead of adding -fPIC.
pic stands for position independent code. the -fPIC option also avoids limits in the Global Offset Table of the library.

Last edited by jschiwal; 07-18-2006 at 05:00 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP!!! Compiling Hexen for AMD64 thelin-xportal Linux - Software 0 10-23-2005 09:55 PM
Compiling for AMD64 processor gsrikanth Linux - General 1 04-13-2005 02:49 AM
Compiling an AMD64 kernel from a 32-bit environment justinmc Linux - General 3 01-16-2005 06:47 PM
Compiling linux for amd64 Hobbiticus Linux - General 5 10-08-2004 07:40 AM
suse 9 for amd64 and kernel compiling dick220369 Linux - Newbie 0 01-14-2004 10:52 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration