I'm getting an error while trying to compile the mex files for the
matlab interface which is related to the boost libraries. It seems
from looking at the forums that the boost libraries need to be
compiled using -fPIC but this doesn't actually fix the problem. This
is also a 64 bit only problem apparently. Has anyone else come across
this??
My system is ubuntu 10.04 LTS 64-bit
I downloaded boost1.40 from sourceforge and compiled using (with no
obvious problems)
bjam -a --layout=system install link=static variant=release
threading=multi cxxflags=-fPIC
The error I get when trying to compile
(the problem line is: /usr/bin/ld: /usr/lib/
libboost_system.a(error_code.o): relocation R_X86_64_32 against
`.rodata.str1.1' can not be used when making a shared object;
recompile with -fPIC) :
daf@daf-desktop:~/ITOBO/formulize_0_96_0_X11_x86-64$ make
/home/daf/MATHWORKS_R2008B/bin/mex -cxx CC='g++' CXX='g++' LD='g++'
eureqa_select.o \
/usr/lib/libboost_system.a \
/usr/lib/libboost_serialization.a \
/usr/lib/libboost_date_time.a \
/usr/lib/libboost_thread.a \
-lpthread \
-o eureqa_select.mexa64
Warning: You are using gcc version "4.4.3-4ubuntu5)". The earliest
gcc version supported
with mex is "4.0.0". The latest version tested for use with
mex is "4.2.0".
To download a different version of gcc, visit
http://gcc.gnu.org
/usr/bin/ld: /usr/lib/libboost_system.a(error_code.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a
shared object; recompile with -fPIC
/usr/lib/libboost_system.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
mex: link of ' "eureqa_select.mexa64"' failed.
make: *** [eureqa_select.mexa64] Error 1