LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 12-02-2008, 11:48 AM   #1
eolmsan
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Rep: Reputation: 0
Error recompile with fPIC, but fPIC is already as a compilation option


Hello I am getting this error when I am doing the make of a program

Relocation R_X86_64_32 against `vtable for Torch::MemoryDataSet' can not be used when making a shared object; recompile with -fPIC

It says that I should recompile with the -fPIC option, but I already have the -fPIC option in the CFLAGS and CXXFLAGS of the make file, is there any way to solve this?. I have seen that this problem is related with the use of a 64 bits machine, and it is true because I am using one.

Thanks.
 
Old 12-03-2008, 06:31 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,755
Blog Entries: 1

Rep: Reputation: 238Reputation: 238Reputation: 238
It's always better to post the last 20-30 lines of the failed make which will include the actual error message. Are you sure all of the Makefiles in the source tree contain -fPIC? Are you sure it's not complaining about a 32-bit dependency that whatever app (something else that might be helpful) you're trying to build is attempting to link against?
 
Old 12-03-2008, 11:08 AM   #3
eolmsan
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your answer, this is the complete error message,
/usr/bin/ld: /home/olmedo/RL_Toolbox/external_libs/torch3/lib/Linux_OPT_DOUBLE/libtorch.a(MemoryDataSet.o): relocation R_X86_64_32 against `vtable for Torch::MemoryDataSet' can not be used when making a shared object; recompile with -fPIC
/home/olmedo/RL_Toolbox/external_libs/torch3/lib/Linux_OPT_DOUBLE/libtorch.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [../lib/librltoolbox.so.1.0.0] Error 1

Libtorch.a is a file from an external library, is maybe the cause of the problem the other library?. I think that all my makefiles have the -fPIC option, I have only one makefile in the directory , so I think that that is the only one that is being in used.

Thanks.
 
Old 12-03-2008, 11:27 AM   #4
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,755
Blog Entries: 1

Rep: Reputation: 238Reputation: 238Reputation: 238
Well, 5 lines of output is almost 20-30. It's helpful to see what the compiler or linker was trying to do when it failed. Anyway, if libtorch is a dependency lib for RL_Toolbox, then you need a 64-bit copy of libtorch compiled with -fPIC.
 
Old 12-03-2008, 12:05 PM   #5
eolmsan
LQ Newbie
 
Registered: Nov 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Thank for the answer, here you have the rest of the lines:

makedepend: warning: ckdtrees.cpp, line 5: cannot find include file "iostream"
not in /usr/lib64/qt-3.3/mkspecs/default/iostream
not in ./iostream
not in ../external_libs/torch3/include/iostream
not in ../external_libs/newmat11/iostream
not in ../include/iostream
not in /usr/include/iostream
test -d ../lib/ || mkdir -p ../lib/
rm -f librltoolbox.so.1.0.0 librltoolbox.so librltoolbox.so.1 librltoolbox.so.1.0
g++ -shared -Wl,-soname,librltoolbox.so.1 -o librltoolbox.so.1.0.0 cacrobotmodel.o caction.o cactionstatistics.o cactorcritic.o cadaptivesoftmaxnetwork.o cadvantagelearning.o cagentcontroller.o cagent.o cagentlistener.o cagentlogger.o canalyzer.o ccartpolemodel.o ccontinuousactiongradientpolicy.o ccontinuousactions.o ccontinuoustime.o cdiscretizer.o cdynamicprogramming.o cenvironmentmodel.o cepisode.o cepisodehistory.o cerrorlistener.o cexploration.o cfeaturefunction.o cgradientfunction.o cgridworldmodel.o chierarchicbehaviours.o chierarchiccontroller.o chistory.o clearndataobject.o clinearfafeaturecalculator.o cmontecarlo.o cmultipolemodel.o cmyexception.o cparameters.o cpegasus.o cpendulummodel.o cpolicies.o cpolicygradient.o cprioritizedsweeping.o cqetraces.o cqfunction.o cregions.o creinforce.o cresiduals.o crewardfunction.o crewardmodel.o cstatecollection.o cstate.o cstatemodifier.o cstateproperties.o csupervisedlearner.o ctaxidomain.o ctdlearner.o ctestsuit.o ctheoreticalmodel.o ctorchvfunction.o ctransitionfunction.o cutility.o cvaluepolicygradientlearner.o cvetraces.o cvfunction.o cvfunctionfromqfunction.o cvfunctionlearner.o ril_debug.o cbatchlearning.o clstd.o cdatafactory.o cextratrees.o cforest.o cinputdata.o ctrees.o ctreevfunction.o ctreebatchlearning.o crbftrees.o cnearestneighbor.o ckdtrees.o clocalregression.o cmodeltree.o csamplingbasedmodel.o cbaseobjects.o cevaluator.o -ltorch -L/home/olmedo/RL_Toolbox/external_libs/torch3/lib/Linux_OPT_DOUBLE -lnewmat -L/home/olmedo/RL_Toolbox/external_libs/newmat11/lib
/usr/bin/ld:

/home/olmedo/RL_Toolbox/external_libs/torch3/lib/Linux_OPT_DOUBLE/libtorch.a(MemoryDataSet.o): relocation R_X86_64_32 against `vtable for Torch::MemoryDataSet' can not be used when making a shared object; recompile with -fPIC
/home/olmedo/RL_Toolbox/external_libs/torch3/lib/Linux_OPT_DOUBLE/libtorch.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [../lib/librltoolbox.so.1.0.0] Error 1



Thanks.
 
  


Reply

Tags
compilation, error, makefile


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
how to find out shared object or ELF binay compiled with -fPIC dayalan_cse Programming 3 11-12-2008 07:58 PM
cross compilation error -- /usr/local/bin/ld: unrecognized option '--as-needed' shabeervsm Linux - Kernel 1 09-08-2008 05:01 AM
Compilation error : cc: unrecognized option `-KPIC' adarshkmr Linux - Newbie 2 02-12-2008 12:00 AM
about -fpic/-fPIC option for gcc George2 Programming 2 09-04-2006 02:38 AM
What does 'recompile with -fPIC' mean cocteau Linux - Software 1 03-31-2005 02:32 PM


All times are GMT -5. The time now is 01:11 AM.

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