Boost logo

Boost-Build :

Subject: [Boost-build] building libboost_python-mt-s.so*
From: Paul Hatton (P.S.HATTON_at_[hidden])
Date: 2015-10-19 12:12:39


Apologies for missing the obvious (I must be); I've also tried the list archives but can't find this mentioned.

When I build boost 1.59.0 and 1.57.0 (not tried earlier versions) using

./bootstrap.sh --prefix=/gpfs/apps/boost/v1.59.0_gcc-v5.2.0 \
  --without-icu --with-python=$PYTHON_ROOT \
  2>&1|tee ../logs/bootstrap-`date +%y_%m_%d_%Hh%Mm`.log
time ./b2 install --without-mpi \
  --build-type=complete --layout=tagged \
  --build-dir=../boostbuild \
  2>&1|tee ../logs/b2_install-`date +%y_%m_%d_%Hh%Mm`.log

with PYTHON_ROOT set to our Python installation, it build everything apart from libboost_python-mt-s.so*; it does build libboost_python-mt-s.a*:

[~ 17:08] $ ll /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt*
-rw-r--r-- 1 appmaint appmaint 672176 Oct 16 16:05 /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt.a
-rw-r--r-- 1 appmaint appmaint 8222902 Oct 16 15:56 /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt-d.a
lrwxrwxrwx 1 appmaint appmaint 30 Oct 16 17:09 /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt-d.so -> libboost_python-mt-d.so.1.59.0
-rwxr-xr-x 1 appmaint appmaint 3819140 Oct 16 17:09 /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt-d.so.1.59.0
-rw-r--r-- 1 appmaint appmaint 672176 Oct 16 16:36 /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt-s.a
-rw-r--r-- 1 appmaint appmaint 8222902 Oct 16 16:27 /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt-sd.a
lrwxrwxrwx 1 appmaint appmaint 28 Oct 16 17:01 /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt.so -> libboost_python-mt.so.1.59.0
-rwxr-xr-x 1 appmaint appmaint 394396 Oct 16 17:01 /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib/libboost_python-mt.so.1.59.0
[~ 17:08] $

(note that there is an libboost_python-mt-d.so.1.59.0). The start of a directory listing of the target directory is:

[~ 17:03] $ ll /gpfs/apps/boost/v1.59.0_gcc-v5.2.0/lib
total 1367680
-rw-r--r-- 1 appmaint appmaint 2674 Oct 16 15:22 libboost_atomic.a
-rw-r--r-- 1 appmaint appmaint 2674 Oct 16 15:57 libboost_atomic-mt.a
-rw-r--r-- 1 appmaint appmaint 27954 Oct 16 15:49 libboost_atomic-mt-d.a
lrwxrwxrwx 1 appmaint appmaint 30 Oct 16 16:54 libboost_atomic-mt-d.so -> libboost_atomic-mt-d.so.1.59.0
-rwxr-xr-x 1 appmaint appmaint 23456 Oct 16 16:53 libboost_atomic-mt-d.so.1.59.0
-rw-r--r-- 1 appmaint appmaint 2674 Oct 16 16:29 libboost_atomic-mt-s.a
-rw-r--r-- 1 appmaint appmaint 27954 Oct 16 16:21 libboost_atomic-mt-sd.a
lrwxrwxrwx 1 appmaint appmaint 28 Oct 16 16:53 libboost_atomic-mt.so -> libboost_atomic-mt.so.1.59.0
-rwxr-xr-x 1 appmaint appmaint 8960 Oct 16 16:53 libboost_atomic-mt.so.1.59.0
lrwxrwxrwx 1 appmaint appmaint 25 Oct 16 15:32 libboost_atomic.so -> libboost_atomic.so.1.59.0
-rwxr-xr-x 1 appmaint appmaint 8960 Oct 16 15:32 libboost_atomic.so.1.59.0
etc .....

I then try to build graph-tool, a Python module, using this build of boost which fails looking for this shared library. It does find /gpfs/apps/boost/v1.57.0_gcc-v4.7.2/lib/libboost_python-mt-s.a but, of course, refuses to link against it, saying:

/usr/bin/ld: /gpfs/apps/boost/v1.57.0_gcc-v4.7.2/lib/libboost_python-mt-s.a(from_python.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

which is what I'd expect when a static library is found instead of a shared library.

System is Scientific Linux:

[~ 17:00] $ uname -a
Linux bb2login03 2.6.32-504.3.3.el6.x86_64 #1 SMP Tue Dec 16 14:29:22 CST 2014 x86_64 x86_64 x86_64 GNU/Linux

and this is with several versions of gcc, from 4.4.2 up to 5.2.0. There is no error output in the log of 'b2 install'.

Can anyone give me a pointer as to why this specific shared library is not built when the static one is?

Many thanks

--
Paul Hatton
High Performance Computing and Visualisation Specialist
IT Services, The University of Birmingham
Ph: 0121-414-3994 Mob: 07785-977340 Skype: P.S.Hatton
[Service Manager, Birmingham Environment for Academic Research]
[ http://www.birmingham.ac.uk/bear ]
[Also Technical Director, IBM Visual and Spatial Technology Centre]


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk