# Older Root Package

**URL:** <https://root-forum.cern.ch/t/older-root-package/52823>\
**Category:** ROOT\
**Created:** [December 19, 2022, 6:44pm UTC](https://root-forum.cern.ch/t/older-root-package/52823 "2022-12-19T18:44:55Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 3, 2023, 9:42pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/23 "2023-01-03T21:42:19Z")

</div>

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

- [ROOT Manual → Basics → Integrating ROOT into CMake projects](https://root.cern/manual/integrate_root_into_my_cmake_project/)

- [How to Integrate ROOT into my project with CMake](https://root-forum.cern.ch/t/how-to-integrate-root-into-my-project-with-cmake/37175)

- Some Geant4 examples use ROOT, so you can look there.

- An additional example: [GitHub - eguiraud/root-readspeed: A tool to measure what throughput can be expected from ROOT for a given application](https://github.com/eguiraud/root-readspeed/)

BTW. You need to have [ROOT and Geant4 built so that they all use the same C++ standard](https://root-forum.cern.ch/t/problem-in-installation/45918/12) (i.e., `C++11` or `C++14` or `C++17`): [ROOT Forum → Search → Geant4 C++ standard](https://root-forum.cern.ch/search?q=Geant4%20C%2B%2B%20standard%20order%3Alatest)

---

<div class="post-metadata">

**Author:** ![blessed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/blessed/32/32314_2.png) [@blessed](https://root-forum.cern.ch/u/blessed)\
**Post date:** [January 3, 2023, 9:53pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/24 "2023-01-03T21:53:21Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![blessed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/blessed/32/32314_2.png) [@blessed](https://root-forum.cern.ch/u/blessed)\
**Post date:** [January 4, 2023, 8:26pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/25 "2023-01-04T20:26:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![blessed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/blessed/32/32314_2.png) [@blessed](https://root-forum.cern.ch/u/blessed)\
**Post date:** [January 5, 2023, 3:32pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/26 "2023-01-05T15:32:50Z")

</div>

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]$

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 5, 2023, 3:40pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/27 "2023-01-05T15:40:49Z")

</div>

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](https://root-forum.cern.ch/t/problem-in-installation/45918/12) (i.e., `C++11` or `C++14` or `C++17`): [ROOT Forum → Search → Geant4 C++ standard](https://root-forum.cern.ch/search?q=Geant4%20C%2B%2B%20standard%20order%3Alatest)

---

<div class="post-metadata">

**Author:** ![blessed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/blessed/32/32314_2.png) [@blessed](https://root-forum.cern.ch/u/blessed)\
**Post date:** [January 5, 2023, 4:25pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/28 "2023-01-05T16:25:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![blessed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/blessed/32/32314_2.png) [@blessed](https://root-forum.cern.ch/u/blessed)\
**Post date:** [January 11, 2023, 3:35pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/29 "2023-01-11T15:35:45Z")

</div>

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]#

---

<div class="post-metadata">

**Author:** ![blessed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/blessed/32/32314_2.png) [@blessed](https://root-forum.cern.ch/u/blessed)\
**Post date:** [January 11, 2023, 6:35pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/30 "2023-01-11T18:35:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 11, 2023, 8:09pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/31 "2023-01-11T20:09:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![blessed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/blessed/32/32314_2.png) [@blessed](https://root-forum.cern.ch/u/blessed)\
**Post date:** [January 11, 2023, 11:28pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/32 "2023-01-11T23:28:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 12, 2023, 8:37am UTC](https://root-forum.cern.ch/t/older-root-package/52823/33 "2023-01-12T08:37:36Z")

</div>

Start with:

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

---

<div class="post-metadata">

**Author:** ![blessed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/blessed/32/32314_2.png) [@blessed](https://root-forum.cern.ch/u/blessed)\
**Post date:** [January 16, 2023, 4:39pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/36 "2023-01-16T16:39:44Z")

</div>

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 /]$

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [January 30, 2023, 4:40pm UTC](https://root-forum.cern.ch/t/older-root-package/52823/37 "2023-01-30T16:40:01Z")

</div>

Closed on January 30, 2023, 4:40pm UTC

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

[Previous page](https://root-forum.cern.ch/t/older-root-package/52823.md?page=1)
