Installing GATE9-2 with mac

Dear all,
I am trying to install GATE-9-2 On my mac machine. i tried to run it using the macports. but GEANT4 did not work well, so I downloaded all the softwares from source. herein is the software i have installed.
Geant 11.0.0
Root 6
and qt5, libtouch
ITK

However, When I try to CMakeLists.txt in my cmake application it always run with error.
the error is
CMake Error at /usr/local/lib/cmake/Geant4/Geant4PackageCache.cmake:19 (geant4_set_and_check_package_variable):
geant4_set_and_check_package_variable Macro invoked with incorrect
arguments for macro named: geant4_set_and_check_package_variable
Call Stack (most recent call first):
/usr/local/lib/cmake/Geant4/Geant4Config.cmake:254 (include)
CMakeLists.txt:64 (FIND_PACKAGE)

Found EXPAT: /opt/local/lib/libexpat.dylib (found suitable version “2.2.5”, minimum required is “2.2.5”)
CMake Error at /usr/local/lib/cmake/Geant4/PTL/PTLConfig.cmake:14 (message):
File or directory /usr/local/include/Geant4 referenced by variable
PTL_INCLUDE_DIR does not exist !
Call Stack (most recent call first):
/usr/local/lib/cmake/Geant4/PTL/PTLConfig.cmake:35 (set_and_check)
/Applications/CMake.app/Contents/share/cmake-3.27/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
/usr/local/lib/cmake/Geant4/Geant4Config.cmake:292 (find_dependency)
CMakeLists.txt:64 (FIND_PACKAGE)

Configuring incomplete, errors occurred!

does any onr help me and give the full instruction hoe to install and run gate.

Could you please post the Geant4PackageCache.cmake file referenced here please?

In general this file shouldn’t cause errors, but equally you can safely delete it should all the dependencies like qt5, etc be installed in standard locations.

The PTL related errors may be related to this, so let’s try and understand the first error before that.

This file is generated by the Geant4 CMake buildsystem and should not be editted

This file stores paths and settings to external libraries found and used by this

install of Geant4 when it was built.

macro(geant4_set_and_check_package_variable _name _value _type _docstring)
if(DEFINED ${_name})
if(NOT (“${${_name}}” STREQUAL “${_value}”))
message(WARNING “Value of ‘${_name}’ is already set and does not match value set at Geant4 build-time”)
endif()
else()
set(${_name} ${_value} CACHE ${_type} “${_docstring}”)
endif()
endmacro()

EXPAT Build Time Settings

geant4_set_and_check_package_variable(EXPAT_INCLUDE_DIR “/Library/Frameworks/Mono.framework/Headers” PATH “Path to a file.”)
geant4_set_and_check_package_variable(EXPAT_LIBRARY “” “”)

TBB Build Time Settings

Qt5 Build Time Settings

geant4_set_and_check_package_variable(Qt5Core_DIR “/usr/local/Cellar/qt@5/5.15.10/lib/cmake/Qt5Core” PATH “The directory containing a CMake configuration file for Qt5Core.”)
geant4_set_and_check_package_variable(Qt5Gui_DIR “/usr/local/Cellar/qt@5/5.15.10/lib/cmake/Qt5Gui” PATH “The directory containing a CMake configuration file for Qt5Gui.”)
geant4_set_and_check_package_variable(Qt5Widgets_DIR “/usr/local/Cellar/qt@5/5.15.10/lib/cmake/Qt5Widgets” PATH “The directory containing a CMake configuration file for Qt5Widgets.”)
geant4_set_and_check_package_variable(Qt5OpenGL_DIR “/usr/local/Cellar/qt@5/5.15.10/lib/cmake/Qt5OpenGL” PATH “The directory containing a CMake configuration file for Qt5OpenGL.”)
geant4_set_and_check_package_variable(Qt5PrintSupport_DIR “/usr/local/Cellar/qt@5/5.15.10/lib/cmake/Qt5PrintSupport” PATH “The directory containing a CMake configuration file for Qt5PrintSupport.”)
geant4_set_and_check_package_variable(Qt53DCore_DIR “/usr/local/Cellar/qt@5/5.15.10/lib/cmake/Qt53DCore” PATH “The directory containing a CMake configuration file for Qt53DCore.”)
geant4_set_and_check_package_variable(Qt53DExtras_DIR “/usr/local/Cellar/qt@5/5.15.10/lib/cmake/Qt53DExtras” PATH “The directory containing a CMake configuration file for Qt53DExtras.”)
geant4_set_and_check_package_variable(Qt53DRender_DIR “/usr/local/Cellar/qt@5/5.15.10/lib/cmake/Qt53DRender” PATH “The directory containing a CMake configuration file for Qt53DRender.”)

OpenGL Build Time Settings

geant4_set_and_check_package_variable(OPENGL_INCLUDE_DIR “/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework” PATH “Include for OpenGL on OS X”)
geant4_set_and_check_package_variable(OPENGL_gl_LIBRARY “/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework” FILEPATH “OpenGL library for OS X”)

I think this is the cause of the issue (see also this issue report on the Geant4 Conda feedstock). If you don’t need that install of Mono, then it can be safely removed as outlined in that post. You should then reinstall Geant4 to ensure it uses the appropriate Expat system.

If you do need that install of Mono, then you can try reinstalling Geant4 with

$ cmake -DCMAKE_FIND_FRAMEWORK=LAST <otherargs>

which should make CMake find the system expat in preference to the Mono version.

Thanks a lot for your explanation and assistance.
Just to be sure i need to
1- remove the mono “sudo rm -rf /Library/Frameworks/Mono.framework”
2- reinstall geant4 using the same method I did previously (I use the cmake application) will it works??
or I should reinstall it using the “cmake -DCMAKE_FIND_FRAMEWORK=LAST ” command.

Thanks again

  1. Yes, though be sure that this really isn’t needed before removing. I cannot guarantee the removal won’t break something else.
  2. Yes, use exactly the same method and arguments. You only need the -DCMAKE_FIND_FRAMEWORK=LAST if you cannot remove the Mono framework in step 1.

I followed the same process.
But Now I have multiple errors that confused me.

CMake Error at /usr/local/lib/cmake/Geant4/Geant4PackageCache.cmake:19 (geant4_set_and_check_package_variable):
geant4_set_and_check_package_variable Macro invoked with incorrect
arguments for macro named: geant4_set_and_check_package_variable
Call Stack (most recent call first):
/usr/local/lib/cmake/Geant4/Geant4Config.cmake:254 (include)
CMakeLists.txt:64 (FIND_PACKAGE)

Found EXPAT: /opt/local/lib/libexpat.dylib (Required is at least version “2.2.5”)
Performing Test CMAKE_HAVE_LIBC_PTHREAD
Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
Found Threads: TRUE
Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework
Found Geant4: /usr/local/lib/cmake/Geant4/Geant4Config.cmake (found version “11.1.0”)
CMake Error at CMakeLists.txt:72 (MESSAGE):
GATE should be compiled with a non-multithreaded installation of Geant4

However I installed Geant4 by turning off the multithreaded option. Last time I dii the same and it worked.
Is there a method to remove this option rather than reinstalling geant4. And if I need to reinstall, how can I guarantee that the multithreaded is off

Is there any instructions how to install Geant4 and Gate using mac. (step by step rather than macport, because macports did not work as well)

Thanks in advance

As before, we’ll need to see the contents on f the /usr/local/lib/cmake/Geant4/Geant4PackageCache.cmake file to determine why there’s still an error here.

Step-by-step instructions for installed geant4 from source are in the main Installation Guide. The GATE page should have the documentation on its side of things.

thanks a lot for help.

This file is generated by the Geant4 CMake buildsystem and should not be editted

This file stores paths and settings to external libraries found and used by this

install of Geant4 when it was built.

macro(geant4_set_and_check_package_variable _name _value _type _docstring)
if(DEFINED ${_name})
if(NOT (“${${_name}}” STREQUAL “${_value}”))
message(WARNING “Value of ‘${_name}’ is already set and does not match value set at Geant4 build-time”)
endif()
else()
set(${_name} ${_value} CACHE ${_type} “${_docstring}”)
endif()
endmacro()

EXPAT Build Time Settings

geant4_set_and_check_package_variable(EXPAT_INCLUDE_DIR “/opt/local/include” PATH “Path to a file.”)
geant4_set_and_check_package_variable(EXPAT_LIBRARY “” “”)

Qt5 Build Time Settings

geant4_set_and_check_package_variable(Qt5Core_DIR “/opt/local/lib/cmake/Qt5Core” PATH “The directory containing a CMake configuration file for Qt5Core.”)
geant4_set_and_check_package_variable(Qt5Gui_DIR “/opt/local/lib/cmake/Qt5Gui” PATH “The directory containing a CMake configuration file for Qt5Gui.”)
geant4_set_and_check_package_variable(Qt5Widgets_DIR “/opt/local/lib/cmake/Qt5Widgets” PATH “The directory containing a CMake configuration file for Qt5Widgets.”)
geant4_set_and_check_package_variable(Qt5OpenGL_DIR “/opt/local/lib/cmake/Qt5OpenGL” PATH “The directory containing a CMake configuration file for Qt5OpenGL.”)
geant4_set_and_check_package_variable(Qt5PrintSupport_DIR “/opt/local/lib/cmake/Qt5PrintSupport” PATH “The directory containing a CMake configuration file for Qt5PrintSupport.”)

OpenGL Build Time Settings

geant4_set_and_check_package_variable(OPENGL_INCLUDE_DIR “/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework” PATH “Include for OpenGL on OS X”)
geant4_set_and_check_package_variable(OPENGL_gl_LIBRARY “/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework” FILEPATH “OpenGL library for OS X”)

O.k., I guess this is a problem with MacPorts given the missing entry for the Expat library. I would suggest two solutions.

The first is to simply remove the /usr/local/lib/cmake/Geant4/Geant4PackageCache.cmake file. It’s completely optional and can be safely removed without affecting the installation of Geant4. The only requirement then is that all of the dependencies are located in standard locations known to CMake, which they appear to be. Try that first as it does not require a reinstallation of Geant4. You may need to rebuild Gate/your application from scratch however.

The second is to remove the installation of Geant4, then reinstall adding the options:

$ cmake -DGEANT4_USE_SYSTEM_EXPAT=OFF -DGEANT4_INSTALL_PACKAGE_CACHE=OFF <otherargs>

That will force the use of the supplied expat and also not install the package cache. I’d suggest the above first option before trying this.

Thanks a lot for your assistance.
I have deleted the “Geant4PackageCache.cmake”. and managed to install gate succesfully.

According to the GATE instructions I have to follow the same instructions as geant4.

cmake
make
make install.

then Imodified the the .Zshrc file with the installation bath " * > export PATH=/PATH_TO/gate-install/bin:$PATH" .
However when I run “gate” .

################################
** !!! G4Backtrace is activated !!!**
** ################################**

** [G4-cerr] **
-------- EEEE ------- G4Exception-START -------- EEEE -------
***** G4Exception : PART70000**
** issued by : G4NuclideTable**
G4ENSDFSTATEDATA environment variable must be set
***** Fatal Exception *** core dump *****

### CAUGHT SIGNAL: 11 ### address: 0x10, signal = SIGSEGV, value = 11, description = segmentation violation. Address not mapped to object.

zsh: abort gate

Is this issue related to the .Zshrc file ??
I know this might not be part of your work. but hope that you can help me

Thanks in advance

This is just indicating that the environment variables needed by Geant4 for locating data libraries are not set. Geant4 installs a file <whereyouinstalledgeant4>/bin/geant4.sh that can be sourced to set these variables, and can be added to your .zshrc file(*) with:

pushd <whereyouinstalledgeant4>/bin; source ./geant4.sh; popd

The pushd is needed due to zsh/bash differences. (*) be careful when adding this to your .zshrc if you intend to install/use different versions of Geant4 in the future.

If you installed Geant4 with the GEANT4_INSTALL_DATA CMake option on, all the data should be present. If you still get errors, run

$ <whereyouinstalledgeant4>/bin/geant4-config --check-datasets

which will print a list of the datasets and whether they are installed or not. If they are missing, then

$ <whereyouinstalledgeant4>/bin/geant4-config --install-datasets

can be run to download and install them.

Thanks a lot for your assistance.
I did not add the push step at the .zshrc file.
Now it works perfectly.

However, now the termal is always open at the /bin Folder, even if I asked to be open in different folder.

What, if anything, did you add to the .zshrc file? It’s probably something there that’s causing the starting directory to change.

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