Trouble compiling ROOT 6

Hello,

I’m having a lot of trouble building ROOT 6 from source lately. I use gcc 4.8.5 which is listed as supported along with a Linux64 OS (actually a VM but it shouldn’t matter).

Unfortunately, this compiler is not actually building the embedded LLVM module correctly.

I get a cryptic error message like the following …

[ 47%] Building CXX object interpreter/llvm/src/tools/clang/lib/Analysis/CMakeFiles/clangAnalysis.dir/ThreadSafetyTIL.cpp.o
cd /work/root/root-6.06.06/build/interpreter/llvm/src/tools/clang/lib/Analysis && /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/work/root/root-6.06.06/build/interpreter/llvm/src/tools/clang/lib/Analysis -I/work/root/root-6.06.06/interpreter/llvm/src/tools/clang/lib/Analysis -I/work/root/root-6.06.06/interpreter/llvm/src/tools/clang/include -I/work/root/root-6.06.06/build/interpreter/llvm/src/tools/clang/include -I/work/root/root-6.06.06/build/include -I/work/root/root-6.06.06/build/interpreter/llvm/src/include -I/work/root/root-6.06.06/interpreter/llvm/src/include -pipe -m64 -Wall -W -Woverloaded-virtual -fsigned-char -fPIC -pthread -std=c++11 -Wno-deprecated-declarations -Wno-comment -Wno-unused-parameter -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-missing-field-initializers -fvisibility=hidden -fPIC -fvisibility-inlines-hidden -std=c++11 -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O2 -DNDEBUG -fno-exceptions -fno-rtti -o CMakeFiles/clangAnalysis.dir/ThreadSafetyTIL.cpp.o -c /work/root/root-6.06.06/interpreter/llvm/src/tools/clang/lib/Analysis/ThreadSafetyTIL.cpp
{standard input}: Assembler messages:
{standard input}:41531: Warning: end of file not at end of a line; newline inserted
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See http://bugzilla.redhat.com/bugzilla for instructions.
make[2]: *** [core/metautils/CMakeFiles/MetaUtilsLLVM.dir/src/Scanner.cxx.o] Error 4
make[2]: *** Deleting file core/metautils/CMakeFiles/MetaUtilsLLVM.dir/src/Scanner.cxx.o' make[2]: Leaving directory/work/root/root-6.06.06/build’
make[1]: *** [core/metautils/CMakeFiles/MetaUtilsLLVM.dir/all] Error 2

There is another related message and then the build fails.

So then I attempted to download standalone LLVM and that also did not work for what looks like similar issues.

Can someone confirm or deny that this compiler is working for them using the latest ROOT (6.6.6) on a Linux 64 system?

What gcc compiler version is known to work for compiling this project? Am I going to need to update to gcc 5?

Thanks.

–Jeremy

Try (ROOT 6.06/06 with gcc 4.[89].x): [code]# install it into …
ROOT_INSTALL_DIR="${HOME}/ROOT/v6-06-06"
rm -rf ${ROOT_INSTALL_DIR}
mkdir -p ${ROOT_INSTALL_DIR}

download, unpack and build it in /tmp

cd /tmp
rm -rf root-build root-6.06.06 root_v6.06.06.source.tar.gz*
wget https://root.cern.ch/download/root_v6.06.06.source.tar.gz
tar -zxf root_v6.06.06.source.tar.gz
mkdir root-build
cd root-build
unset ROOTSYS
cmake -DCMAKE_INSTALL_PREFIX="${ROOT_INSTALL_DIR}" -Dall=“ON” -Dgeocad=“ON” -Dbuiltin_ftgl=“OFF” -Dbuiltin_glew=“OFF” -Dsoversion=“ON” …/root-6.06.06
make
cmake --build . --target install

final cleanup

cd …/
rm -rf root-build root-6.06.06 root_v6.06.06.source.tar.gz*[/code]
For ROOT 6.06/06 with gcc 5.x see: Memory leak in ROOT::Math::IntegratorMultiDim

Last, but not least … you will NOT be able to install ROOT 6, if your gcc compiler comes from the RedHat “Software Collections” / “Developer Toolset” (e.g. on Scientific Linux / CentOS 5, 6 and 7 platforms).

BTW. Before you begin, make sure that nothing in your setup points to any existing ROOT installation. In particular, on Ubuntu execute “sudo apt-get purge root-system* root-plugin* libroot*” and then check that the “/usr/lib/i386-linux-gnu/root5.34” and the “/usr/lib/x86_64-linux-gnu/root5.34” subdirectories disappeared completely.

We are building regularly and successfully 6.06 branch on gcc 4.8 and gcc 4.9 (with CMake).

This must be the problem, as my GCC and CMake looks like it is supported/compatible, but I am using a dev toolset. Thank you for the information.

Are there any plans to support this or is it too difficult? I just ask because this is the first package I’ve found that won’t work with the dev toolsets.

For the time being I will go back to ROOT 5 (unfortunately my institution is only supporting RHLE6 at the moment on desktops and their batch nodes so I’ll have to live with it).

Hi Jeremy,

It looks like sft.its.cern.ch/jira/browse/ROOT-6207 describes why it doesn’t work.

I can confirm that it is possible to use g++ 6.1 with ROOT 6.06 on SL 6.7, as that is the configuration of the computing cluster I use.

[cozzyd@midway-login2 ~]$ cat /etc/redhat-release 
Scientific Linux release 6.7 (Carbon)
[cozzyd@midway-login2 ~]$ which g++
/software/gcc-6.1-el6-x86_64/bin/g++

Obviously PATH and LD_LIBRARY_PATH are defined appropriately (in this case using the modules package).

Note that if you use g++ 5 or 6, you might have to -DGLIBCXX_USE_CXX11_ABI=0 on everything you compile using it otherwise cling may freak out.

Hope you’re doing well,

Hi!
I followed exactly the steps Pepe suggested:

[quote=“Pepe Le Pew”]Try (ROOT 6.06/06 with gcc 4.[89].x): [code]# install it into …
ROOT_INSTALL_DIR="${HOME}/ROOT/v6-06-06"
rm -rf ${ROOT_INSTALL_DIR}
mkdir -p ${ROOT_INSTALL_DIR}

download, unpack and build it in /tmp

cd /tmp
rm -rf root-build root-6.06.06 root_v6.06.06.source.tar.gz*
wget https://root.cern.ch/download/root_v6.06.06.source.tar.gz
tar -zxf root_v6.06.06.source.tar.gz
mkdir root-build
cd root-build
unset ROOTSYS
cmake -DCMAKE_INSTALL_PREFIX="${ROOT_INSTALL_DIR}" -Dall=“ON” -Dgeocad=“ON” -Dbuiltin_ftgl=“OFF” -Dbuiltin_glew=“OFF” -Dsoversion=“ON” …/root-6.06.06
make
cmake --build . --target install

final cleanup

cd …/
rm -rf root-build root-6.06.06 root_v6.06.06.source.tar.gz*[/code]
[/quote]

but then when I compile with “make” I get the following error:

[ 43%] Linking CXX executable ../../bin/rootcling
../CMakeFiles/BaseTROOT.dir/base/src/TROOT.cxx.o: In function `TROOT::FindSTLClass(char const*, bool, bool) const':
/tmp/root-6.06.06/core/base/src/TROOT.cxx:1182: undefined reference to `TClassEdit::GetNormalizedName(std::string&, std::experimental::fundamentals_v1::basic_string_view<char, std::char_traits<char> >)'
collect2: error: ld returned 1 exit status
core/utils/CMakeFiles/rootcling.dir/build.make:791: recipe for target 'bin/rootcling' failed
make[2]: *** [bin/rootcling] Error 1
CMakeFiles/Makefile2:12613: recipe for target 'core/utils/CMakeFiles/rootcling.dir/all' failed
make[1]: *** [core/utils/CMakeFiles/rootcling.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Does anybody have an idea what I can do? Thanks!

Try ROOT 6.06/08 instead of the older 6.06/06 (just replace “6-06-06” with “6-06-08” and “6.06.06” with “6.06.08”).
If is still breaks, specify your exact operating system version and g++ version.

Hi actually I found out that I was accidentally running gcc 4.9. I updated the error message to gcc 5. I am running Ubuntu 16.4. I will try 6.6.8.

If you use gcc 5.x, ROOT 6.06 (note: use 6.06/08 instead of the older 6.06/06) -> Memory leak in ROOT::Math::IntegratorMultiDim

By following your link using version 06.06.08 and using gcc 5 it finally worked. Thank you!

I gave up trying to use the RHEL devtoolsets with ROOT builds, as they do not provide the complete environment from installing the gcc toolchain from scratch, and there ends up being cryptic linking errors that are not solvable.

You can instead build your own gcc and use it instead, which seems to work fine.

This is what worked for me:

wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.gz
tar -zxf gcc-4.8.5.tar.gz
cd gcc-4.8.5
./contrib/download_prerequisites
./configure --prefix=$PWD --disable-multilib
make -j8
make install

Then you would set the necessary environment:

export PATH=$PATH:$PWD/bin
export LD_LIBRARY_PATH=$PWD/lib64:$LD_LIBRARY_PATH

Finally, you can build ROOT as follows, referencing the gcc you just built:

wget https://root.cern.ch/download/root_v6.06.08.source.tar.gz
tar -zxf root_v6.06.08.source.tar.gz
mkdir root-6.06.08-install
cd root-6.06.08-install
cmake -DCMAKE_CXX_COMPILER=`which g++` -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_Fortran_COMPILER=`which gfortran` ../root-6.06.08
make -j8

Provided the gcc compiler you built actually supports C+±11 then it should work fine. I used 4.8.5 but the gcc 5.x versions should work too.