MacOS Sequoia安装geant4.10.07

1,安装Geant4需求环境

(1,)安装xcode,在~/.bash_profile中添加其环境变量

export PATH="/Applications/CMake.app/Contents/bin":"$PATH"

(2,)brew install clhep

(3,)brew install cmake

(4,)brew install qt5

(5,)brew install xerces-c

2,配置qt5环境变量

在~/.bash_profile中添加如下几行

export PATH="/usr/local/opt/qt@5/bin:$PATH"

export LDFLAGS="-L/usr/local/opt/qt@5/lib":$LDFLAGS

export CPPFLAGS="-I/usr/local/opt/qt@5/include":$CPPFLAGS

export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig":$PKG_CONFIG_PATH

3,下载Geant4源码并解压

4,新建build及install文件夹,build及install文件夹与源码文件夹在同一目录层次

5,cd 到build文件夹,运行如下命令:

cmake -DCMAKE_INSTALL_PREFIX=/Users/***/geant4/geant4.10.07_install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGEANT4_USE_GDML=ON -DGEANT4_BUILD_MULTITHREADED=ON -DXERCESC_ROOT_DIR=/user/local/opt/xerces-c/ -DGEANT4_USE_QT=ON -DGEANT4_INSTALL_EXAMPLES=ON -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_SYSTEM_EXPAT=OFF -DGEANT4_BUILD_TLS_MODEL=auto ../geant4.10.07

6,再运行如下命令:

cmake --build . --target install -- -j8

7,sourc geant4安装目录bin下的geant4.sh

8,编译例子,并执行

相关推荐
tonngw3 小时前
【Mac 从 0 到 1 保姆级配置教程 16】- Docker 快速安装配置、常用命令以及实际项目演示
macos·docker·容器·开源·github·docker desktop·orbstack
ItisNagatoYuki12 小时前
Mac M芯片 RAG 极简流程 安装 ragflow + LM studio
macos
云攀登者-望正茂15 小时前
如何在mac上安装podman
macos·podman
江梦寻21 小时前
MacOS下Homebrew国内镜像加速指南(2025最新国内镜像加速)
开发语言·后端·python·macos·架构·策略模式
*Lisen21 小时前
重新安装解决mac vscode点击不能跳转问题
ide·vscode·macos
weixin_387545641 天前
如何把 Mac Finder 用得更顺手?——高效文件管理定制指南
macos
itme2681 天前
解决cocos 2dx/creator2.4在ios18下openURL无法调用的问题
macos·objective-c·cocoa
qq_279456152 天前
CADisplayLink、NSTimer、GCD定时器
macos·objective-c·cocoa
RR13352 天前
macOS 升级 bash 到最新版本
macos
我在北京coding2 天前
Tableau for mac 驱动
macos