Problem linking while compiling

ROOT Version: 6.22.99
_Platform: Ubuntu 18.04
_Compiler:gcc 9.3


I have encountered the following problem when compiling ROOT. Updating Python and gcc seems to have no effect. Hopefully there is an easy fix.

Kind regards. Rasmus

Scanning dependencies of target JupyROOT2_7
[ 77%] Building CXX object bindings/jupyroot/CMakeFiles/JupyROOT2_7.dir/src/IOHandler.cxx.o
[ 77%] Built target G__unordered_multimapDict
Scanning dependencies of target Rint
[ 77%] Building CXX object core/rint/CMakeFiles/Rint.dir/src/TRint.cxx.o
[ 77%] Linking CXX shared library …/…/lib/
/usr/bin/ld: /usr/local/lib/libpython3.8.a(longobject.o): relocation R_X86_64_32 against `.rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython3.8.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
bindings/jupyroot/CMakeFiles/JupyROOT3_8.dir/build.make:102: recipe for target ‘lib/’ failed
make[2]: *** [lib/] Error 1
CMakeFiles/Makefile2:26475: recipe for target ‘bindings/jupyroot/CMakeFiles/JupyROOT3_8.dir/all’ failed
make[1]: *** [bindings/jupyroot/CMakeFiles/JupyROOT3_8.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 77%] Building CXX object core/rint/CMakeFiles/Rint.dir/src/TTabCom.cxx.o
[ 77%] Linking CXX shared library …/…/lib/
[ 77%] Built target JupyROOT2_7
[ 77%] Linking CXX shared library …/…/lib/
[ 77%] Linking CXX shared library …/…/…/…/lib/
[ 77%] Built target Rint
[ 77%] Built target cppyy_backend2_7
Makefile:168: recipe for target ‘all’ failed
make: *** [all] Error 2

Hi @rpl,
Thanks for reporting your issue!
Is this a clean build on your machine? Did you update python recently and then tried to recompile ROOT? What options are you using for configuration?


This a clean build, and did just update python. The only options I use are -j1, -j4 and -j8 and they all produce this error.

cheers, Rasmus

If you are now using a different python than the one you used to build ROOT, then you should also recompile ROOT from scratch. I suggest you follow the guide.

But then, there are easier alternatives than building ROOT from source. You can find them all at . For instance in ubuntu you could download a precompiled binary distribution.

Hope this helps,

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