I’m a final year MPhys student currently doing a project to bridge Mitsuba 3 and Geant4 at the University of Manchester, and I’m having a few issues trying to compile a working program (I’m following the Physics Matters tutorials at https://www.youtube.com/playlist?list=PLLybgCU6QCGWgzNYOV0SKen9vqg4KXeVL , as reccommended by my supervisor) and I’ve tried three different methods:
- Firstly, I tried to create a program using Python as I am far more proficient at using it. I installed Geant 4 11.0.0 through the anaconda-forge package (using G4Py bindings) on Ubuntu 24.04.3 LTS via Windows Subsystem for Linux and I am using Spyder as my IDE. The module imports without any issue and I’ve been able to translate the bindings from the tutorial’s C++ source, however, I run into an issue when I try to run the program when using the PVPlacement method:
It seems strange, given that the RotationMatrix and ThreeVector classes inherit from the given base classes in CLHEP, none of the other methods reliant on pointers have failed and there doesn’t appear to be a CLHEP module to import.
- After this, I tried to use C++ on Windows 10, using MinGWx64 g++, VSCode 1.84.2 and Geant4 11.0.1 as installed by the binary installer. The headers and library were able to be linked successfully, but upon compilation (both via the debugger and Windows Terminal), I get reference errors located inside the headers, for instance:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\james\AppData\Local\Temp\cccXta5R.o: in function `G4VisExecutive::~G4VisExecutive()':
D:/Geant4-11.0.1/include/Geant4/G4VisExecutive.hh:119: undefined reference to `G4VisManager::~G4VisManager()'
- I also tried to use CMake 3.28.0-rc5 to compile, the Makefile was able to generate with no issues but attempting to compile the Makefile throws these errors:
g++.exe: error: unrecognized command-line option '-GR'; did you mean '-R'?
g++.exe: error: unrecognized command-line option '-EHsc'
g++.exe: error: unrecognized command-line option '-Zm200'
If anyone has a known fix or solution to any of these issues, it would be greatly appreciated.