Older Root Package

Your “CMakelists.txt” file does not use ROOT at all:

BTW. You need to have ROOT and Geant4 built so that they all use the same C++ standard (i.e., C++11 or C++14 or C++17): ROOT Forum → Search → Geant4 C++ standard

Thanks Wile,

I will check out the manuals tomorrow, I do remember using some of the tips you have listed, but perhaps not the right ones. I know that the CMakeFiles.txt does not contain root links - it is the one that is used by the project exampleB1.cc, which does not use root at all. I modified it and I believed it worked but looks like I need to use the correct methodology. Thanks for all these great tips! I am a starter, but once I get started, I can go on well as I can get my colleague to help me, once he is able to see what he first created. Have a great evening!

Good Afternoon
I do believe I followed the right steps which is how I got to the point where the cmake worked, the object files were created and I am facing errors within the headers, not with version. I do not see those messages that could have resulted from a different version. I built everything in the same account Both root and Geant4 have been downloaded and built in the same place, in the same old fedora version. What I will do is try to run add the same root headers in a G4 program that works, and find out if adding those root headers gives me the same errors. I can do that easily and update you.

Good Morning Wile,

this is what I get:

[neera@vm-nii-fc27-a ~/xraywest] echo ROOTSYS={ROOTSYS}
ROOTSYS=/home/neera/root
[neera@vm-nii-fc27-a ~/xraywest] root-config --prefix /home/neera/root [neera@vm-nii-fc27-a ~/xraywest] root-config --cflags
-pthread -std=c++14 -m64 -I/home/neera/root/include
[neera@vm-nii-fc27-a ~/xraywest]$

When building your Geant4 application, you should see the “/home/neera/root” string quite a few times in your “make.log.txt” file (otherwise you application does try to not use ROOT at all).

Your ROOT uses “-std=c++14” but your Geant4 uses “-std=c++11” (see your “make.log.txt” file). They will not play together.

You need to have ROOT and Geant4 built so that they all use the same C++ standard (i.e., C++11 or C++14 or C++17): ROOT Forum → Search → Geant4 C++ standard

OK, what do I do now? Do I reinstall Geant4 (which was installed a few years ago, hence the older C++ version)

Good Morning Wile,

I tried the command for making my Geant4 C++14 aware. The command gives me the following error (even though I asked my admin to execute it). We did exactly what it asked us to do, created a build directory, copied the CMakeLists.txt file in there and tried to run cmake from the build directory. this is what happened:

[root@vm-nii-fc27-a build]# cmake -DGEANT4_BUILD_CXXSTD=14
– Geant4 requires an out-of-source build.
– Please remove these files from /opt/geant4/geant4.10.04.p02/build first:
– CMakeCache.txt
– CMakeFiles
– Once these files are removed, create a separate directory
– and run CMake from there
CMake Error at CMakeLists.txt:19 (message):
in-source build detected

– Configuring incomplete, errors occurred!
[root@vm-nii-fc27-a build]# ls
CMakeCache.txt CMakeFiles CMakeLists.txt
[root@vm-nii-fc27-a build]#

i actually reinstalled Geant4, hoping that it would change the standard, but it did not. Now when I try to execute the command

[root@vm-nii-fc27-a geant4.10.04-build]# cmake -DGEANT4_BUILD_CXXSTD=14
CMake Error: The source directory “/opt/geant4/geant4.10.04-build” does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

cmake -DGEANT4_BUILD_CXXSTD=14 /path/to/geant4/source/directory

Thanks Wile. I actually figured that out and was able to execute the command, as well as give the data ON option in the same command. I also executed the make -j4 command successfully. I was unable to test the xraywest, as time did not permit. I will post the result when i do that.

Start with:

find /path/to/geant4/source/directory -name CMakeLists.txt -exec grep -l ROOT_ "{}" \;

Good Morning Wile,

This is what I get:

neera@vm-nii-fc27-a ~] find ../opt/geant4/geant4.10.04.p02 -name CMakeLists.txt -exec grep -l ROOT_ "{}" \;find: ‘../opt/geant4/geant4.10.04.p02’: No such file or directory [neera@vm-nii-fc27-a ~] cd …
[neera@vm-nii-fc27-a /home] cd .. [neera@vm-nii-fc27-a /] find …/opt/geant4/geant4.10.04.p02 -name CMakeLists.txt -exec grep -l ROOT_ “{}” ;
…/opt/geant4/geant4.10.04.p02/examples/extended/parallel/MPI/examples/exMPI02/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/extended/analysis/AnaEx02/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/extended/analysis/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/extended/medical/dna/chem4/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/extended/medical/dna/chem4/plot/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/extended/persistency/P02/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/extended/persistency/P01/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/extended/persistency/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/advanced/iort_therapy/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/advanced/brachytherapy/CMakeLists.txt
…/opt/geant4/geant4.10.04.p02/examples/advanced/ChargeExchangeMC/CMakeLists.txt
[neera@vm-nii-fc27-a /]$

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