红联Linux门户
Linux帮助

CentOS 6.2 64bits下安装CWP的地球物理专业软件SEISMIC UNIX

发布时间:2014-11-01 21:39:53来源:linux网站作者:Lionel

今天刚刚装上CentOS6.2,上手不是很熟练,以前曾经在RedHat9.0和Ubuntu 10.04下安装过su,感觉过程不是很复杂,但是今天在CentOS上装时遇到了很多的问题,记录下来,以便学习之用。


SEISMIC UNIX
1.下载seismic unix
http://www.cwp.mines.edu/cwpcodes/下载当前的SU版本。我下载的是cwp_su_all_41_tar.Z 。具体存放在/home/tethys/cwp下。

tar -zxvf cwp_su_all_41_tar.Z      ######  解压文件包。

在/home/tethys/cwp/下生成/src目录,seismic unix软件的相关文件都在其下。安装说明Installation_Instructions和安装配置文件Makefile.config,需要认真阅读。

2、Makefile.config详解

Makefile.config配置比较困难,主要是因为我们大多对Linux系统比较陌生。但为了学习seismic unix只好硬着头皮了。我原来在Fedora下安装成功过,后来重装系统安装就有问题。这次在ubuntu8.04下,我反反复复的进行ubuntu系统和seismic unix的重装,前后多周的时间,终于总结出必要的ubuntu和seismic unix的配置。最主要的是,每一次重装,拿起笔详细记录下每一步,下次就能少犯错。总结出来,就成此文。

下面对Makefile.config中重点内容的个人理解,内有多多错误。为了方便说明,我只将重点保留(去掉前面的注释符号#)的行列出,自然相同内容的其它选项行就要注释掉(行首加#)。

ENDIANFLAG = -DCWP_LITTLE_ENDIAN
XDRFLAG = -DSUXDR
LARGE_FILE_FLAG = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE

##### 否则seismic unix处理数据有大小限制

OPTC = -O3 -Wall -Wno-long-long -ansi -pedantic -D_POSIX_SOURCE

##### 这一项要与cc编译系统相配

CC = cc
OPTF = -O -static -march=i686 -fno-automatic -fno-second-underscore

#### 这一项要与fortran编译系统相配

FC = g77

下面这几项是最为复杂,主要是定义相关的头文件和库文件的路径。经过N次摸索后有两个方法可以提供帮助。

A、在安装相应文件包时,或在“新立得”(Synaptic Package Manager)中搜到相应的包,在“属性”(Properties)项目下的“安装文件”(Installed Files)下有关于这个软件包详细的安装文件和目录。

Synaptic Package Manager--> Properties--> Installed Files

B、通过特殊文件,搜索,找到这个文件的目录所在。比如Xm.h,libXm.a等。如果,在make过程中出错的话,会提示相应的文件,通过这些文件来找目录。

IX11 = /usr/include/X11
LX11 = /usr/lib/X11
IMOTIF = /usr/include
LMOTIF = /usr/lib
IGL = /usr/include
LGL = /usr/lib
IGLUT = /usr/include
LGLUT = /usr/lib

Makefile.config中其它项目,基本不需改动,根据提示选择就行。


先说Ubuntu和 linux redhat中,SU的安装过程。这两个版本的安装基本上相同。

Ubuntu安装SU,则“(一)前期准备”为必须的;RedHat安装可以跳过“(一)前期准备”,直接从“(二)修改环境变量” 开始)

(一)前期准备

1. 刚装上ubuntu后,首先需要将网络设置好,并选择合适的软件源。

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (备份当前的源列表,以便日後需要时恢复)

sudo gedit /etc/apt/sources.list (修改sources.list文件中源的列表)

sudo apt-get update

2. 预装7个软件包,即在终端中输入如下命令:

sudo apt-get install build-essential

sudo apt-get install libx11-dev

sudo apt-get install libxt-dev

sudo apt-get install libglut3-dev

sudo apt-get install libxmu-dev

sudo apt-get install libxi-dev

sudo apt-get install gfortran

确保各种所需编译器都安装完毕,各种编译命令能成功运行。如gcc,g77。

(二)修改环境变量

1.修改.bashrc

在.bashrc中加入如下代码:

export CWPROOT=/home/tethys/cwp

export PATH=$PATH:$CWPROOT/bin

unset USERNAME

2.修改.profile

在. profile中加入如下代码:

#CWPROOT=/home/zhao/cwp

#PATH=$PATH:$HOME/bin:${CWPROOT}/bin

export CWPROOT=/home/ tethys /cwp

export PATH=$PATH:$CWPROOT/bin

unset USERNAME

3. source . bashrc

sourcer .profile

4.检查环境变量设置

echo $CWPROOT;

echo $PATH;

PS: 1和2理论上讲,设置一个就可以,分系统不同而区别,当然,两个都设置来也不会出现问题。

(三)安装SU

将下载的SU压缩包(如cwp_su_all_42.tgz)加压缩到步骤二设置的环境变量/home/zhao/cwp下。(zhao为用户名)

进入到src 文件夹,执行以下命令,遵照提示往下操作就行了.

make install (to install the basic set of codes)

make xtinstall (to install the X-toolkit applications)

make finstall (to install the Fortran codes)

make mglinstall (to install the Mesa/ Open GL items)

make xminstall (to install the Motif application)(nonessential)

make utils (to install libcwputils) (nonessential)

3.安装完毕后,进行测试

suplane|suxwigb & (|为管道符号,表示数据流动,加&表示放到后台执行)

如果出现以下图形便恭喜你安装完成了。如果没有出现以上图片,执行以下命令:

source . profile

csh执行: source .cshrc

然后再执行

suplane|suxwigb &

如果这次出现图形,则重启计算机,以后就可以爽快的使用了。


CentOS6.2  64位下安装SEISMIC UNIX

1、配置环境变量

和上面的过程一样,修改.bashrc文件,然后source .bashrc

之后用echo $CWPROOT echo $PATH 检查即可

centos的~/.bashrc在/home/tethys/目录下,直接gedit ~/.bashrc即可在弹出窗口中添加环境变量。

2、查看seismic unix所需的软件或库

在seismic unix安装包中的makefile.config配置文件中明确注明了每一步安装所需要的代码。

# make install (to install the basic set of codes)
# make xtinstall (to install the X-toolkit codes)
# make finstall (to install the Fortran codes)
# make mglinstall (to install the Mesa/ Open GL codes)**
# make xminstall (to install the X-Motif codes)*
* Note: You must have the Motif Developer's package to install these codes.
# This is not the same as the "Motif Window Manager". Many systems
# use the Motif Window Manager without providing libXm.a and Xm.h.
# These items are not essential to the operation of the package
# and may be bypassed. (Also, you may substitute Lesstif, for Motif.)
# ** The Mesa/Open GL codes require the Mesa package
# Note also: That * and ** are not necessary for the majority of SU
# operations and can be safely omitted, if you have trouble
# installing them.

3、进入到src 文件夹,依次执行以下命令若有错误,在插入的安装光盘的路径/media/CentOS_6.2_Final/Packages下进行查找缺少的软件包,进行安装,然后再执行刚才未完成的安装命令。

例:错误出现cannot find -lm 即为缺少the static versions of glibc.

在/media/CentOS_6.2_Final/Packages下查找对应的软件包,yum search glibc

x86_64:
yum install glibc-static.x86_64

IA32:
yum install glibc-static.i686

我的系统为64位的,故执行yum install glibc-static.x86_64

依次进行解决出现的错误,直到执行完成以下步骤没有出现错误为止。

make install (to install the basic set of codes)
make xtinstall (to install the X-toolkit applications)

make finstall (to install the Fortran codes)

make mglinstall (to install the Mesa/ Open GL items)

make xminstall (to install the Motif application)(nonessential)

make utils (to install libcwputils) (nonessential)

4、安装完成,测试(同上)

suplane|suxwigb & (|为管道符号,表示数据流动,加&表示放到后台执行)

如果出现以下图形便恭喜你安装完成了。如果没有出现以上图片,执行以下命令:

source . profile

csh执行: source .cshrc

然后再执行

suplane|suxwigb &

如果这次出现图形,则重启计算机,下次启动时则正常了。