[CMake] Integrating ROOT into Geant4 application

Dim, Odera U Odera_Dim at student.uml.edu
Thu Dec 7 17:25:49 EST 2017


Hi,

First of all sorry but I didn't get any previous mail before this, hence my lack of response. I actually had to ask Libby to help me some moments ago before I now just received your email.

Secondly, I have tried to post this issue on both the ROOT and Geant4 forums and have not received any feedback so far.

The application I'm building is for in-house use so it won't be distributed. The application I have built in Geant4 has a class (i.e. analysis.cc<http://analysis.cc>) that uses a number of function header like TH2D.h, TROOT etc to setup a means to extract data produced in my Geant4 application. For example I have created an instance of analysis.cc<http://analysis.cc> in my events class such that after each even I can collect the number of particles produced. Now what I have in my CMakeList.txt is structured such that the Geant4 application can function weather ROOT is installed or not. I have attached my CMakeList.txt file for you to kindly look through.

The error I get as I may have mentioned before in my previous email occurs when I run the Geant4 application. Since the error makes mention of the LLVM being exposed to cling my little knowledge on the subject inclines me to thinking that some how the way I have the Libraries linked to my application might be the issue (however, I may be wrong). Also I have been able to build, compile and run this Geant4 application with no error if I remove ROOT from my build. On the other-hand I have also used ROOT independently of Geant4 to process data. Please let me know if you have more question as I still don't have the email you sent before the current one. Thank you.

Dim Odera
Nuclear Engineering
UMass Lowell

On Dec 7, 2017, at 4:24 PM, R0b0t1 <r030t1 at gmail.com<mailto:r030t1 at gmail.com>> wrote:

Mr. Odera,

On Thu, Dec 7, 2017 at 8:30 AM, Dim, Odera U <Odera_Dim at student.uml.edu<mailto:Odera_Dim at student.uml.edu>> wrote:
Hi CMake Experts,

Please I use CMake to build my Geant4 applications with no issues. However,
recently I needed to build ROOT into my Geant4 application for the purpose
of extracting and processing simulation data. I have followed the many
instructions which exist online both on the Genat4 and ROOT sides but none
seems to produce the required results. The issue i'm having I believe is
related to the linkage of both Geant4 and ROOT libraries top the generated
executable during compilation. I am able to configure and generate build
files with a CMakeLists with no errors. Compilation also seems to also
complete with no errors but when I run the application I get an error which
specifies that LLVM are exposed to Cling and so I need to hide them. In my
CMakeLists (which I can provide to you) I do not explicitly link Cling to my
executable all I do is link the executable to ROOT libraries
(${ROOT_LIBRARIES}). Please, could you help me with this issue or do you
know a way that I could link libraries and not expose LLVM to Cling? Thank
you.


If you want help you really should try to answer some of the questions
I asked in my previous email. It happens that I have some experience
with the packages you are trying to use, but you seem to be using them
in a configuration I am not familiar with (i.e. you generated a
standalone demo that you want to distribute?).

It is important I know where you got the packages, how you built them,
and even better, what precisely you are trying to do with them; it
sounds almost like this is a question more suited to ROOT/Geant4
developers than this mailing list.

Cheers,
    R0b0t1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171207/fa5e8276/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171207/fa5e8276/attachment-0001.txt>


More information about the CMake mailing list