Geant4 Installation Issue #137
-
Hi, I am having an issue with implementing NCrystal in Geant4. First I followed the INSTALL file and successfully installed it and performed the test successfully. (I made sure to cmake with -DNCRYSTAL_ENABLE_GEANT4=ON). Then, I went into the folder with my Geant4 simulations and did the following: (Note that my file is called DMX instead of exampleapp as in the README)
The error was: Make Error at /data/ljoseph/ncrystalinstall/lib64/cmake/NCrystal/NCrystalConfig.cmake:118 (if):
Unknown arguments specified The error seems to imply that the config file (which I have not messed with) has an if command: if ( "GEANT4BINDINGS" IN_LIST NCrystal_FIND_COMPONENTS ) that has unrecognized arguments. I must be doing something wrong as I doubt it is an issue with the NCrystal file. However, I did grep for NCrystal_FIND_COMPONENTS and it was only referenced in NCrystalConfig.cmake so it almost seems undefined as the error suggests. Below I have pasted my full CMakeLists file. Any help is greatly appreciated! We are not sure where to go from here. #---------------------------------------------------------------------------- Setup the projectcmake_minimum_required(VERSION 2.6 FATAL_ERROR) #Logan Added option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON) include(${Geant4_USE_FILE}) if("$ENV{DMXENV_GPS_USE}" AND NOT DEFINED DMXENV_GPS_USE) option(DMXENV_GPS_USE "Build DMX with support for GPS" ${DMXENV_GPS_USE_DEFAULT}) if(DMXENV_GPS_USE) include_directories(${PROJECT_SOURCE_DIR}/include add_executable(DMX DMX.cc ${sources} ${headers}) #Logan Added set(underground_physics_SCRIPTS foreach(_script ${underground_physics_SCRIPTS}) add_custom_target(underground_physics DEPENDS DMX) install(TARGETS DMX DESTINATION bin) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
Thanks for the report. What CMake version are you using? |
Beta Was this translation helpful? Give feedback.
-
I think I understand your issue now. I will write more details later after a few more investigattions, but for now if you change the version number in |
Beta Was this translation helpful? Give feedback.
-
Looks to me like your compiler is not being configured for C++11. Can you provide a tar-ball somewhere with a complete (and minimal!) example of your .cpp and CMakeLists.txt files, and I can see if I can reproduce it? |
Beta Was this translation helpful? Give feedback.
-
And please also provide information about your system (in particular compiler version, how you installed it, etc.). |
Beta Was this translation helpful? Give feedback.
To answer the first half, I can only guess. Perhaps you have an incomplete geant4-datafile setup which (perhaps) only triggers with an HP physics list? Otherwise, I was using geant4-10.04.p03 to test, which differs from yours.
For the second question, note that I am currently working on better Geant4-NCrystal hooks which will also result in updated documentation. But as a quick example, here is a modern (aka "cmake3" or "target-based") cmake lists which works for me: