Installation error Ubuntu 10.04 - 64 bit problem with boost libraries.

281 views
Skip to first unread message

Damien Fay

unread,
Apr 12, 2012, 11:53:27 AM4/12/12
to Eureqa Group
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

Gábor Bakos

unread,
Apr 12, 2012, 1:26:36 PM4/12/12
to eureqa...@googlegroups.com
Hi Damien,

 I have not tried the matlab interface, but I had success with Ubuntu 10.4 64 bit with the official libboost-dev packages (|system|date-time|regex|serialization|asio) to build the standard Eureqa API. You might try those.
BTW, it looks like the boost is not used from your /usr/local folders (I think that is the preferred location for the non-package manager hosted programs), but from the /usr (where are the package manager hosted programs). Maybe the build script have to be adjusted?
Hope this helps, gabor

Damien Fay

unread,
Apr 12, 2012, 2:04:32 PM4/12/12
to Eureqa Group
Hi Gabor, thanks for the help, you're a genius. So for anyone reading
this - it seems I did the right thing - downloading and compiling
boost myself with the -fPIC switch - but then pointed to the wrong
boost installation; in /usr/lib instead of /usr/local/lib. Thanks
again, Damien.
Reply all
Reply to author
Forward
0 new messages