_Operating System:macos 11.2
_Compiler/Version: Xcode 15.0
_CMake Version: cmake version 3.27.5
I just upgrade to Xcode 15.0, it has a bug when using geant4 with expat.
building geant4 with bug
[ 0%] Building C object source/externals/expat/CMakeFiles/G4expat.dir/src/xmlrole.c.o /Users/test/software/Geant4/g4/geant4-v11.1.2/source/externals/expat/src/xmlparse.c:127:4: error: You do not have support for any sources of high quality entropy enabled. For end user security, that is probably not what you want. Your options include: * Linux >=3.17 + glibc >=2.25 (getrandom): HAVE_GETRANDOM, * Linux >=3.17 + glibc (including <2.25) (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, * BSD / macOS >=10.7 (arc4random_buf): HAVE_ARC4RANDOM_BUF, * BSD / macOS (including <10.7) (arc4random): HAVE_ARC4RANDOM, * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, * libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, * Linux (including <3.17) / BSD / macOS (including <10.7) / Solaris >=8 (/dev/urandom): XML_DEV_URANDOM, * Windows >=Vista (rand_s): _WIN32. If insist on not using any of these, bypass this error by defining XML_POOR_ENTROPY; you have been warned. If you have reasons to patch this detection code away or need changes to the build system, please open a bug. Thank you! # error You do not have support for any sources of high quality entropy \ ^ 1 error generated.
So I try to use G4 with system expat
but after installing
EXPAT_LIBRARY : show nothing.
# EXPAT Build Time Settings geant4_set_and_check_package_variable(EXPAT_INCLUDE_DIR "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include" PATH "Path to a file.") geant4_set_and_check_package_variable(EXPAT_LIBRARY "" "")
when trying to build with
CMake Error at ~/software/Geant4/install/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): ~/software/Geant4/install/lib/cmake/Geant4/Geant4Config.cmake:254 (include) B2b/CMakeLists.txt:14 (find_package)
however I try to set
geant4_set_and_check_package_variable(EXPAT_LIBRARY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libexpat.tbd" FILEPATH "Path to a file.")
when trying to build with example B2
still with bug.
than I’ve try to install the
geant4_set_and_check_package_variable(EXPAT_LIBRARY "/opt/homebrew/lib/libexpat.dylib" FILEPATH "Path to a file.")
finally it works.