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?
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.
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).
[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
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.
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