0

Here is a screenshot of the issues I'm having. I'm trying to set up geant4 so I can use g4beamline to run some physics simulations and I've hit a dead end.

Image

I'm following the instructions in the "BUILD.txt" file that came along with it, and the code I try / error I get is the following:

sudo cmake -DCMAKE_INSTALL_PREFIX=$HOME/geant4.10.05 -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DGEANT4_USE_SYSTEM_EXPAT=OFF -DCMAKE_BUILD_TYPE=Release -DGEANT4_USE_RAYTRACER_X11=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_QT=ON  .

which returns

-- G4BLVERSION=3.06
-- 
-- G4BL_VISUAL=ON
-- G4BL_GUI=ON
-- G4BL_ROOT=ON
-- G4BL_GSL=ON
-- G4BL_FFTW=ON
-- G4BL_MPI=OFF
-- GEANT4_DIR=
CMake Error at CMakeLists.txt:94 (message):
  ROOT_DIR= does not exist

-- Configuring incomplete, errors occurred!
See also "/home/cyrus/geant4.10.05/build/CMakeFiles/CMakeOutput.log".

As far as fixes, I've never tried used CMake before so building via this method is very new to me. I tried different variations (read: simpler) that I found here: cmake error "CMake Error: The source directory ".../p4c/build/[-DCMAKE_BUILD_TYPE=RELEASE" does not exist. I've tried a few other solutions I found on stackoverflow, but nothing has worked so far. Also I've tried changing the filepath in the environment variables, but those are also new to me. I reset everything to the default as it was when I first tried, but I'm out of ideas. I'm trying this on Ubuntu 20.04. I'm not sure what other details to include, but I would be happy to provide any more info / try any suggestions

James Z
  • 12,209
  • 10
  • 24
  • 44
  • `sudo cmake ... .` This is a bad idea. If you need to do this, there's something wrong with the cmake files; it shouldn't require superuser rights to generate the build system. `cmake --install ...` is a different story. If you use `sudo` for the cmake configuration, the build directory will be owned by root which will effectively prevent normal users from working with configured project. Have you executed the initial configuration given the correct source directory though? Given the directory shown in the screenshot the initial configuration would require `..` to be passed for the source dir – fabian Apr 28 '22 at 17:40
  • Hello thanks for the tip! I'm not sure if it was because I had used sudo before, but after reading your comment I nuked that directory and tried again without using sudo and "make install" is currently running beautifully at 4% as I'm typing this :) also I'll keep in mind that using sudo with cmake (and probably most things in general) is probably bad practice – csingleton19 Apr 28 '22 at 21:30

0 Answers0