从安装的过程来看,Ubuntu在台式机上会安装gcc,但是笔记本上则不会,所以在第一次装的时候并没有成功,虽然从头到尾都安装了,没有中断,但最后采用doy验证的时候没有通过。
下文是根据原文加自己的安装过程,总结出的内容,红色是需要注意的地方,内容可能上下有出入,但不影响安装。
出入的部分主要是软件的版本显示问题(原文是GAMIT 10.34,我安装的是GAMIT 10.40)和安装路径。
首先,安装GCC,因为在root模式下,命令行没有sudo
(首次安装系统,需为ROOT 设置密码才能进入,在终端输入:sudo passwd 输入完后,重启电脑,更改登录,以root账户登录)
apt-get build-dep gcc
(若出现未发现CSH软件包,输入sudo apt-get update,更新源,要求电脑必须联网,以下的软件安装的前提都是电脑连着互联网)
链接1采用两种方法,比较了大小后决定采用第一条,就是上面的命令。
通过gcc --version确认版本为 GCC 4.4.5
Gamit安装需要csh(tcsh)环境、 GNU gfortran 4.2编译器和libx11-dev库支持。gfortran是软件推荐使用的编译器。libx11-dev是X11的程序开发库,它提供的lib.h和 libx11.a(libx11.so)是Gamit安装必须用到的两个库文件,主要是为Globk的提供图形库支持。以上三个条件却一不可。
ubuntu系统没有csh,默认为bash。因此要先安装csh。
ubuntu系统自带了gcc4.2,但是却没有安装gfortran编译器。而你安装时安装程序会调用默认的gfortran编译器,除非你指定gcc为你的编译器。
首先,以root身份登录,打开终端,输入
apt-get install csh
系统自动下载并安装csh,安装完成后在终端输入
chsh
提示
正在更改 root 的 SHELL
请输入新值,或直接敲回车键以使用默认值
登录 Shell [/bin/bash]:
输入
/bin/csh
修改bash为csh。重新起动ubuntu,并以root身份登录,打开终端,输入
# echo $SHELL
(“#”是终端自带的符号,输入echo $SHELL即可)
返回s“/bin/csh”,说明SHELL修改成功。
接着输入
apt-get install gfortran
系统自动下载并安装gfortran。
在输入
apt-get install libx11-dev
系统自动下载并安装libx11-dev库支持。
安装gamit 10.4
定位到gamit的安装路径
(我的安装路径是opt/gamit_globk,此路径与后文的.cshrc保持一致,将gamit目录下updates\source下的文件全部拷贝至安装路径)
准备工作:
chmod +x install_software
(增加install_software脚本的执行权限)
(单击脚本,点显示)修改install_software文件内容
“usr -name libX11.a”为"usr -name libX11.so",一个是静态共享库,一个是动态共享库。
makefile.config,修改:
(makefile.config 文件在opt/gamit_globk/libraries压缩包里)
# X11 library location - uncomment the appropriate one for your system
# Generic (will work on any system if links in place)
X11LIBPATH /usr/lib/X11
X11INCPATH /usr/include/X11
# Specific for Sun with OpenWindows
#X11LIBPATH /usr/openwin/lib
#X11INCPATH /usr/openwin/share/include/X11
# Specific for PC Solaris 10
#X11LIBPATH /usr/openwin/lib/
#X11INCPATH /usr/openwin/share/include/X11
# Specific to Linux RedHat 7,8 and 9, RH-FC1 -> 3
#X11LIBPATH /usr/X11R6/lib
#X11INCPATH /usr/X11R6/include/X11
# Specific to FC5
#X11LIBPATH /usr/lib
#X11INCPATH /usr/include/X11
# Specific for MIT HP and Sun for Release 5
#X11LIBPATH /usr/lib/X11R5
#X11INCPATH /usr/include/X11R5
# Specific for IBM AIX4.2
#X11LIBPATH /usr/lpp/X11/lib
#X11INCPATH /usr/lpp/X11/include
# Specific for MacOSX
#X11LIBPATH /usr/X11R6/lib
#X11INCPATH /usr/include/X11
为:
# X11 library location - uncomment the appropriate one for your system
# Generic (will work on any system if links in place)
#X11LIBPATH /usr/lib/X11
#X11INCPATH /usr/include/X11
# Specific for Sun with OpenWindows
#X11LIBPATH /usr/openwin/lib
#X11INCPATH /usr/openwin/share/include/X11
# Specific for PC Solaris 10
#X11LIBPATH /usr/openwin/lib/
#X11INCPATH /usr/openwin/share/include/X11
# Specific to Linux RedHat 7,8 and 9, RH-FC1 -> 3
#X11LIBPATH /usr/X11R6/lib
#X11INCPATH /usr/X11R6/include/X11
# Specific to FC5(F6,F7,F8 )
X11LIBPATH /usr/lib
X11INCPATH /usr/include/X11
# Specific for MIT HP and Sun for Release 5
#X11LIBPATH /usr/lib/X11R5
#X11INCPATH /usr/include/X11R5
# Specific for IBM AIX4.2
#X11LIBPATH /usr/lpp/X11/lib
#X11INCPATH /usr/lpp/X11/include
# Specific for MacOSX
#X11LIBPATH /usr/X11R6/lib
#X11INCPATH /usr/include/X11
gamit<路径>/libraries压缩包里,修改Makefile.config/Makefile.config.bak中的一组参数
(要修改Makefile.config.bak,打开方式gedit)
MAXSIT 55
MAXSAT 32
MAXATM 13
MAXEPC 2880
将MAXATM改为25。
安装软件,执行 ./install_software
安装程序install_software启动,搜索安装目录/opt/gamit10.34下的全部压缩文件,提示
GAMIT and GLOBK to be installed into /opt/gamit10.34
If you need help with command line options type CTL_C now and type
install_software -help on the command line
The compressed tarfiles will be removed after extraction of the
directories, but except for that, the script may be stopped and
rerun safely from any point. Tarfiles to be uncompressed:
com.10.34.tar.Z etopo5.grd.10.0.tar example.10.34.tar.Z gamit.10.34.tar.Z help.10.34.tar.Z kf.10.34.tar.Z libraries.10.34.tar.Z maps.10.1.tar.Z tables.10.34.tar.Z
Continue ? (y/n)
输入字母“y”,开始解压缩安装文件,
.. uncompressing and extracting the directories:
Do you want to apply incremental updates: incremental_updates.080812.tar.Z incremental_updates.080919.tar.Z incremental_updates.081022.tar.Z
Continue ? (y/n)
输入字母“y”,开始解压缩安装文件,
.. applying incremental updates:
.. adding /opt/gamit10.34/com to your search path to continue installation
To execute GAMIT and GLOBK you will need to set your login path to
include /opt/gamit10.34/com /opt/gamit10.34/gamit/bin /opt/gamit10.34/kf/bin
You will also need the alias or link gg --> /opt/gamit10.34
Your Operating System type is: Linux
Your default awk version is: /usr/bin/awk
These are the default paths to X11 found in Makefile.config
X11LIBPATH: /usr/lib/X11
X11INCPATH: /usr/include/X11
Searching your system for X11 installation
Found these paths to X11 libs and includes on your system
X11LIBPATH: /usr/lib
X11INCPATH: /usr/include/X11
Are these correct for your system?
Continue? (y/n)
输入字母“y”,提示
GAMIT dimensions in /libraries/Makefile.config are set to
maxsit = 55
maxepc = 2880
maxatm = 25
maxsat = 32
Are these defaults found in Makefile.config correct?
If NOT edit the Makefile.config now before choosing to contine
Continue ? (y/n)
输入字母“y”,开始安装。安装最后会���示
++++++++++++++++++
GLOBK installed
++++++++++++++++++
Create the gg link in your home directory to the version of
gamit/globk you just installed ? (y/n)
输入字母“y”,回车,显示
Making required ~/gg link to newly installed software
ln -s -f /opt/gamit10.34 ~/gg
Don't forget to set your : path to include /opt/gamit10.34/gamit/bin and /opt/gamit10.34/kf/bin
: HELP_DIR environment variable in you shell profile
(in .cshrc/.tcshrc add: setenv HELP_DIR /opt/gamit10.34/help/)
: INSTITUTE evnironment variable in your shell profile
(in your .cshrc/.tcshrc add: setenv INSTITUTE where_i_work)
where_i_work is a 3 character identifier for your solutions