Ubuntu下安装GAMIT 10.40

2021-06-08 11:00:18 浏览数 (1)

<p align="left">从安装的过程来看,Ubuntu在台式机上会安装gcc,但是笔记本上则不会,所以在第一次装的时候并没有成功,虽然从头到尾都安装了,没有中断,但最后采用doy验证的时候没有通过。

<p align="left">下文是根据原文加自己的安装过程,总结出的内容,

红色是需要注意的地方

内容可能上下有出入,但不影响安装。

<p align="left">出入的部分主要是软件的版本显示问题(原文是GAMIT 10.34,我安装的是GAMIT 10.40)和安装路径。

<p align="left">首先,安装GCC,因为在root模式下,命令行没有sudo

<p align="left">

 (

首次安装系统,需为

ROOT

设置密码才能进入,在终端输入:

sudo passwd 

输入完后,重启电脑,更改登录,以

root

账户登录

)

<p align="left">apt-get build-dep gcc 

<p align="left">

(

若出现未发现

CSH

软件包,输入

sudo apt-get update

,更新源,要求电脑必须联网,以下的软件安装的前提都是电脑连着互联网

)

<p align="left">链接1采用两种方法,比较了大小后决定采用第一条,就是上面的命令。

<p align="left">通过gcc --version确认版本为 GCC 4.4.5

<p align="left">Gamit安装需要csh(tcsh)环境、 GNU gfortran 4.2编译器和libx11-dev库支持。gfortran是软件推荐使用的编译器。libx11-dev是X11的程序开发库,它提供的lib.h和 libx11.a(libx11.so)是Gamit安装必须用到的两个库文件,主要是为Globk的提供图形库支持。以上三个条件却一不可。

<p align="left">ubuntu系统没有csh,默认为bash。因此要先安装csh。

<p align="left">ubuntu系统自带了gcc4.2,但是却没有安装gfortran编译器。而你安装时安装程序会调用默认的gfortran编译器,除非你指定gcc为你的编译器。

<p align="left">首先,以root身份登录,打开终端,输入

<p align="left">apt-get install csh

<p align="left">系统自动下载并安装csh,安装完成后在终端输入

<p align="left">chsh

<p align="left">提示

<p align="left">正在更改 root 的 SHELL

<p align="left">请输入新值,或直接敲回车键以使用默认值

<p align="left">      登录 Shell [/bin/bash]:

<p align="left">输入

<p align="left">/bin/csh

<p align="left">修改bash为csh。重新起动ubuntu,并以root身份登录,打开终端,输入

<p align="left"># echo $SHELL

<p align="left">

(“#

”是终端自带的符号,输入

echo $SHELL

即可

)

<p align="left">返回s“/bin/csh”,说明SHELL修改成功。

<p align="left">接着输入

<p align="left">apt-get install gfortran

<p align="left">系统自动下载并安装gfortran。

<p align="left">在输入

<p align="left">apt-get install libx11-dev

<p align="left">系统自动下载并安装libx11-dev库支持。

<p align="left">安装gamit 10.4

<p align="left"> 定位到gamit的安装路径

<p align="left">

(

我的安装路径是

opt/gamit_globk

,此路径与后文的

.cshrc

保持一致,将

gamit

目录下

updatessource

下的文件全部拷贝至安装路径

)

<p align="left">      准备工作:

<p align="left">      chmod x install_software

<p align="left">

(增加

install_software

脚本的执行权限)

<p align="left">             (

单击脚本,点显示)

修改install_software文件内容

<p align="left"> “usr -name libX11.a”为"usr -name libX11.so",一个是静态共享库,一个是动态共享库。

<p align="left">        makefile.config,修改:

<p align="left">

 

makefile.config

文件在

opt/gamit_globk/libraries

压缩包里)

<p align="left"># X11 library location - uncomment the appropriate one for your system

<p align="left"># Generic (will work on any system if links in place)

<p align="left">X11LIBPATH /usr/lib/X11

<p align="left">X11INCPATH /usr/include/X11 

<p align="left"># Specific for Sun with OpenWindows

<p align="left">#X11LIBPATH /usr/openwin/lib

<p align="left">#X11INCPATH /usr/openwin/share/include/X11 

<p align="left"># Specific for PC Solaris 10

<p align="left">#X11LIBPATH /usr/openwin/lib/

<p align="left">#X11INCPATH /usr/openwin/share/include/X11

<p align="left"># Specific to Linux RedHat 7,8 and 9, RH-FC1 -> 3 

<p align="left">#X11LIBPATH /usr/X11R6/lib

<p align="left">#X11INCPATH /usr/X11R6/include/X11 

<p align="left"># Specific to FC5

<p align="left">#X11LIBPATH /usr/lib

<p align="left">#X11INCPATH /usr/include/X11 

<p align="left"># Specific for MIT HP and Sun for Release 5

<p align="left">#X11LIBPATH /usr/lib/X11R5

<p align="left">#X11INCPATH /usr/include/X11R5 

<p align="left"># Specific for IBM AIX4.2

<p align="left">#X11LIBPATH /usr/lpp/X11/lib

<p align="left">#X11INCPATH /usr/lpp/X11/include 

<p align="left"># Specific for MacOSX 

<p align="left">#X11LIBPATH /usr/X11R6/lib

<p align="left">#X11INCPATH /usr/include/X11

<p align="left"> 

<p align="left">为:

<p align="left"># X11 library location - uncomment the appropriate one for your system

<p align="left"># Generic (will work on any system if links in place)

<p align="left">#X11LIBPATH /usr/lib/X11

<p align="left">#X11INCPATH /usr/include/X11 

<p align="left"># Specific for Sun with OpenWindows

<p align="left">#X11LIBPATH /usr/openwin/lib

<p align="left">#X11INCPATH /usr/openwin/share/include/X11 

<p align="left"># Specific for PC Solaris 10

<p align="left">#X11LIBPATH /usr/openwin/lib/

<p align="left">#X11INCPATH /usr/openwin/share/include/X11

<p align="left"># Specific to Linux RedHat 7,8 and 9, RH-FC1 -> 3 

<p align="left">#X11LIBPATH /usr/X11R6/lib

<p align="left">#X11INCPATH /usr/X11R6/include/X11 

<p align="left"># Specific to FC5(F6,F7,F8 )

<p align="left">X11LIBPATH /usr/lib

<p align="left">X11INCPATH /usr/include/X11 

<p align="left"># Specific for MIT HP and Sun for Release 5

<p align="left">#X11LIBPATH /usr/lib/X11R5

<p align="left">#X11INCPATH /usr/include/X11R5 

<p align="left"># Specific for IBM AIX4.2

<p align="left">#X11LIBPATH /usr/lpp/X11/lib

<p align="left">#X11INCPATH /usr/lpp/X11/include 

<p align="left"># Specific for MacOSX 

<p align="left">#X11LIBPATH /usr/X11R6/lib

<p align="left">#X11INCPATH /usr/include/X11      

<p align="left">gamit/libraries压缩包里,修改Makefile.config/Makefile.config.bak中的一组参数

<p align="left">

(要修改

Makefile.config.bak

,打开方式

gedit

<p align="left">MAXSIT 55

<p align="left">MAXSAT 32

<p align="left">MAXATM 13

<p align="left">MAXEPC 2880

<p align="left">将MAXATM改为25。

<p align="left">安装软件,执行    ./install_software

<p align="left">安装程序install_software启动,搜索安装目录/opt/gamit10.34下的全部压缩文件,提示

<p align="left">GAMIT and GLOBK to be installed into /opt/gamit10.34

<p align="left">If you need help with command line options type CTL_C now and type

<p align="left">install_software -help on the command line

<p align="left">The compressed tarfiles will be removed after extraction of the

<p align="left">directories, but except for that, the script may be stopped and

<p align="left">rerun safely from any point. Tarfiles to be uncompressed:

<p align="left">    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

<p align="left">Continue ? (y/n)

<p align="left">输入字母“y”,开始解压缩安装文件,

<p align="left">.. uncompressing and extracting the directories:

<p align="left">Do you want to apply incremental updates: incremental_updates.080812.tar.Z incremental_updates.080919.tar.Z incremental_updates.081022.tar.Z

<p align="left">Continue ? (y/n)

<p align="left">输入字母“y”,开始解压缩安装文件,

<p align="left">.. applying incremental updates:

<p align="left">.. adding /opt/gamit10.34/com to your search path to continue installation

<p align="left">To execute GAMIT and GLOBK you will need to set your login path to

<p align="left">include /opt/gamit10.34/com /opt/gamit10.34/gamit/bin /opt/gamit10.34/kf/bin

<p align="left">You will also need the alias or link gg --> /opt/gamit10.34

<p align="left">Your Operating System type is: Linux

<p align="left">Your default awk version is: /usr/bin/awk

<p align="left">These are the default paths to X11 found in Makefile.config

<p align="left">X11LIBPATH: /usr/lib/X11

<p align="left">X11INCPATH: /usr/include/X11

<p align="left">Searching your system for X11 installation

<p align="left">Found these paths to X11 libs and includes on your system

<p align="left">X11LIBPATH: /usr/lib

<p align="left">X11INCPATH: /usr/include/X11

<p align="left">Are these correct for your system?

<p align="left">Continue? (y/n)

<p align="left">输入字母“y”,提示

<p align="left">GAMIT dimensions in /libraries/Makefile.config are set to

<p align="left">  maxsit = 55

<p align="left">  maxepc = 2880

<p align="left">  maxatm = 25

<p align="left">  maxsat = 32

<p align="left">Are these defaults found in Makefile.config correct?

<p align="left">If NOT edit the Makefile.config now before choosing to contine

<p align="left">Continue ? (y/n)

<p align="left">输入字母“y”,开始安装。安装最后会���示

<p align="left">

<p align="left">GLOBK installed

<p align="left">

<p align="left">Create the gg link in your home directory to the version of

<p align="left">gamit/globk you just installed ? (y/n)

<p align="left">输入字母“y”,回车,显示

<p align="left">Making required ~/gg link to newly installed software

<p align="left">ln -s -f /opt/gamit10.34 ~/gg

<p align="left">Don't forget to set your : path to include /opt/gamit10.34/gamit/bin and /opt/gamit10.34/kf/bin

<p align="left">                          : HELP_DIR environment variable in you shell profile

<p align="left">                            (in .cshrc/.tcshrc add: setenv HELP_DIR /opt/gamit10.34/help/)

<p align="left">                          : INSTITUTE evnironment variable in your shell profile

<p align="left">                            (in your .cshrc/.tcshrc add: setenv INSTITUTE where_i_work)

<p align="left">                            where_i_work is a 3 character identifier for your solutions

<p align="left"> 

<p align="left">至此,软件已经安装成功。但要始软件能够正常使用,还要修改“主文件夹”下的“.cshrc”文件.该文件是用户的C SHELL配置文件,默认为隐藏文件。必须将Gamit的安装目录添加在里面,否则将无法在终端使用Gamit命令进行数据解算。

<p align="left">由于ubuntu默认使用bash,所以,用户主目录下并没有csh的配置文件,你需要在自己的主文件夹下建立一个“.cshrc”文件,并输入内容如下

<p align="left">#

<p align="left"># This file is applicable to all C-shell users.

<p align="left"># set prompt

<p align="left">set prompt = "[`echo $cwd`]% "

<p align="left">set history = 50

<p align="left">set gamitpath = /opt/gamit10.34

<p align="left">

#    (

我的安装路径是

opt/gamit_globk

,所以这里应该是

set gamitpath = /opt/gamit_globk)

<p align="left">set path = (. /bin /sbin /ect /usr/bin /usr/sbin /usr/ucb /usr/bin/X11 /usr/X11R6/bin $path)

<p align="left">set path = (. /usr/local/gmt/bin /usr/local/bin /usr/local/sbin /usr/local/lib /usr/lib $path)

<p align="left">#set path = (. /usr/local/gmt/bin /usr/local/bin /usr/local/lib /usr/ucb/ nfs r0 soft0 0 $path)

<p align="left">set path = (. $gamitpath/gamit/bin $gamitpath/kf/bin $gamitpath/com $path)

<p align="left">setenv HELP_DIR $gamitpath/help/

<p align="left">setenv PATH "/usr/sbin:/sbin:${PATH}"

<p align="left">setenv MANPATH /usr/local/gmt/man:/usr/local/man:/usr/X11R6/man

<p align="left">setenv LIBPATH /usr/local/gmt/lib:/usr/lib:/usr/local/lib:/usr/i386-glibc21-linux/lib

<p align="left">#set gcclib direction

<p align="left">setenv LD_LIBRARY_PATH /usr/local/gcc-3.4.1/lib/

<p align="left"># set alias

<p align="left">alias cd 'cd !*; set prompt = "[`echo $cwd`]% "'

<p align="left">alias pwd 'echo $cwd'

<p align="left">alias ls 'ls --classify'

<p align="left">alias ll 'ls -l'

<p align="left">alias la 'ls -a'

<p align="left">alias rm 'rm -i'

<p align="left">alias mv 'mv -i'

<p align="left">保存,OK,全部安装完成。在终端输入

<p align="left">doy

<p align="left">返回

<p align="left">DOY: Converts various date formats

<p align="left">DOY: Converts various date formats.

<p align="left">Runstring:

<p align="left">% doy

<p align="left">o

<p align="left">% doy W

<p align="left">o

<p align="left">% doy Y

<p align="left">where jd is Julian date (assumed if only one argument)

<p align="left">      year is calender yea

<p align="left">      doy is day of year (assumed if two arguments)

<p align="left">      month is month

<p align="left">      day is day of month.

<p align="left">      hr min is hrs and minutes of day (Only if ymd form used).

<p align="left">In the second form (i.e. W appended to the first value),

<p align="left">the entries are assumed to gps week no and the second entry

<p align="left">(optional) is either gps day of week (0-6) or seconds of

<p align="left">gps week.

<p align="left">NOTE: GPS Day of Week runs from 0-6 (Changed May 20, 1997).

<p align="left">In the third form with Y appended, the argument is taken as

<p align="left">deciminal year. (Versions after 2004/12/21 correctly account

<p align="left">for leap years in converting deciminal years back to Julian dates)

<p align="left">The conversions made are based on the number of arguments

<p align="left">passed.

<p align="left">NDOY: Version of doy of year which takes keyboard input in the

<p align="left">forms above. (^D ends program input).

<p align="left">Example: doy 92 200

<p align="left">Date 1992/07/18 0:00 hrs, DOY 200 JD 2448821.5000 MJD 48821.0000

<p align="left">GPS Week  653 Day of week 6, GPS Seconds 518400 Day of Week Sat

<p align="left">Decimal Year 1992.54372

<p align="left">Example: doy 654W 345600

<p align="left">Date 1992/07/23 0:00 hrs, DOY 205 JD 2448826.5000 MJD 48826.0000

<p align="left">GPS Week  654 Day of week 4, GPS Seconds 345600 Day of Week Thu

<p align="left">Decimal Year 1992.55738

<p align="left">***TODAY*** IS:

<p align="left">Date 2008/10/30 15:19 hrs, DOY 304 JD 2454770.1387 MJD 54769.6387

<p align="left">GPS Week 1503 Day of week 4, GPS Seconds 400786 Day of Week Thu

<p align="left">Decimal Year 2008.829614

<p align="left">

安装成功!!!!

0 人点赞