Unable to compile the root version 6.20.00 with cmake

ROOT Version: 6.20.00
Platform: Ubuntu 20.04.1 LTS (Focal Fossa)
Compiler: gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0


Hi,
I am trying to compile root on my computer.

After executing cmake -Dgdml=ON -DCMAKE_INSTALL_PREFIX=../install ../source I receive an error message stating that the “Configuring incomplete, errors occurred!”.

In CMakeError.log I have found that

/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x63): undefined reference to `pthread_join'

All of my packages are up to date.
Command nm /lib/x86_64-linux-gnu/libpthread.so.0 | grep thread_detach shows that pthread_detach is present in the library of interest:

al264242@dphnpcl147:~/Documents/Files$ nm /lib/x86_64-linux-gnu/libpthread.so.0 | grep thread_detach
000000000000a980 t __pthread_detach
000000000000a980 W pthread_detach

Also, in my .bashrc file I defined:

export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:/usr/lib64:/usr/local/lib:/usr/lib:$LD_LIBRARY_PATH

Could you, please, recommend me what should I do?
Thanks in advance.

Hi,

Would this happen to be running in a virtual machine? What steps did you follow, from start to this point?

Hi,
can you also post the full output of the cmake configuration command, and try again after removing the LD_LIBRARY_PATH customization from .bashrc and starting a new shell?

Also note that unless you have some specific needs you don’t have to compile ROOT from source: there are several other installation methods.

Cheers,
Enrico

Hi,
thank you for your message.
I downloaded the root_v6.20.08.source.tar.gz file, extracted it, made the build directory in which I executed cmake command:

cmake -Dgdml=ON -DCMAKE_INSTALL_PREFIX=../install ../source

Hi,

I am attaching CMakeOutput and CMakeError logs here:
CMakeOutput.txt (69.7 KB)
CMakeError.txt (2.9 KB)

After removing export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:/usr/lib64:/usr/local/lib:/usr/lib:$LD_LIBRARY_PATH line from the .bashrc I got the same result.

I have to compile another software based on root, so this is why I tried to compile root from source, as it would be compiled with the same version of compiler.
But, I hope it will work fine with the precompiled version of root. Thank you, I will try it out.

Hi @alobasenko,
it’s hard for me to say what exactly, but there is something broken in your environment (do you have all ROOT dependencies installed (openssl-dev is called libssl-dev in Ubuntu 20.04)?).

I just tried building ROOT 6.20.08 from source in a Ubuntu 20.04 docker container, and it completed successfully with this sequence of commands:

$ docker run -it --rm ubuntu:20.04G
# apt -y update && apt -y upgrade && apt-get install dpkg-dev cma$                   
e g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev python libssl-dev gf$
rtran libpcre3-dev xlibmesa-glu-dev libglew1.5-dev libftgl-dev libmysqlclient-dev li$
fftw3-dev libcfitsio-dev graphviz-dev libavahi-compat-libdnssd-dev libldap2-dev pyth$
n-dev libxml2-dev libkrb5-dev libgsl0-dev wget git                                   
# wget https://root.cern/download/root_v6.20.08.source.tar.gz                        
# tar -xzvf root_v6.20.08.source.tar.gz                                              
# mkdir root-build root-install                                                      
# cd root-build                                                                      
# cmake -Dgdml=ON -DCMAKE_INSTALL_PREFIX=../root-install ../root-6.20.08 && cmake --build . -- -j8

Cheers,
Enrico

Hi Enrico,

Apparently, there were problems with dependencies, because it helped a lot and I successfully compiled root.

Thank you very much and sorry for such a trivial mistake.

Sincerely,
Andrii.

I’m glad you were able to resolve the issue!
Cheers,
Enrico