Can't run B1 interactive mode from cmdline?†

_Geant4 Version:_11.3.0
_Operating System:_Mac Sonoma 14.6.1
_Compiler/Version:_XCode 16.2
_CMake Version:_3.31.3


Hi Geant4 users!
I’m trying to build the B1 example so my highschooler can play around in interactive mode. The problem I’m running into is that I can only run the example from within XCode. If I try to run the example executable from the cmdline, I see this:

/Users/me@B1-build % ls
B1.xcodeproj build run1.mac
CMakeCache.txt cmake_install.cmake run2.mac
CMakeFiles exampleB1.in vis.mac
CMakeScripts exampleB1.out
Debug init_vis.mac
/Users/me@B1-build % Debug/exampleB1
zsh: killed Debug/exampleB1
/Users/me@B1-build %

This happens both if I create an xcode or a Makefile project using cmake. Does anyone know what’s going on? I want to make it so she can run via commandline w/o the clunkiness of having to launch XCode.

Btw I am sourcing the file
/Users/me/geant4-v11.3.0-install/bin/geant4.sh
and I’ve confirmed that my PATH variable contains
/Users/me/geant4-v11.3.0-install/bin and that my
GEANT4_DATA_DIR variable contains
/Users/me/geant4-v11.3.0-install/share/Geant4/data

Does ‘killed’ imply a crash? Can I run exampleB1 with a flag to make it more verbose?

Hi Jeffery

For me, using Xcode, the executable is in BuildProducts/Debug/bin/exampleB1, which should be in your “Install” directory (CMAKE_INSTALL_PREFIX).

John

Thanks for writing!
For clarity, I’m not experiencing issues with creating the executable. I can see an executable when I use both xcode and make. Specifically I can’t seem to run the executable in cmdline mode.

Mmm. I wonder if there is another exampleB1 in your PATH. To ensure you execute the file you want, give its full path name or precede it with ./ (meaning “this directory”), e.g., ./Debug/exampleB1.

Are you sure Debug/exampleB1 in B1-build is the executable from the current Xcode build? Check the time stamp (ls -l). Do you have a BuildProducts directory at all? In your geant4 build directory, perhaps? Have you looked in there? (I have a slightly unconventional build, so it might be different.)

Sorry not to be more helpful.

John

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