Issue compiling Root

Hi everyone

Im a complete beginner using ROOT so please be patient

Ultimately I would like to load a gdml file like so: “TGeoManager::Import(“tileFingerPos.gdml”);”
I have not been able to make this work in root from the download using: “sudo yum install root”

Instead I try to download it from from the git and with the wget command. After downloading do I try to compile it using "cmake3 CMakeLists.txt ", but it doesnt work. I have included the CmakeError below.

gcc version:

Does anyone know what the problem could be?

Many thanks


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /usr/bin/cc 
Build flags: 
Id flags:  

The output was:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../ when searching for -lc
/usr/bin/ld: skipping incompatible //lib/ when searching for -lc
/usr/bin/ld: skipping incompatible //usr/lib/ when searching for -lc
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/c++ 
Build flags: 
Id flags:  

The output was:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ error adding symbols: File format not recognized
collect2: error: ld returned 1 exit status

Determining if the C compiler works failed with the following output:
Change Dir: /home/cbjorkma/install/root/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/gmake" "cmTC_21dc3/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_21dc3.dir/build.make CMakeFiles/cmTC_21dc3.dir/build
gmake[1]: Entering directory `/home/cbjorkma/install/root/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_21dc3.dir/testCCompiler.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_21dc3.dir/testCCompiler.c.o   -c /home/cbjorkma/install/root/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_21dc3
/usr/bin/cmake3 -E cmake_link_script CMakeFiles/cmTC_21dc3.dir/link.txt --verbose=1
/usr/bin/cc      -rdynamic CMakeFiles/cmTC_21dc3.dir/testCCompiler.c.o  -o cmTC_21dc3 
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../ when searching for -lc
/usr/bin/ld: skipping incompatible //lib/ when searching for -lc
/usr/bin/ld: skipping incompatible //usr/lib/ when searching for -lc
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTC_21dc3] Error 1
gmake[1]: Leaving directory `/home/cbjorkma/install/root/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_21dc3/fast] Error 2

Please give us some more information about your system, the above is not sufficient. Are you cross-compiling ROOT? I think that if you are using the dev toolset that’s not supported by ROOT, although it may be possible to configure and build ROOT with that. It seems you may have a mismatch between 32bit and 64bit libraries when compiling ROOT. Can you install epel-release on your distribution? If yes, then after that you should be able to use yum install root. Cheers,

Thanks for the answer

Im running CC7 on Linux 3.10.0-957.el7.x86_64 x86_64

“Are you cross-compiling ROOT?”
I dont know what this means

epel-release is already installed

My issue could be related to my root variables. The yum installed version is installed in /usr/bin/ and I point my root variables there, but Im not sure if it works. I get this:

My root variables are set up in my .bashrc like this:
export ROOTSYS=/usr/bin/root
export PATH=$ROOTSYS/bin:$PATH

What do you think?



I assume you want: yum install root-*

Note: instead of installing the ROOT version provided by “yum” (yum remove root-*), you’d better start with the ready-to-use binary distributions for CentOS Cern 7 gcc4.8 / x86_64, which are provided by the ROOT team, which you just need to download and unpack.

No, we do recommend to use the version from epel-release. Then you don’t need to set anything up in your shell variables. Just run root from /usr/bin/. Please remove ROOTSYS, etc from your bashrc and try again. If you have any problems, you should let us know or file a bug directly at You should also not source from /usr/bin if it’s there.

Yes, you do recommend it but, I strongly do not.

I removed root with yum remove root-* and the installed it again with yum install root-* and now there seem to be some progress.

Somethings strange I get when I execute root from my CC7 machine is this below. Does it perhaps which machine my older VM called “Motherbrain”?. Below is what happens when I run root:

*** DISPLAY not set, setting it to
PopupLogo, XOpenDisplay failed
  | Welcome to ROOT 6.14/08       |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for linuxx8664gcc                                    |
  | From tags/v6-14-08@v6-14-08, Nov 22 2018, 08:48:56         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |

Could this be a reason for TGeoManager not drawing my geometry?



Try to login to your VM using “ssh -X -Y ...”.

I believe we are getting closer

I can now load the gdml file. It complains about some null arguments when I try to draw the content of the file. How can I get around this problem? Can I do something with “-Wnonnull” perhaps?


[cbjorkma@rootdaniel Root]$ root
X11 connection rejected because of wrong authentication.
PopupLogo, XOpenDisplay failed
  | Welcome to ROOT 6.14/08       |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for linuxx8664gcc                                    |
  | From tags/v6-14-08@v6-14-08, Nov 22 2018, 08:48:56         |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |

root [0] gSystem->Load("libGeom")
(int) 0
root [1] TGeoManager *geo=new TGeoManager();
root [2] geo->Import("example.gdml")
Info in <TGeoManager::Import>: Reading geometry from file: example.gdml
Info in <TGeoManager::TGeoManager>: Geometry GDMLImport, Geometry imported from GDML created
Warning in <TGeoMaterial::ctor>: Material sTrackerOTPassiveMix defined with fractional Z=7.085650
Info in <TGeoManager::SetTopVolume>: Top volume is World. Master volume is World
Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100
Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...
Info in <TGeoManager::CheckGeometry>: ...Nothing to fix
Info in <TGeoManager::CloseGeometry>: Counting nodes...
Info in <TGeoManager::Voxelize>: Voxelizing...
Info in <TGeoManager::CloseGeometry>: Building cache...
Info in <TGeoManager::CountLevels>: max level = 4, max placements = 36
Info in <TGeoManager::CloseGeometry>: 1744 nodes/ 21 volume UID's in Geometry imported from GDML
Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------
(TGeoManager *) 0x25064d0


root [3] TGeoVolume* Test= gGeoManager->GetVolume("Test");
root [4] Test->Draw()
#0  0x00007f474b2a7a3c in waitpid () from /lib64/
#1  0x00007f474b225de2 in do_system () from /lib64/
#2  0x00007f474be061b4 in TUnixSystem::StackTrace() () from /usr/lib64/root/
#3  0x00007f4746bf6705 in cling::MultiplexInterpreterCallbacks::PrintStackTrace() () from /usr/lib64/root/
#4  0x00007f4746bf5c3b in cling_runtime_internal_throwIfInvalidPointer () from /usr/lib64/root/
#5  0x00007f474c55c086 in ?? ()
#6  0x00007f4746bf5bf0 in ?? () from /usr/lib64/root/
#7  0x00000000007af370 in ?? ()
#8  0x000000000276b340 in ?? ()
#9  0x00007ffced017160 in ?? ()
#10 0x00007ffced016d40 in ?? ()
#11 0x00007f4746bf7b5d in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /usr/lib64/root/
#12 0x00007f4746bf873c in cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) () from /usr/lib64/root/
#13 0x00007f4746bf8946 in cling::Interpreter::process(std::string const&, cling::Value*, cling::Transaction**, bool) () from /usr/lib64/root/
#14 0x00007f4746c91f48 in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) () from /usr/lib64/root/
#15 0x00007f4746b6dc5a in HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /usr/lib64/root/
#16 0x00007f4746b85902 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /usr/lib64/root/
#17 0x00007f474bccbe2a in TApplication::ProcessLine(char const*, bool, int*) () from /usr/lib64/root/
#18 0x00007f474c136daf in TRint::ProcessLineNr(char const*, char const*, int*) () from /usr/lib64/root/
#19 0x00007f474c13714b in TRint::HandleTermInput() () from /usr/lib64/root/
#20 0x00007f474be074c5 in TUnixSystem::CheckDescriptors() () from /usr/lib64/root/
#21 0x00007f474be0876a in TUnixSystem::DispatchOneEvent(bool) () from /usr/lib64/root/
#22 0x00007f474bd2c0c6 in TSystem::InnerLoop() () from /usr/lib64/root/
#23 0x00007f474bd2cff0 in TSystem::Run() () from /usr/lib64/root/
#24 0x00007f474bcca2ef in TApplication::Run(bool) () from /usr/lib64/root/
#25 0x00007f474c138965 in TRint::Run(bool) () from /usr/lib64/root/
#26 0x00000000004008aa in main ()
Error in <HandleInterpreterException>: Trying to dereference null pointer or trying to call routine taking non-null arguments.
Execution of your code was aborted.
ROOT_prompt_4:1:1: warning: null passed to a callee that requires a non-null argument [-Wnonnull]

I think the last error is in your code (i.e. Test might be null). In any case, to rule out X11 issues, you can try root -e .demo and click on hsimple to check that things are working.

Amido should the “Test” variable/name be of something particular? I just pulled that one out of the hat

Below you can see me logging in with “ssh -Y” and still get this issue with “root -e .demo”



I know. Your recommendation is out of date. Using is bad practice, as well as using ROOT from the build directory. It’s something we should not teach new people to do. ROOT works perfectly fine when installed in the system or via the package manager due to the hard work of several volunteers that are packaging it for Fedora, Arch, Homebrew, conda, etc.

Just to give an example, if you source from a location that has more software installed (e.g. an LCG release), then source another for another version of ROOT, it will remove the paths to the first location and break your environment. If ROOT was in /usr/local/ like when installed with Homebrew, for example, it will remove paths to Homebrew software, not just ROOT. Another reason is that the build directories of ROOT are much larger than an installation. For example, my current build directory of ROOT that doesn’t even have everything I can enabled has 4.2G in size, with everything enabled, it becomes ~6G. My ROOT installations are much smaller, as you can see below. I also have multiple versions of ROOT that work alongside each other, all installed via the system package manager on Gentoo.

epsft-53 ~ $ equery size root
 * sci-physics/root-6.12.06-r9
         Total files : 5762
         Total size  : 281.43 MiB
 * sci-physics/root-6.14.08-r2
         Total files : 5884
         Total size  : 299.30 MiB
 * sci-physics/root-6.16.00
         Total files : 6053
         Total size  : 289.38 MiB