build failure diffpy.srreal, cannot find boost_python library

157 views
Skip to first unread message

Andrea Prodi

unread,
Jun 2, 2015, 11:44:13 AM6/2/15
to diffp...@googlegroups.com
Dear diffpy_cmi developers,

I am trying to build diffpy on Scientific Linux SL6, since the precompiled binaries are not working because the GLIBC version that comes with SL6 is too old.

the build of target 8: srreal is failing because conf.CheckLib scons routine cannot find 'boost_python' library. I've installed boost 1.58 and I have multiple python versions (2.6 and 2.7 (on /usr/local), building with 2.7), so I guess it cannot link to the proper version of the library ?

thank you for your help

Andrea


>./install --build=8
# 8 diffpy.srreal ------------------------------------------------------------
scons: Reading SConscript files ...
Checking for C++ library boost_python... no
Checking for C++ library boost_python-mt... no
This program requires 'boost_python' library


>locate libboost_python
/home/l_prodi_a/diffpy_cmi-1.0-py2.7-linux-x86_64/lib/libboost_python-py27.so
/home/l_prodi_a/diffpy_cmi-1.0-py2.7-linux-x86_64/lib/libboost_python-py27.so.1.46.1
/usr/lib64/libboost_python-mt.so
/usr/lib64/libboost_python-mt.so.5
/usr/lib64/libboost_python.so
/usr/lib64/libboost_python.so.5
/usr/local/lib/libboost_python.a
/usr/local/lib/libboost_python.so
/usr/local/lib/libboost_python.so.1.58.0

src/diffpy.srreal/config.log

file /home/l_prodi_a/diffpy_cmi-1.0-py2.7-linux-x86_64/src/diffpy.srreal/build/fast-x86_64/SConscript.configure,line 31:
Configure(confdir = .sconf_temp)
scons: Configure: Checking for C++ library boost_python...
.sconf_temp/conftest_0.cpp <-
|
|
|
|int
|main() {
|
|return 0;
|}
|
g++ -o .sconf_temp/conftest_0.o -c -fno-strict-aliasing -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -fwrapv -O3 -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -DNDEBUG -I/usr/include/python2.6 -I/home/l_prodi_a/diffpy_cmi-1.0-py2.7-linux-x86_64/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include .sconf_temp/conftest_0.cpp
g++ -o .sconf_temp/conftest_0 -L. -lpython2.7 -s -Wl,-rpath,'$ORIGIN/../../../../..' .sconf_temp/conftest_0.o -ldiffpy -lboost_python
/home/l_prodi_a/diffpy_cmi-1.0-py2.7-linux-x86_64/lib/libdiffpy.so: undefined reference to `boost::archive::detail::basic_iarchive::load_pointer(void*&, boost::archive::detail::basic_pointer_iserializer const*, boost::archive::detail::basic_pointer_iserializer const* (*)(boost::serialization::extended_type_info const&))'
collect2: ld returned 1 exit status
scons: Configure: no

scons: Configure: Checking for C++ library boost_python-mt...
.sconf_temp/conftest_1.cpp <-
|
|
|
|int
|main() {
|
|return 0;
|}
|
g++ -o .sconf_temp/conftest_1.o -c -fno-strict-aliasing -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -fwrapv -O3 -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -DNDEBUG -I/usr/include/python2.6 -I/home/l_prodi_a/diffpy_cmi-1.0-py2.7-linux-x86_64/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include .sconf_temp/conftest_1.cpp
g++ -o .sconf_temp/conftest_1 -L. -lpython2.7 -s -Wl,-rpath,'$ORIGIN/../../../../..' .sconf_temp/conftest_1.o -ldiffpy -lboost_python-mt
/home/l_prodi_a/diffpy_cmi-1.0-py2.7-linux-x86_64/lib/libdiffpy.so: undefined reference to `boost::archive::detail::basic_iarchive::load_pointer(void*&, boost::archive::detail::basic_pointer_iserializer const*, boost::archive::detail::basic_pointer_iserializer const* (*)(boost::serialization::extended_type_info const&))'
collect2: ld returned 1 exit status
scons: Configure: no

Pavol Juhas

unread,
Jun 2, 2015, 2:49:37 PM6/2/15
to diffp...@googlegroups.com
On Tue, Jun 02, 2015 at 07:38:23AM -0700, Andrea Prodi wrote:
> Dear diffpy_cmi developers,
>
> I am trying to build diffpy on Scientific Linux SL6, since the
> precompiled binaries are not working because the GLIBC version that
> comes with SL6 is too old.
>
> the build of target 8: srreal is failing because conf.CheckLib scons
> routine cannot find 'boost_python' library. I've installed boost
> 1.58 and I have multiple python versions (2.6 and 2.7 (on
> /usr/local), building with 2.7), so I guess it cannot link to the
> proper version of the library ?

Hi Andrea,

I would first try to remove all libboost_*.so files from the
diffpy_cmi-1.0-py2.7-linux-x86_64/lib directory as they came from
the binary distribution and are not compatible with your boost version.
The "./install --build=6,7,8" should then link to your boost library
instead. Note that the build command applies also for the pyobjcryst
and libdiffpy packages as they also use the shared boost libraries.

If this proves troublesome, an easier option is to get the
source-only distribution
[https://github.com/diffpy/diffpy-release/releases/latest]
and build everything from scratch. I would also recommend
to get the latest updates as:

./install --update
./install

Hope this helps,

Pavol

--
Dr. Pavol Juhas
Condensed Matter Physics and Materials Science Department
Brookhaven National Laboratory
P.O. Box 5000
Upton, NY 11973-5000

Andrea Prodi

unread,
Jun 3, 2015, 3:42:59 PM6/3/15
to diffp...@googlegroups.com
Hi Pavol,

thanks

 
Hi Andrea,

I would first try to remove all libboost_*.so files from the
diffpy_cmi-1.0-py2.7-linux-x86_64/lib directory as they came from
the binary distribution and are not compatible with your boost version.
The "./install --build=6,7,8" should then link to your boost library
instead.  Note that the build command applies also for the pyobjcryst
and libdiffpy packages as they also use the shared boost libraries.

deleted  libboost_*.so files from the diffpy_cmi-1.0-py2.7-linux-x86_64/lib directory with no improvement.

Indeed, pyobjcryst requires boost_pytohn but somehow in that case it finds it...

# 6 pyobjcryst ---------------------------------------------------------------

scons: Reading SConscript files ...
Checking for C++ library ObjCryst... yes
Checking for C++ library boost_python... y

If this proves troublesome, an easier option is to get the
source-only distribution
[https://github.com/diffpy/diffpy-release/releases/latest]
and build everything from scratch.

I've tried that with exactly the same results.

btw, the URL for pycifrw tarball in the makedist doesn't seem to be valid anymore. same for periodictable (in this case url is valid but it doesn't download it)

thanks for your help

Andrea

Andrea Prodi

unread,
Jun 3, 2015, 3:45:29 PM6/3/15
to diffp...@googlegroups.com
ok, I reinstalled from scratch and now it finds the boost_python directory.

thanks  and sorry for spamming

Andrea

On Wed, Jun 3, 2015 at 12:59 PM, Andrea Prodi <andrei...@gmail.com> wrote:

mmh, the problem of linking diffpy lib to srreal module  reamains, because
whenever I usr the module srreal I get

ImportError: libdiffpy.so: cannot open shared object file: No such file or directory

is there a way to invert the link library order in the compilation command 

thanks and sorry for spamming

Andrea


On Wed, Jun 3, 2015 at 12:17 PM, Andrea Prodi <andrei...@gmail.com> wrote:

ok, it seems that indeed checking for boost_python screws up the linking

from srreal SConscript.configure:

# Start configuration --------------------------------------------------------

# Temporarily link with Python shared_library so that the check
# for boost_python does not fail due to unresolved Python symbols.
save_linkflags = env['LINKFLAGS']
env.Prepend(LINKFLAGS=pyconfigvar('BLDLIBRARY'))

conf = Configure(env)
#configure_boost_library('boost_python')
env = conf.Finish()


if I comment out configure_boost_library('boost_python') it builds correctly.

A.

On Wed, Jun 3, 2015 at 11:15 AM, Andrea Prodi <andrei...@gmail.com> wrote:
maybe (from config.log):

g++ -o .sconf_temp/conftest_0.o -c -fno-strict-aliasing -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -fwrapv -O3 -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -DNDEBUG -I/usr/include/python2.6 -I/home/l_prodi_a/diffpy-release/Linux/include -I/home/l_prodi_a/diffpy_cmi-1.0-py2.7-linux-x86_64/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include .sconf_temp/conftest_0.cpp
g++ -o .sconf_temp/conftest_0 -L. -lpython2.7 -s .sconf_temp/conftest_0.o -ldiffpy -lboost_python
/home/l_prodi_a/diffpy-release/Linux/lib/libdiffpy.so: undefined reference to `boost::archive::detail::basic_iarchive::load_pointer(void*&, boost::archive::detail::basic_pointer_iserializer const*, boost::archive::detail::basic_pointer_iserializer const* (*)(boost::serialization::extended_type_info const&))'

collect2: ld returned 1 exit status
scons: Configure: no

the order of the libraries matters on the compilation statement ?
"-ldiffpy -lboost_python" diffpy depends on boost_python but appear first

A.



Pavol Juhas

unread,
Jun 3, 2015, 3:49:17 PM6/3/15
to diffp...@googlegroups.com
On Wed, Jun 03, 2015 at 07:50:57PM +0200, Andrea Prodi wrote:
> ok, I reinstalled from scratch and now it finds the boost_python directory.

Hi Andrea,

I guess the problem was in an incompatible mixture of the libraries
from binary distribution and the new ones compiled on your system.

If the "./runtest.sh" script passes without any errors, your
installation should be OK.

Cheers,

Pavol
Reply all
Reply to author
Forward
0 new messages