LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 10: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, 05:31 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
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, 10: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, 10:27 AM   #4
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
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, 11:05 AM   #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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:50 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
Open Source Consulting | Domain Registration