ROOTPWA-Maintainers / ROOTPWA

ROOTPWA is a toolkit for partial-wave analysis of multi-particle final states produced in high-energy particle reactions. It is used to determine hadron spectra from experimental data.
Other
8 stars 14 forks source link

libRootPwaPy linking issue on centos7: invalid relocation type 41, 42 #233

Open mmikhasenko opened 6 years ago

mmikhasenko commented 6 years ago

The error is at the last step of make when I tried to install ROOTPWA on a stationary machine with centos7

[100%] Linking CXX shared library ../../lib/libRootPwaPy.so
/usr/bin/ld: /localhome/mikhasenko/Tools/anaconda2/lib/python2.7/config/libpython2.7.a(posixmodule.o): invalid relocation type 42
/usr/bin/ld: BFD version 2.25.1-32.base.el7_4.1  assertion fail elf64-x86-64.c:341
/usr/bin/ld: /localhome/mikhasenko/Tools/anaconda2/lib/python2.7/config/libpython2.7.a(posixmodule.o): invalid relocation type 41
........
/usr/bin/ld: BFD version 2.25.1-32.base.el7_4.1  assertion fail elf64-x86-64.c:341
/usr/bin/ld: /localhome/mikhasenko/Tools/anaconda2/lib/python2.7/config/libpython2.7.a(posixmodule.o): invalid relocation type 41
/usr/bin/ld: BFD version 2.25.1-32.base.el7_4.1  assertion fail elf64-x86-64.c:341
/localhome/mikhasenko/Tools/anaconda2/lib/python2.7/config/libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
(.text+0x3aaa): warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/localhome/mikhasenko/Tools/anaconda2/lib/python2.7/config/libpython2.7.a(posixmodule.o): In function `posix_tempnam':
(.text+0x512): warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/bin/ld: /localhome/mikhasenko/Tools/anaconda2/lib/python2.7/config/libpython2.7.a(ceval.o): unrecognized relocation (0x29) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libRootPwaPy.so] Error 1
make[1]: *** [pyInterface/bindings/CMakeFiles/RootPwaPy.dir/all] Error 2
make: *** [all] Error 2

Environment:

g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
yaml-cpp master dc9c750
boost (detached from boost-1.58.0) compiled with compileBoostLibraries.sh
Python 2.7.14 :: Anaconda, Inc.
root 6.11/02

The output of the compileBoostLibraries.sh is significantly shorter than with ubuntu on my laptop. I found it suspicious.

echo $(. compileBoostLibraries.sh)
>>> compiling Boost libraries in '/localhome/mikhasenko/Tools/boost' view result in /localhome/mikhasenko/Tools/boost/bash.log ... bootstrapping ... linking headers ... building libraries; running 1 jobs in parallel build CMakeLists.txt cmakeModules compileBoostLibraries.sh cuda decayAmplitude doc fortran generators highLevelInterface LICENSE nBodyPhaseSpace partialWaveFit particleData plotScripts pyInterface README.md relativisticAmpCorrections resonanceFit rootlogon.C rootpwa.config rootpwaDoxyfile.conf storageFormats test travisCI userAnalysisWorkspace utilities success: Boost libraries were successfully built
suhlatwork commented 6 years ago

Anaconda comes with a more recent version of binutils than your system. This new versions defines a couple of relocation types more than previous versions. Apparently Anaconda uses its version of binutils to link the python libraries, so that they are not linkable with previous versions of binutils.

Either use the compiler and linker from Anaconda to compile ROOTPWA and probably the rest of your software stack, or get rid of it!

mmikhasenko commented 6 years ago

It does not sound good. Thank you for the explanation.

mmikhasenko commented 6 years ago

What is with plans to switch to new python and boost e.g. in the new release for ROOTPWA?

suhlatwork commented 6 years ago

I am not aware of any issues in general. As written above, if you want to make use of Anaconda, then you have to ensure that ROOTPWA and all required libraries are compiled and linked using Anaconda compilers and linkers. There is nothing that has to be changed on the ROOTPWA side, but you have to carefully set up a correct environment.