Including ROOT headers in GEANT4 both on windows machine and cvmf

Hello, I need to include ROOT headers in GEANT4 simulation. I did it following GEANT4 examples, but both running my simulation and preset examples I get errors that look like related to ROOT headers.

Here th warnings and error got in my computer (windows machine)
windows errors.txt (4.3 KB)

Here the errors got using cvmfs

cvmfs errors.txt (465.2 KB)

Are there ROOT problems?

About the CVMFS errors → you try to mix ROOT binaries compiled with GCC 4.8(.5) with GEANT4 binaries compiled with GCC 8.3.0. This will not work. You need to have both tools built with the same compiler and using the same C++ standard (i.e., C++11 or C++14 or C++17):

ROOT Forum → Search → Geant4 C++ standard

Hello @Wile_E_Coyote , in my bash profile I use

these sources for geant4

source /cvmfs/sft.cern.ch/lcg/contrib/gcc/8.3.0/x86_64-centos7-gcc8-opt/setup.sh
source /cvmfs/geant4.cern.ch/geant4/10.7.p03/x86_64-centos7-gcc8-optdeb-MT/bin/geant4.sh 
source /cvmfs/geant4.cern.ch/geant4/10.7.p03/x86_64-centos7-gcc8-optdeb-MT/CMake-setup.sh

and this one for ROOT

source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.24.00/x86_64-centos7-gcc48-opt/bin/thisroot.sh

do you know which one I should use?

Hello @wile_e_coyote, I tried to use

for geant

source /cvmfs/sft.cern.ch/lcg/contrib/gcc/9.3.0/x86_64-centos8-gcc9-opt/setup.sh
source /cvmfs/geant4.cern.ch/geant4/10.7.p03/x86_64-centos7-gcc9-optdeb-MT/bin/geant4.sh
source /cvmfs/geant4.cern.ch/geant4/10.7.p03/x86_64-centos7-gcc9-optdeb-MT/CMake-setup.sh

and for Root

source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.26.00/x86_64-ubuntu20-gcc93-opt/bin/thisroot.sh

so that, both ROOT and GEANT have been compilied by gcc9.3, but if I try to use Geant (a simuluation not including TH1D, then working on my previous GEANT version)

I get this error

 
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /cvmfs/sft.cern.ch/lcg/releases/gcc/9.3.0-6991b/x86_64-centos8/bin/gcc
-- Check for working C compiler: /cvmfs/sft.cern.ch/lcg/releases/gcc/9.3.0-6991b/x86_64-centos8/bin/gcc -- broken
CMake Error at /cvmfs/sft.cern.ch/lcg/contrib/CMake/3.14.2/Linux-x86_64/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/cvmfs/sft.cern.ch/lcg/releases/gcc/9.3.0-6991b/x86_64-centos8/bin/gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/casaburf/20221027/B1/B1-build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake cmTC_b392e/fast
    /usr/bin/gmake -f CMakeFiles/cmTC_b392e.dir/build.make CMakeFiles/cmTC_b392e.dir/build
    gmake[1]: Entering directory `/home/casaburf/20221027/B1/B1-build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_b392e.dir/testCCompiler.c.o
    /cvmfs/sft.cern.ch/lcg/releases/gcc/9.3.0-6991b/x86_64-centos8/bin/gcc    -o CMakeFiles/cmTC_b392e.dir/testCCompiler.c.o   -c /home/casaburf/20221027/B1/B1-build/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_b392e
    /cvmfs/sft.cern.ch/lcg/contrib/CMake/3.14.2/Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b392e.dir/link.txt --verbose=1
    /cvmfs/sft.cern.ch/lcg/releases/gcc/9.3.0-6991b/x86_64-centos8/bin/gcc      CMakeFiles/cmTC_b392e.dir/testCCompiler.c.o  -o cmTC_b392e
    /cvmfs/sft.cern.ch/lcg/releases/binutils/2.34-990b2/x86_64-centos8/bin/ld: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by /cvmfs/sft.cern.ch/lcg/releases/binutils/2.34-990b2/x86_64-centos8/bin/ld)
    collect2: error: ld returned 1 exit status
    gmake[1]: *** [cmTC_b392e] Error 1
    gmake[1]: Leaving directory `/home/casaburf/20221027/B1/B1-build/CMakeFiles/CMakeTmp'
    gmake: *** [cmTC_b392e/fast] Error 2




  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)


-- Configuring incomplete, errors occurred!

while, if I try to run ROOT I get this one

root: /lib64/libc.so.6: version GLIBC_2.18’ not found (required by /cvmfs/sft.cern.ch/lcg/releases/gcc/9.3.0-6991b/x86_64-centos8/lib64/libstdc++.so.6)`

Then, I don’t know which version of GEANT and ROOT I should use…
Here the bash file
.bash_profile.txt (2.8 KB)

I’m tryin a lot of ROOTS on cvmfs…but it looks like that only the ones compiled as

x86_64-centos7-gcc48-opt/

could it depends on some setting in the laboratory machine where cvmfs is installed?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.