Older Root Package

Hi Wile,

Here you go - hope you are able to open the log and figure out the issue.

make.log.txt (14.4 KB)

Thanks,

Neera

What do you get from:
echo ROOTSYS=${ROOTSYS}
root-config --prefix
root-config --cflags

Hi Wile,

I am back home and will get back to you with those results on Thursday. I apologize for this stretched out plan, but this is the best I can do for now. What I am supposed to get?

Also, I would like to know if if can proceed step by step and tackle one error at a time:

/home/neera/root/include/Rtypes.h:281:67: error: expected primary-expression before ‘)’ token
::ROOT::Internal::HasConsistentHashMember(QUOTE(name)) ||
/home/neera/root/include/Rtypes.h:281:55: error: ‘QUOTE’ was not declared in this scope
::ROOT::Internal::HasConsistentHashMember(QUOTE(name)) ||
/home/neera/root/include/Rtypes.h:275:11: error: ‘R__likely’ was not declared in this scope
if (R__likely(recurseBlocker >= 2)) { \

It looks like your “west” (“xraywest”) application did not use your ROOT distribution at all.

I am not able to get to the creation of the executable at this point, due to syntax errors. I removed (or commented out) all the root headers that were not used, but the error messages did not diminish or change.

This is a Geant4 application, so try: Geant4 → User Forum

Also, try to contact the author of your “west” (“xraywest”) application.

The author of xraywest (which uses west.cc, as you correctly noticed) is my colleague. He worked on this project five years ago, when the root version was old and somehow it worked then. Now he doesn’t use cmake, so he tried everything possible on my account but the core dumped ; it did not proceed with creation of the object files either. My version of Geant4 uses cmake and the makefile can only be created via cmake.

I successfully executed cmake. I am having issues with make. I can share the CMakeFiles.text, which I had modified to include root headers. It basically includes globs all headers and sources (very similar to the attached file, except that the project name is changed, in and out files removed and root header path added, as exampleB1 does not use root at all
CMakelists.txt (2.5 KB)

This far I am able to provide the link to the root headers, alongwith Geant4 headers to my version of Geant4. Stuck with the errors, though

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.