系统Ubuntu 12.04 32位版,gcc 4.6,Geant 4.9.5p1,CLHEP

2.1.2.2

参考

Installing Geant4 Release 4.9.4.p02 on Linux

http://geant4.slac.stanford.edu/tutorial/installation/Geant4.9.4.p02/Linux/Geant4_9_4_p02_Linux_Installation.htm#_What_are_the

准备编译环境:

sudo apt-get install build-essential cmake

cmake版本2.8.7

1)安装CLHEP

由于新版CLHEP采用cmake方式编译,原教程不适用,参考cmake/INSTALL安装方法如下:

mkdir ~/build

cd ~/build

cmake /home/tyllr/CLHEP/2.1.2.2/CLHEP

make

make test

sudo make install

在/usr/local/lib下得到编译好的多个库,成功!

2)安装Geant4

添加低能电磁作用数据包,data files for low

energyelectromagnetic processes

解压到Geant4目录新建的 data 文件夹下。

tyllr@tyllr-MXC061:~/geant4_9_5_p01$ mkdir ~/geant4build

tyllr@tyllr-MXC061:~/geant4_9_5_p01$ cd ~/geant4build/

tyllr@tyllr-MXC061:~/geant4build$ cmake ../geant4_9_5_p01

-- The C compiler identification is GNU

-- The CXX compiler identification is GNU

-- Check for working C compiler: /usr/bin/gcc

-- Check for working C compiler: /usr/bin/gcc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- setting default compiler flags for CXX

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Could NOT find EXPAT (missing: EXPAT_LIBRARY

EXPAT_INCLUDE_DIR)

-- The following Geant4 features are enabled:

-- Configuring done

-- Generating done

-- Build files have been written to: /home/tyllr/geant4build

找不到 EXPAT,尝试:

sudo apt-get install libexpat-dev

cmake ../geant4_9_5_p01

结果如下:

-- setting default compiler flags for CXX

-- Found EXPAT: /usr/lib/i386-linux-gnu/libexpat.so

-- The following Geant4 features are enabled:

GEANT4_USE_SYSTEM_EXPAT: Using system install of EXPAT

-- Configuring done

-- Generating done

-- Build files have been written to: /home/tyllr/geant4build

tyllr@tyllr-MXC061:~/geant4build$ make

-j2

我是core 2

duo的cpu,所以用双核选项。编译很漫长,喝杯咖啡慢慢等。。。

完成后 sudo make

install,结束安装。

3)测试例子

mkdir ~/g4examplebuild

cd ~/g4examplebuild

cmake ../geant4_9_5_p01/examples/novice

make

运行可执行文件:

tyllr@tyllr-MXC061:~/g4examplebuild$ cd N01

tyllr@tyllr-MXC061:~/g4examplebuild/N01$ ./exampleN01

*************************************************************

Geant4 version Name:

geant4-09-05-patch-01 (20-March-2012)

Copyright : Geant4 Collaboration

Reference : NIM A 506 (2003), 250-303

WWW : http://cern.ch/geant4

*************************************************************

========= Table of registered couples

==============================

Index :

0 used in the geometry :

Yes recalculation needed : No

Material : ArgonGas

Range

cuts : gamma 1

mm e- 1

mm e+ 1 mm proton 1 mm

Energy thresholds : gamma -1

MeV e- -1

MeV e+ -1 MeV proton -1 MeV

Region(s) which use this couple :

DefaultRegionForTheWorldIndex :

1 used in the geometry :

Yes recalculation needed : No

Material : Aluminum

Range

cuts : gamma 1

mm e- 1

mm e+ 1 mm proton 1 mm

Energy thresholds : gamma -1

MeV e- -1

MeV e+ -1 MeV proton -1 MeV

Region(s) which use this couple :

DefaultRegionForTheWorldIndex :

2 used in the geometry :

Yes recalculation needed : No

Material : Lead

Range

cuts : gamma 1

mm e- 1

mm e+ 1 mm proton 1 mm

Energy thresholds : gamma -1

MeV e- -1

MeV e+ -1 MeV proton -1 MeV

Region(s) which use this couple :

DefaultRegionForTheWorld====================================================================

Start Run processing.

=====================================

G4EventManager::ProcessOneEvent() =====================================

G4PrimaryTransformer::PrimaryVertex

(-2000(mm),0(mm),0(mm),0(nsec))

1 primaries are passed from G4EventTransformer.

!!!!!!! Now start processing an event !!!!!!!

*********************************************************************************************************

* G4Track Information: Particle

= geantino, Track ID =

1, Parent ID = 0

*********************************************************************************************************

Step# X(mm) Y(mm) Z(mm)

KinE(MeV) dE(MeV) StepLeng

TrackLeng NextVolume ProcName

0 -2e+03 0

linux下面安装geant4,Ubuntu 12.04 下Geant4的安装相关推荐

  1. linux ubuntu 12.04 下默认是安装了openjdk的

    ubuntu 12.04 下默认是安装了openjdk的,不过这个jdk问题比较多,因为你甚至无法启动Eclipse,所以还是需要自己安装jdk的. 1.下载jdk6 jdk6下载地址为:http:/ ...

  2. linux源码下载阿帕奇,Ubuntu 12.04下源码安装Apache

    环境:Ubuntu 12.04 [简单安装] 一般第一次安装Apache都较为顺利. 1. 下载并解压 root@ubuntu:/home/qy/share#tar zxvf httpd-2.2.22 ...

  3. linux命令行安装libxml,Ubuntu 14.04下libxml2的安装和使用

    Ubuntu 14.04下libxml2库的安装方法: sudo apt-get install libxml2 sudo apt-get install libxml2-dev 利用以上命令安装完软 ...

  4. 在linux中dns不安装coching,ubuntu 8.04下openldap的安装和使用

    ubuntu 8.04上openldap的安装和使用 1.安装openldap. $ sudo apt-get install slapd ldap-utils 2.配置openldap. $ sud ...

  5. Ubuntu 12.04下PostgreSQL-9.1安装与配置详解(在线安装)

    说明:       我是用root用户在终端登陆的,如果是非root用户,那在命令前需要加上"sudo",你懂的... 第一步:在Ubuntu下安装Postgresql       ...

  6. ubuntu 12.04下 eclipse的安装

    1首先下载有关的JDK sudo apt-get install openjdk-7-jre 由于是源内的东西,所以只许执行上面这一步,就自动帮你下载 安装 以及配置,无需繁琐的操作. 这里ubunt ...

  7. 3070网卡驱动linux教程,Ubuntu 12.04下RT5370无线网卡驱动安装

    之前买了个水星150U的无线网卡,一直没在Ubuntu下安装好驱动?今天再次在Ubuntu 12.04下尝试安装尽然成功了.以前我一直以为是RT2870的芯片的,今天拆开了一看原来是5370N,晕到R ...

  8. 如何在linux系统安装搜狗输入法,在Ubuntu 12.04 LTS版本下安装搜狗输入法 for Linux...

    目前搜狗输入法 for Linux可以安装在Ubuntu 12.04.14.04.14.10和Ubuntu 15.04系统中(包括Ubuntu Kylin版本).下面介绍在Ubuntu 12.04 L ...

  9. Ubuntu 12.04下安装Oracle Express 11gR2

    Ubuntu 12.04下安装Oracle Express 11gR2 [我的笔记] 参考1:http://www.linuxidc.com/Linux/2012-09/71382.htm 参考2:h ...

最新文章

  1. Centos6/7下静默安装oracle10g
  2. 基于 Go 语言构建企业级的 RESTful API 服务
  3. 工程路径网站图片路径的问题 绝对路径
  4. Condition源码分析
  5. oracle的function的语法,Oracle function语法
  6. php课程 4-15 数组遍历、超全局数组、表单提交数据(多看学习视频)
  7. 升级到virtualbox-2.1.4
  8. Flink-Java版单词计数(批处理流处理)
  9. android从本地图片导入应用,android – 将图像添加到图库
  10. 项目日报模板_知名房企的精细化施工管理,从项目日常到施工图,全方位涵盖...
  11. 动态规划之完全背包和多重背包
  12. php 图片裁剪后保存,php – 如何保存裁剪的图像
  13. VS2010旗舰版如何显示行号
  14. 那个职员建议他们去计算机博物馆英语,第三单元重点句子
  15. 公章,加盖公章,英语怎么说?
  16. [激光原理与应用-30]:典型激光器 -2- 气体激光器 (连续激光器)
  17. 职责链模式之真假美猴王
  18. Android无法安装apk,8.0未知来源应用安装权限
  19. ApexCharts 柱状图上显示具体数值
  20. 怎么对Revit族三个方向旋转

热门文章

  1. 【血糖检测】改进深度回归网络的无创血糖检测【含Matlab源码 1572期】
  2. 分享一款教育培训机构学员信息管理系统
  3. Java List<Long>转List<String>
  4. Ant design pro常用(7):导出数据excel
  5. oracle中的用户详解 【转】
  6. 微服务07-负载均衡
  7. 自动驾驶数据服务进入2.0时代
  8. 第25篇 画布元素 之 渐变(Gradients)
  9. 四大流派瓜分家居物流,但仍有两难选择与三大困扰
  10. 哪家的蓝牙耳机质量比较好?2022真无线蓝牙耳机排名