GRAS N01_with_GRAS example (error running make )

Hello, experts

I’m getting an error when running make for the exampleN01, after successfully installing GRAS5.0. The error running make seen below:

Compilation error (running make)
/home/jiangjc/gras/05.02.01/gras-05-02-01/examples/gras_in_external_application/N01_with_GRAS/exampleN01.cc:38:10: fatal error: GRASRunManager.hh: No such file or directory
38 | #include “GRASRunManager.hh”
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/app_exe.dir/build.make:63: CMakeFiles/app_exe.dir/exampleN01.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/app_exe.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

All header files (include The ”GRASRunManager.hh“) are located in “/home/jiangjc/gras/05.02.01/include/gras” after installation.
The example is located in “/home/jiangjc/gras/05.02.01/gras-05-02-01/examples/gras_in_external_application/N01_with_GRAS”
I source the ”/home/jiangjc/gras/05.02.01/bin/gras-env.sh“ before running the example.

Could anyone give me some tips?
Thanks very much.

Best regard,
Jiechen

What is the output of make VERBOSE=1 here? This will show the complete compilation command used which include which include paths are used. That may help in identifying why the GRAS header(s) are not being picked up.

It’s also worth contacting the GRAS developers on their development/user fora/systems as they will be able to provide better support (GRAS is a third party application utilizing Geant4).

Dear bmorgan,
Thanks for your reply, the output is:
usr/bin/cmake -S/home/jiangjc/N01_with_GRAS -B/home/jiangjc/N01_with_GRAS/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/jiangjc/N01_with_GRAS/build/CMakeFiles /home/jiangjc/N01_with_GRAS/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory ‘/home/jiangjc/N01_with_GRAS/build’
make -f CMakeFiles/app_exe.dir/build.make CMakeFiles/app_exe.dir/depend
make[2]: Entering directory ‘/home/jiangjc/N01_with_GRAS/build’
cd /home/jiangjc/N01_with_GRAS/build && /usr/bin/cmake -E cmake_depends “Unix Makefiles” /home/jiangjc/N01_with_GRAS /home/jiangjc/N01_with_GRAS /home/jiangjc/N01_with_GRAS/build /home/jiangjc/N01_with_GRAS/build /home/jiangjc/N01_with_GRAS/build/CMakeFiles/app_exe.dir/DependInfo.cmake --color=
make[2]: Leaving directory ‘/home/jiangjc/N01_with_GRAS/build’
make -f CMakeFiles/app_exe.dir/build.make CMakeFiles/app_exe.dir/build
make[2]: Entering directory ‘/home/jiangjc/N01_with_GRAS/build’
[ 20%] Building CXX object CMakeFiles/app_exe.dir/exampleN01.cc.o
/usr/bin/c++ -DG4INTY_USE_QT -DG4INTY_USE_XT -DG4LIB_BUILD_DLL -DG4UI_USE_QT -DG4UI_USE_TCSH -DG4VIS_USE_OPENGL -DG4VIS_USE_OPENGLQT -DG4VIS_USE_OPENGLX -DG4VIS_USE_RAYTRACERX -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -I/home/jiangjc/root-6.16.00/build/include -I/home/jiangjc/N01_with_GRAS/include -isystem /home/jiangjc/geant4/geant4-install/include/Geant4 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -W -Wall -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-variadic-macros -Wshadow -pipe -std=c++11 -DGRAS_USE -O3 -DNDEBUG -fno-trapping-math -ftree-vectorize -fno-math-errno -O3 -DNDEBUG -pthread -fPIC -o CMakeFiles/app_exe.dir/exampleN01.cc.o -c /home/jiangjc/N01_with_GRAS/exampleN01.cc
/home/jiangjc/N01_with_GRAS/exampleN01.cc:38:10: fatal error: GRASRunManager.hh: No such file or directory
38 | #include “GRASRunManager.hh”
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/app_exe.dir/build.make:63: CMakeFiles/app_exe.dir/exampleN01.cc.o] Error 1
make[2]: Leaving directory ‘/home/jiangjc/N01_with_GRAS/build’
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/app_exe.dir/all] Error 2
make[1]: Leaving directory ‘/home/jiangjc/N01_with_GRAS/build’
make: *** [Makefile:84: all] Error 2

The GRAS include path shown here is “-I/home/jiangjc/N01_with_GRAS/include” which is my path of the example, I try another example and the include path also shows the example include. It’s very strange.

I think that’s correct, assuming that holds headers for the example in question. There’s definitely no path to the GRAS headers themselves that I can see though - this would indicate a bug in how GRAS is found in the example, or in whatever files (e.g. “GRASConfig.cmake”) it installs for use with a CMake build. That’s probably best reported/asked to the GRAS developers.

Dear bmorgan,

Thanks for your reply, as you saw though, the file “GRASConfig.cmake” was not completely complied, includes just two effective line, many variables were not defined (e.g. ”GRAS_INCLUDE_DIRS“). I check the “CMakeLists.txt” in the source files, it sets GRAS variables in the file “GRASConfig.cmake” while compiling, and no running error during cmake process. Maybe I‘d better to ask to the GRAS developers.

Again thanks very much for your help.

BR,
Jiechen