Failed buiding root_v6.14.04 in Ubuntu 18

Hello everybody,

I try to install root_v6.14.04 from a source file on Ubuntu 18.04, but the build fails. I have already another root version installed (5.34.32, also from source file, which works fine).

Here a description of what I did:

I downloaded the source file root_v6.14.04.source.tar.gz, unpacked it and created a new folder Software/root-6.14.04/build_new in the unpacked one. In build_new I run:

cmake -DCMAKE_INSTALL_PREFIX=/home/student/Software/root -Dgnuinstall=ON ..
cmake --build .

At this point I got a crash…

[ 93%] Linking CXX shared library ../../lib/libFFTW.so
/usr/bin/ld: /usr/local/lib/libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
math/fftw/CMakeFiles/FFTW.dir/build.make:221: recipe for target 'lib/libFFTW.so' failed
make[2]: *** [lib/libFFTW.so] Error 1
CMakeFiles/Makefile2:20840: recipe for target 'math/fftw/CMakeFiles/FFTW.dir/all' failed
make[1]: *** [math/fftw/CMakeFiles/FFTW.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

I am confused by the error since I haven’t got it when I installed the older version (and a new version of root on another pc). I have fftw3 installed on my pc (don’t know if this is helpful). Has anybody an idea what went wrong?

Thank you very much :slight_smile:

g++ version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
gcc version: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
ROOT Version: root_v6.14.04
System: Ubuntu 18.04

You need the shared library. The simplest way could be: sudo apt-get install libfftw3-dev

Thank you for your answer!
However, I have already installed this library (using the command)

So why is it trying to use another non-system-default archive library “/usr/local/lib/libfftw3.a”?
Is there no shared library “/usr/local/lib/libfftw3.so”?

You can try to remove the “fftw3” distribution that you have in “/usr/local” and configure your ROOT from scratch again.

If everything fails, as the very last resort, you can use “-Dbuiltin_fftw3=ON

Removing “ fftw3 ” in “ /usr/local ” didn’t help, so I tried “ -Dbuiltin_fftw3=ON ”. Now I don’t get the same error, but unfortunately the build breaks again and shows me two error messages:

[ 94%] Linking CXX shared library ../../lib/libPyROOT.so
[ 94%] Building CXX object tmva/tmva/CMakeFiles/TMVA.dir/src/MethodBoost.cxx.o
[ 94%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooSegmentedIntegrator2D.cxx.o
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
/usr/src/Python-2.7.16/./Modules/posixmodule.c:7648: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tempnam':
/usr/src/Python-2.7.16/./Modules/posixmodule.c:7595: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/bin/ld: /usr/local/lib/libpython2.7.a(ceval.o): relocation R_X86_64_PC32 against symbol `PyFunction_Type' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
bindings/pyroot/CMakeFiles/PyROOT.dir/build.make:982: recipe for target 'lib/libPyROOT.so' failed
make[2]: *** [lib/libPyROOT.so] Error 1
CMakeFiles/Makefile2:29051: recipe for target 'bindings/pyroot/CMakeFiles/PyROOT.dir/all' failed
make[1]: *** [bindings/pyroot/CMakeFiles/PyROOT.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

and

[ 96%] Linking CXX shared library ../../lib/libTMVA.so
[ 96%] Built target TMVA
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

The older version of root which was mentioned above was installed together with python2.7. I noticed in output of cmake that also in this build root tries to use python2.7. Could this be a problem? For the older version of root I needed explicitly python2.7 and now the build uses automatically python2.7. I do not know how change it.

Again, some strange “python” in “/usr/local” (without “/usr/local/lib/libpython2.7.so”?).
You should use the one provided by: sudo apt-get install python-dev

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.