Compiling Root 6 on Ubuntu 16.04

Hi!
When I try to build Root 6.06 from the source, this is the output of cmake:

-- Found GCC. Major version 5, minor version 4
-- Performing Test CXX_SUPPORTS_OLD_ABI
-- Performing Test CXX_SUPPORTS_OLD_ABI - Failed
CMake Error at cmake/modules/CheckCompiler.cmake:61 (message):
  Found GCC compiler with new ABI.  Cling does not support the GCC 5 ABI yet
Call Stack (most recent call first):
  CMakeLists.txt:35 (include)

I have gcc 5.4 installed, do I need an older version of g++?
Thanks!

Hi Giovanni,

an important change has been already applied to the ROOT codebase in order to seamlessly support the new ABI adopted by the most recent gcc versions. As a matter of fact, the ROOT head (which is presently obtainable github.com/root-mirror/root) builds and runs seamlessly on platforms featuring gcc >5.

Cheers,
Danilo

Thanks for your reply, I’ve tried, but there is this error during compiling.

[ 13%] Building CXX object interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o In file included from /home/nitto/root-master/interpreter/cling/lib/Interpreter/InvocationOptions.cpp:13:0: /home/nitto/root-master/interpreter/cling/../llvm/src/tools/clang/include/clang/Driver/Options.h:41:36: fatal error: clang/Driver/Options.inc: No such file or directory compilation terminated. interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/build.make:643: recipe for target 'interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o' failed make[2]: *** [interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o] Error 1 CMakeFiles/Makefile2:8445: recipe for target 'interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all' failed make[1]: *** [interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2

[quote=“dpiparo”]Hi Giovanni,

an important change has been already applied to the ROOT codebase in order to seamlessly support the new ABI adopted by the most recent gcc versions. As a matter of fact, the ROOT head (which is presently obtainable github.com/root-mirror/root) builds and runs seamlessly on platforms featuring gcc >5.

Cheers,
Danilo[/quote]

Did you fulfil the root.cern.ch/build-prerequisites ? How are you configuring?

I’ve installed all the packages required. This is the output of cmake configuration.
Thanks for your help.

nitto@nitto-Inspiron-7548:/tmp/root-build$ cmake -DCMAKE_INSTALL_PREFIX="${ROOT_INSTALL_DIR}" -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" -Dcxx14="ON" -Dall="ON" -Ddavix="OFF" -Dr="OFF" -Dpythia8="OFF" -Dgeocad="ON" -Dbuiltin_ftgl="OFF" -Dbuiltin_glew="OFF" -Dsoversion="ON" ../root-master -- Found GCC. Major version 5, minor version 4 -- Found a 64bit system -- Found GNU compiler collection -- ROOT Platform: linux -- ROOT Architecture: linuxx8664gcc -- Build Type: RelWithDebInfo -- Compiler Flags: -D_GLIBCXX_USE_CXX11_ABI=0 -pipe -m64 -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -fPIC -pthread -std=c++14 -Wno-deprecated-declarations -O2 -g -DNDEBUG -- Looking for ZLib -- Looking for Freetype -- Looking for PCRE -- Building LZMA version 5.2.1 included in ROOT itself -- Looking for X11 -- Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR) -- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) -- Building AfterImage library included in ROOT itself -- Looking for GSL -- Looking for Python -- Found Python interpreter version 2.7 -- Looking for OpenGL -- Looking for Graphviz -- Looking for Qt4 -- Looking for Bonjour -- Checking whether Bonjour/Avahi is supported -- Looking for Kerberos 5 -- Looking for LibXml2 -- Looking for OpenSSL -- Looking for MySQL -- Looking for FFTW3 -- Could NOT find OCC (missing: OCC_INCLUDE_DIR OCC_TKPrim_LIBRARY OCC_TKBRep_LIBRARY OCC_TKOffset_LIBRARY OCC_TKGeomBase_LIBRARY OCC_TKShHealing_LIBRARY OCC_TKTopAlgo_LIBRARY OCC_TKSTEP_LIBRARY OCC_TKG2d_LIBRARY OCC_TKBool_LIBRARY OCC_TKBO_LIBRARY OCC_TKXCAF_LIBRARY OCC_TKXDESTEP_LIBRARY OCC_TKLCAF_LIBRARY OCC_TKernel_LIBRARY OCC_TKXSBase_LIBRARY OCC_TKG3d_LIBRARY OCC_TKMath_LIBRARY) -- OpenCascade libraries not found. Set variable CASROOT to point to your OpenCascade installation -- For the time being switching OFF 'geocad' option -- Enabled support for: asimage astiff bonjour builtin_afterimage builtin_gl2ps builtin_unuran builtin_lzma builtin_llvm cxx14 cling exceptions explicitlink fftw3 fortran gviz gdml genvector http krb5 ldap mathmore memstat minuit2 mysql opengl pch python qt qtgsi roofit root7 shadowpw shared soversion ssl table thread tmva unuran vdt xft xml x11 -- Target triple: x86_64-unknown-linux-gnu -- Native target architecture is X86 -- Threads disabled. -- Doxygen disabled. -- Sphinx disabled. -- Go bindings disabled. -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) -- OCaml bindings disabled. -- Building with -fPIC -- Constructing LLVMBuild project information -- Targeting X86 -- Clang version: 3.9.0 -- Cling version (from VERSION file): ROOT_0.4~dev -- Cling will look for C++ headers in '/usr/include/c++/5:/usr/include/x86_64-linux-gnu/c++/5:/usr/include/c++/5/backward' at runtime. -- And if not found, will invoke: 'c++' for them. -- Configuring done -- Generating done -- Build files have been written to: /tmp/root-build

Try to execute: No graphical output
and then try to build your ROOT from scratch (i.e. first delete everything) again.
BTW. Note that with the “root-master”, you should not need to use -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" any more (which is needed with ROOT 6.06), so try: cmake -DCMAKE_INSTALL_PREFIX="${ROOT_INSTALL_DIR}" -Dcxx14="ON" -Dall="ON" -Dgeocad="ON" -Dbuiltin_ftgl="OFF" -Dbuiltin_glew="OFF" -Dsoversion="ON" ../root-master

I’ve tried to follow your hints, but there is always the same error during the compilation. I have also tried to install the ‘libclang-dev’ package, but nothing changes. Thanks for your patience.

[ 11%] Building CXX object interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o In file included from /tmp/root-master/interpreter/cling/lib/Interpreter/InvocationOptions.cpp:13:0: /tmp/root-master/interpreter/cling/../llvm/src/tools/clang/include/clang/Driver/Options.h:41:36: fatal error: clang/Driver/Options.inc: No such file or directory compilation terminated. interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/build.make:643: recipe for target 'interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o' failed make[2]: *** [interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o] Error 1 CMakeFiles/Makefile2:8464: recipe for target 'interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all' failed make[1]: *** [interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2

[quote=“Pepe Le Pew”]Try to execute: No graphical output
and then try to build your ROOT from scratch (i.e. first delete everything) again.
BTW. Note that with the “root-master”, you should not need to use -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" any more (which is needed with ROOT 6.06), so try: cmake -DCMAKE_INSTALL_PREFIX="${ROOT_INSTALL_DIR}" -Dcxx14="ON" -Dall="ON" -Dgeocad="ON" -Dbuiltin_ftgl="OFF" -Dbuiltin_glew="OFF" -Dsoversion="ON" ../root-master[/quote]

Maybe the “root-master” is broken.
Try to build ROOT 6.06/06 (as in the link in my first post here).

I’ve tried again with the link in your first post and now it works! Thanks!
I think that there was a file important for compiling in the package ‘libclang-dev’.

[quote=“Pepe Le Pew”]Maybe the “root-master” is broken.
Try to build ROOT 6.06/06 (as in the link in my first post here).[/quote]

If the Ubuntu system provided “libclang-dev” package interferes with ROOT 6 then this is a serious problem (this may mean that ROOT 6 took “clang” instead of “gcc”, at least for part of its installation, and maybe it also tried to use any Ubuntu’s “cling”, if you have it installed).

Try to execute:
root-config --cxx
and see if you get “g++”.

There is a similar mysterious problem reported here: ROOT build suddenly failing (Ubuntu 16.04 LTS)
Maybe you could try to run (report here what is found):
sudo dpkg --list “*”|grep -i “cl[ai]ng”

Sorry for bumping this thread, I am having a similar issue in an specific configuration of the cmake file. My question is, are all the cmake flags necessary or just the -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" is needed?

This is my cmake file (Ihave tried root 6-06-04 and 6-06-06):

cmake ../ -Dsoversion=ON $PYTHONBUILD $XROOTD $ROOFIT \ -Dminuit2=ON -Dgdml=ON -Dxml=ON \ -Dbuiltin-ftgl=ON -Dbuiltin-glew=ON \ -Dbuiltin-freetype=ON $OPENGL \ -Dmysql=ON -Dpgsql=ON -Dasimage=ON \ -DPYTHIA6_DIR=$SIMPATH_INSTALL \ -DPYTHIA8_DIR=$SIMPATH_INSTALL \ -Dglobus=OFF \ -Dreflex=OFF \ -Dcintex=OFF \ $VC \ -Dhttp=ON \ -DGSL_DIR=$SIMPATH_INSTALL \ -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" \ -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_C_COMPILER=$CC \ -DCMAKE_F_COMPILER=$FC $root_comp_flag $prefix_string \ $etc_string -Dgnuinstall=ON \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE

But I get an error when linking one of the libraries (libNetxNG):

collect2: error: ld returned 1 exit status net/netxng/CMakeFiles/NetxNG.dir/build.make:194: recipe for target 'lib/libNetxNG.so.6.06.02' failed make[2]: *** [lib/libNetxNG.so.6.06.02] Error 1 CMakeFiles/Makefile2:16184: recipe for target 'net/netxng/CMakeFiles/NetxNG.dir/all' failed make[1]: *** [net/netxng/CMakeFiles/NetxNG.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2 **** Checking libraries in /home/attpc/fair_install/FairSoftInst_may2016_ABI0/lib **** *** ERROR: root could not be created. create a symbolic linking for Vc library .... libVc.a not found in lib dirctory *** End installation of external packages with Errors*** attpc@control:~/fair_install/FairSoft_may2016$

Thank you very much in advance
Y.

The “-D_GLIBCXX_USE_CXX11_ABI=0” is needed if you use gcc 5.x to build ROOT 6.06. Moreover, any additional C++ library, that you want to use, will need to be compiled with the same setting (this usually means that one needs to enforce, for example, -Ddavix=“OFF” -Dr=“OFF” -Dpythia8=“OFF”, as they are usually not compiled with this setting).

Thank you very much for your fast answer. I will test it again with these flag and I will report what I get.

Cheers
Y.

Hi,
I want to use R as well. So how do I manage that ?

For the time being, on Ubuntu 16.04, if you want to use R, you either need ROOT 5.34 (for best results, take the “head of the v5-34-00-patches branch”) or the current ROOT 6 head (i.e. the source code that becomes ROOT 6.08/00 in future).

I can confirm that I am able to build the ROOT master (6.07/07) in Ubuntu 16.04, cmake, gcc 5.4 without the need to use the -D_GLIBCXX_USE_CXX11_ABI=0 flag. libclang-dev is not needed. BUT “make -j4” instead of “make” is needed.

[quote=“giovannistagnitto”]I’ve tried to follow your hints, but there is always the same error during the compilation. I have also tried to install the ‘libclang-dev’ package, but nothing changes. Thanks for your patience.

[ 11%] Building CXX object interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o In file included from /tmp/root-master/interpreter/cling/lib/Interpreter/InvocationOptions.cpp:13:0: /tmp/root-master/interpreter/cling/../llvm/src/tools/clang/include/clang/Driver/Options.h:41:36: fatal error: clang/Driver/Options.inc: No such file or directory compilation terminated. interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/build.make:643: recipe for target 'interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o' failed make[2]: *** [interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/InvocationOptions.cpp.o] Error 1 CMakeFiles/Makefile2:8464: recipe for target 'interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all' failed make[1]: *** [interpreter/cling/lib/Interpreter/CMakeFiles/obj.clingInterpreter.dir/all] Error 2 Makefile:149: recipe for target 'all' failed make: *** [all] Error 2
[/quote]

The final explanation for this mysterious problem has been found here:

It has nothing to do with libclang-dev

I would love to know the solution but your link does not lead anywhere.

When migrating the old forum to the new one, the engine converted my link incorrectly.

The post I was referring to is:

See also:

The JIRA ticket is:
https://sft.its.cern.ch/jira/browse/ROOT-8392

1 Like