Emerging boost-1.37.0 creates these symlinks: (only boost_system shown, happens for all the installed libraries) $ ls /usr/lib/libboost_system* -rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-1_37.a lrwxrwxrwx 1 root root 23 2009-01-26 17:39 libboost_system-1_37.so -> libboost_system-1_37.so -rwxr-xr-x 1 root root 19K 2009-01-26 17:37 libboost_system-1_37.so.1.37.0 -rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-mt-1_37.a lrwxrwxrwx 1 root root 26 2009-01-26 17:39 libboost_system-mt-1_37.so -> libboost_system-mt-1_37.so -rwxr-xr-x 1 root root 19K 2009-01-26 17:37 libboost_system-mt-1_37.so.1.37.0 -rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-mt-s-1_37.a -rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-s-1_37.a The base symlinks (libboost_system-1_37.so and libboost_system-mt-1_37.so) show up as red because they're pointing to themselves. This means certain uses of the library fail: $ g++ -fPIC -c -o main.o main.cpp -I/usr/include/boost-1_37/ && g++ -fPIC -o test.so main.o -shared -lboost_system-1_37 /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libboost_system-1_37.a(error_code.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libboost_system-1_37.a: could not read symbols: Bad value collect2: ld returned 1 exit status If I delete the broken symlinks and recreate them the way they should be: $ ls libboost_system* -rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-1_37.a lrwxrwxrwx 1 root root 30 2009-01-29 07:36 libboost_system-1_37.so -> libboost_system-1_37.so.1.37.0 -rwxr-xr-x 1 root root 19K 2009-01-26 17:37 libboost_system-1_37.so.1.37.0 -rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-mt-1_37.a lrwxrwxrwx 1 root root 33 2009-01-29 07:36 libboost_system-mt-1_37.so -> libboost_system-mt-1_37.so.1.37.0 -rwxr-xr-x 1 root root 19K 2009-01-26 17:37 libboost_system-mt-1_37.so.1.37.0 -rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-mt-s-1_37.a -rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-s-1_37.a Then the above compilation succeeds.
Can you please tell me which versions of boost-build you have installed? Do you have any other versions of boost installed (like dev-libs/boost-1.36.0)? Are the ebuilds from my overlay or from the official gentoo tree?
Adam, are you building boost with USE=debug maybe?
Yes, you're right! I was building with 'debug' - is that a bad idea? I tried rebuilding without debug and all the symlinks are correct. I'm building with boost-build-1.37.0, and Portage automatically uninstalled the previous version I had which was 1.35. This is all from the official Gentoo tree.
(In reply to comment #3) > Yes, you're right! I was building with 'debug' - is that a bad idea? I tried > rebuilding without debug and all the symlinks are correct. I got the broken symlinks, while USE="-debug" for boost from the beginning. [ebuild R ] dev-util/boost-build-1.37.0 USE="python -examples" 0 kB [ebuild R ] dev-libs/boost-1.37.0-r1 USE="eselect expat icu python -debug -doc -mpi -tools"
the broken symlinks for: USE="-debug" emerge boost ls -l /usr/lib64/libboost_thread-1_37-debug.* lrwxrwxrwx 1 root root 31 2009-04-08 08:40 /usr/lib64/libboost_thread-1_37-debug.a -> libboost_thread-mt-1_37-debug.a lrwxrwxrwx 1 root root 32 2009-04-08 08:40 /usr/lib64/libboost_thread-1_37-debug.so -> libboost_thread-mt-1_37-debug.so
Are you sure those symlinks aren't left over from a previous Boost install? I don't have those debug libraries: $ ls -l /usr/lib64/libboost_thread-1_37* lrwxrwxrwx 1 root root 25 2009-01-30 22:53 /usr/lib64/libboost_thread-1_37.a -> libboost_thread-mt-1_37.a lrwxrwxrwx 1 root root 26 2009-01-30 22:53 /usr/lib64/libboost_thread-1_37.so -> libboost_thread-mt-1_37.so I'm still not sure why the "debug" USE flag would completely break everything though...
(In reply to comment #6) > Are you sure those symlinks aren't left over from a previous Boost install? I > don't have those debug libraries: yes, I first "emerge -C boost", the links were gone. "emerge boost" brings them back. also, $ qlist boost|grep debug /usr/lib64/libboost_thread-1_37-debug.so /usr/lib64/libboost_thread-1_37-debug.a emerge -pv boost [ebuild R ] dev-libs/boost-1.37.0-r1 USE="eselect expat icu python -debug -doc -mpi -tools" 0 kB
For me, I had boost-1.35.0-r2 and attempted to upgrade to boost-1.37.0-r1. Portage complained about a blocking condition and said it was uninstalling 1.35 before installing 1.37. After the 1.37 install I noticed that /usr/include and /usr/lib had all kinds of broken symlinks from the 1.35 rev. I had to remove all boost installations and then clean up all broken symlinks before re-emerging 1.37.
That was a bug in the part creating the symlinks. That should be solved by now.