Geant4设置环境变量

在HOME目录下同时按下Ctrl+h,可以看到隐藏文件.bashrc,利用记事本打开,利用export命令设置环境变量。
export G4COMP=/home/username/Geant4/geant4.10.04.p02-install/lib/Geant4-10.4.2
cmake -DGeant4_DIR= G 4 C O M P / p a t h t o e x a m p l e / 就 可 以 c m k e 了 。 以 e x g p s 为 例 。 在 b u i l d 文 件 中 m k d i r b u i l d c d b u i l d c m a k e − D G e a n t 4 D I R = G4COMP /path_to_example/ 就可以cmke了。 以exgps为例。 在build文件中 mkdir build cd build cmake -DGeant4_DIR= G4COMP/pathtoexample/cmkeexgpsbuildmkdirbuildcdbuildcmakeDGeant4DIR=G4COMP /home/username/Desktop/exgps
make -j 4
./exgps
就可以运行
ps
将对应的库安装
export G4SAIDXSDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/G4SAIDDATA1.1
export G4LEDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/G4EMLOW7.3
export G4LEVELGAMMADATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/PhotonEvaporation5.2
export G4NEUTRONXSDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/G4NEUTRONXS1.4
export G4PIIDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/G4PII1.3
export G4RADIOACTIVEDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/RadioactiveDecay5.2
export G4REALSURFACEDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/RealSurface2.1.1
export G4ABLADATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/G4ABLA3.1
export G4NEUTRONHPDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/G4NDL4.5
export G4ENSDFSTATEDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/G4ENSDFSTATE2.2
export G4TENDLDATA=/home/username/Geant4/geant4.10.04.p02-install/share/Geant4-10.4.2/data/G4TENDL1.3.2

你可能感兴趣的:(Geant4,Gean4)