SU的安装

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

安装说明
SU是科罗拉多州矿业学院开发的一个免费地震处理软件。

国内外很多科研人员及学生都借助于他来进行创作,和其他天价的处理软件相比,SU对学生就显得尤为珍贵了,更何况他开放源代码,可以方便地在其基础上进行再创作。

但是对于不是很熟悉LINUX的人来说,能把它安装上也需要花不少功夫,下面就把我的体会写出来,以供大家参考。

在Redhat9.0,Ubantu,Fedaro5,Fedaro7,和SUN工作站上多次安装,要领如下(默认bsh ):
1、确保不是在root用户下安装,root权限太大,稍有不慎,可能会把系统搞崩溃。

去CWP主页/cwpcodes/index.html下载好安装包,目前版本是:cwp_su_all_40.gz,用tar -xvzf cwp_su_all_40.gz 解压出src文件夹,可以先在家目录下创建su文件夹,把src放在su内。

2、修改环境变量,先在家目录下(终端打开就是,如果不在用cd命令后面不加参数就可以进去,用pwd就可以看路径,比如我的路径是 /home/user ,)用ls -a 查看文件。

找到 .bashrc隐藏文件,用vi 编辑器打开(vi .bashrc),在末尾出添加:
export CWPROOT=/home/user/su
export PATH=$PATH::/home/user/su/bin
然后保存(“先按ESC键,然后按两次大写Z”或者“先按ESC键,然后输入:wq”)退出,同样执行 vi .bash_profile 进行修改:
export CWPROOT=/home/user/su
export PATH=$PATH::/home/user/su/bin
保存退出后,然后执行以下命令:
source .bashrc
source .bash_profile
然后检查设置是否正确:
echo $CWPROOT
显示为:/home/user/su 则说明无误
echo $PATH
末尾处有 /home/user/su/bin 就万事大吉了,关掉终端,重新打开一个,确保万无一失,如果不正确,则重新设置。

如果你用的是 csh 就同样在 .cshrc 中添加以下两行内容:
setenv CWPROOT /home/user/su
set path=($path . /home/user/su/bin)
保存退出,执行:
source .cshrc
echo $CWPROOT
echo $path
看设置是否准确无误,如果一切都安排妥当,我们就可以进行下一步的操作了。

更方便的是直接把别人已经安装好的su文件夹,放在/home/user/ 下边就可以了.
如果你用的是多结点机群,那么只需把其他用户su 和.../su/bin路径加入你的环境变量中即可,假如在 king 用户下已安装过,
export CWPROOT=/home/king/su
export PATH=$PATH::/home/king/su/bin
只要把文件路径写对就没问题了.
3)(这项不需要再改)
进入这个目录,可以看到makefile.config 这个文件,要修改里面的三项,输入命令:gedit makefile.config , 然后修改所打开的文件:
a,将ENDIANFLAG = -DCWP_LITTLE_ENDIAN句激活(即去掉#)。

b,将include $(CWPROOT)/src/Rules/gnumake.rules句激活
c,蔽掉include$(CWPROOT)/src/Rules/oldmake.rules句,修改后保存。

d,将FC=g77, FC=f77,FC=ifort屏蔽掉,激活FC=gfortran
4)打开MakeFile文件,将“#CWPROOT =”前的“#”去掉,在等号后面添加/home/yourname/su
(这步很关键,之前我一直报错,结果就是忽略了这步的原因)
4、修改完Makefile.config,就可以安装了。

进入到 src 文件夹
执行以下命令,遵照提示往下操作就行了(一直选y).
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)
5、安装完毕后,进行测试
suplane|suxwigb & (|为管道符号,表示数据流动,加&表示放到后台执行) 如果出现以下图形便恭喜你安装完成了:
如果没有出现以上图片,执行以下命令:
source .bash_profile
csh执行: source .cshrc
然后再执行
suplane|suxwigb &
如果这次出现图形,则重启计算机,以后就可以爽快的使用了.
修改makefile.config非常关键,其要领是:认真阅读每一项的说明,并根据它给出的路径或编译器在自己的电脑内搜索,看是否一致,把没有的或重复的都注释掉,最后得出最佳编译效果。

以下是makefile.config的内容供大家参考,复制后替换原来的文件即可:
# Rules for standard `make' installs
# leave the next line uncommented if you are using the standard Unix "make"
# command. Make sure the gnumake.rules line is commented out in this case. include $(CWPROOT)/src/Rules/oldmake.rules
# If you get error messages about "can't find $(@F), then
# you are actually using GNU make, and need to uncomment the
# gnumake.rules line
# Rules for 'GNU make' installs (includes Linux, FreeBSD, Mac OS X installs)
# uncomment the next line if you are using "GNU make"
include $(CWPROOT)/src/Rules/gnumake.rules
########################################################################
# C compiler; change this only if you are using a different C-compiler
CC = cc
########################################################################
# standard CFLAGS
CFLAGS = -I$I $(OPTC) $(LARGE_FILE_FLAG) $(ENDIANFLAG) $(XDRFLAG) $(LINEHDRFLAG)
########################################################################
# C++ interfacing is still experimental
# C++ compiler
C++ = c++
########################################################################
# standard CFLAGS for C++
C++FLAGS = -I$I $(OPTC) $(LARGE_FILE_FLAG) $(ENDIANFLAG) $(XDRFLAG)
# under SUN OS make sure that your load library path is consistent with
# your choice of C compiler above. Be sure to include any other library
# paths (for example X windows). Set LD_LIBRARY_PATH as a shell environment # variable or hard set here. An example:
#LD_LIBRARY_PATH = /usr/lang/SC2.0.1patch:/usr/lib/X11R5
# under SUN OS and Linux uncomment the next line
#LD_LIBRARY_PATH += $(CWPROOT)/lib:/usr/local/lesstif/lib
# under AIX on IBM uncomment the next line
#LD_LIBRARY_PATH = $(CWPROOT)/lib:/usr/X11R6/LessTif/lib
# under SUN OS and RedHat (and other) Linux uncomment the next line
LD_LIBRARY_PATH += $(CWPROOT)/lib:/usr/X11R6/LessTif/lib
############################################################################# # the archiver
AR = ar
############################################################################# # ar FLAGS
ARFLAGS = rv
############################################################################# # ranlib definition
RANLIB = ranlib
# ranlib flags
RANFLAGS =
# under IRIX (Silicon Graphics, SGI), you probably will have
# to use this line for RANLIB (also for SOLARIS)
#RANLIB = ar -ts
############################################################################# # Some Makefiles have change the permissions of executable and other output # chmod line for include files. These lines should not be changed. ICHMODLINE = chmod 664 $@
# chmod line for executables
MCHMODLINE = chmod 775 $@
# Uncomment the two lines below if installing under CYGWIN32 under Windows
#ICHMODLINE =
#MCHMODLINE =
############################################################################# # Default C preprocessor (cpp) definition
# this is the one you will use on most systems
# AIX, IRIX if using the native cc compiler, Linux
CPP = /lib/cpp
# under CYGWIN32, this seems like shooting at a moving target.
# one possibility is to simply uncomment the next line
# CPP = /usr/bin/cpp
# under Solaris, IRIX, AIX, and possibly other with gcc compiler, use:
#CPP = gcc -E
# make sure the path to gcc matches that in the CC = line
#
# You can tell you need to invoke gcc -E if you compile the package
# and get error messages about programs not recognizing header fields.
# use this under SOLARIS, if using the default C compiler
#CPP = /usr/ccs/lib/cpp
# use this on Cray T3E
#CPP = /opt/ctl/bin/cpp
# use this on Mac OS X and Free BSD
#CPP = /usr/bin/cpp
######################################################################
######################################################################
# Fortan materials.
# The majority of the SU package does not depend on fortran, so you
# are free to ignore this if you are not planning on doing the 'finsintall'
# portion of the installation.
#
# Please note, there may be additional compiler flags necessary to get
# the Fortran codes to work properly. You may need to experiment.
#
# Default for IBM RS6000, SGI, also for the Intel compiler ifort
OPTF = -O
# Default for Linux and other GCC installs (most likely FreeBSD and Mac OS X) #OPTF = -O -static -m486 -ansi -fno-globals -fno-automatic -fno-second-underscore #OPTF = -O -static -m486 -fno-automatic -fno-second-underscore
# Use this for HP
# (If you figure out what goes in
#the next line, email me: john@)
#OPTF =
######################################################################
# Fortran compiler
# default (use g77 on Linux systems, f77 there is really f2c)
FC = f77
# GNU fortran compiler (Linux systems)
FC = g77
# GNU fortran compiler (Linux systems Fedora Core 5)
#FC = gfortran
# Fortran compiler on the Cray T3E
#FC = f90
# Intel Fortran Compiler
#FC = ifort
######################################################################
# JAVA compiler
JC = javac
############################################################################# # Some convenient abbreviations (don't change this)
include $(CWPROOT)/src/Rules/abbrev.rules
#####################################################################
#####################################################################
#
# X-windows related materials:
#
# The paths to X11 include files and X11 libraries are not
# consistent between vendors. The following are generic paths.
# You may need to change these, if the include files and libraries
# are not in these locations on your machine.
# The default paths should work on many systems, for example,IBM RS6000. # Examples of the path SUN are given here.
#
# Troubleshooting: Make sure that your machine really has the X-windows # libraries and include files. Make sure that these files really
# are where you think they are.
#####################################################################
# X11 include and library paths
####
# Generic (RS6000, SGI)
# X11 include path
IX11 = /usr/local/include
# X11 library path
LX11 = /usr/local/lib
####
####
## The following X11 include and X11 lib paths are recommended for
## SUN, provided that the standard X11 stuff is really /usr/openwin.
# X11 include path
#IX11 = /usr/openwin/include
# X11 library path
#LX11 = /usr/openwin/lib
####
####
## The following paths would be used under Linux
## and possibly under SCO Unix installs
# X11 include path
IX11 = /usr/X11R6/include
# X11 library path
LX11 = /usr/X11R6/lib
####
## Additional X libraries that may be needed for some systems
## Example: uncomment for CYGWIN32 installs
#XLFLAGSADD = -lSM -lICE
####
# Motif
#
# Note: Your machine can be running the Motif Window Manager, but not have the # Motif Developers Package (include files with names like Xm.h
# and libraries with names like libXm.a). You can only do the xminstall
# if you have these include files and libraries.
#
# include path
IMOTIF = /usr/local/include
# library path
LMOTIF = /usr/local/lib
# Example of Lesstif usage:
# include path
IMOTIF = /usr/local/lesstif/include
# library path
LMOTIF = /usr/local/lesstif/lib
#### Example of Lesstif usage under RedHat
# include path
IMOTIF = /usr/X11R6/LessTif/Motif2.0/include
# library path
LMOTIF = /usr/X11R6/LessTif/Motif2.0/lib
#### Open GL/Mesa include and library paths (generic example) # Open GL/Mesa include path
IGL = /usr/local/include
# Open GL/Mesa library path
LGL = /usr/local/lib
## GLUT include and library paths
# include path
IGLUT = /usr/local/include
# library path
LGLUT = /usr/local/lib
#### examples for SGI with glut installed in /usr/local/glut-3.3
## GLUT include and library paths
#IGLUT = /usr/local/glut-3.3
# Open GL/Mesa library path
#LGLUT = /usr/local/glut-3.3/lib/glut.n64
####
#### Old Red Hat Linux example
## GLUT include and library paths
#IGLUT = /usr/X11R6/include
# Open GL/Mesa library path
#LGLUT = /usr/X11R6/lib
###
#### Red Hat 7.2 Linux example
## GLUT include and library paths
IGLUT = /usr/include
# Open GL/Mesa library path
LGLUT = /usr/lib
###
################################################################
### CFLAGS lines (Don't change the next line)
include $(CWPROOT)/src/Rules/cflags.rules
###################################################################### ### Linking Flags for Experimental 3D graphics
# The choice here is between the free Mesa package, and the
# Open GL (hardware-based) package.
#
### MESA / OPEN GL Linking Flags
# Uncomment the next line for installations using the free Mesa package
include $(CWPROOT)/src/Rules/newmesa.rules
# Uncomment the following line for installations using Open GL (eg. SGI) include $(CWPROOT)/src/Rules/opengl.rules
######################################################################
######################################################################
# Suffix rules for library maintenance
#
# If your version of 'make' does not support suffix rules,
# you should install GNU make (often called 'gmake') and use that.
# Gmake is available from (18.159.0.42)
# and other GNU mirror sites.
# standard suffix rules (do not change the next line)
include $(CWPROOT)/src/Rules/suffix.rules
include $(CWPROOT)/src/Rules/misc.rules
SU的安装与使用 (二地震数据的转换与道头编辑)
前面介绍了SU的安装方法,但是由于它是采用命令语句操作,刚开始使用起来,可能会很不适应。

想熟悉SU的话,最好的方法就是看他的使用说明:Complete Listing of CWP Free Program Self-Documentations 和 The New SU User's Manual,这两个都可以在CWP主页上下载到。

前者说明详尽,后者把相近的命令都归了类,更便于初学者使用。

还有就是直接在终端输入命令的名字,他就会把该命令的使用方法显示出来了,这个更快捷。

对初学者来说,最大的帮手莫过于SU 自带得demos了,它位于src文件夹内,里面把常用的处理命令的使用方法几乎都演示了一遍,通过运行和查看SHELL文件内容,很容易掌握各命令的使用方法。

希望大家不要错过里面的精彩内容。

对于地震处理来说,从来都是跟数据打交道的,只有把数据格式弄好了,才可以进行下一步处理,因此我今天就把数据转换和道头编辑方法,简单的说明一下。

一、标准SEG-Y读取(segyread)
标准SEGY读取相对比较简单,可以使用 segyread 把标准SEGY数据转换为su格式数据。

具体内容看 segyread的说明
segyread tape="*.sgy" verbose=1 endian=1 conv=0 > *.su
一般这四个参数就够了,需要注意的是在工作站上 endian=1 ,如果你用的是微
机 endian=0 。

tape后面可以跟文件路径,如 tape="/home/user/*.sgy" 。

二、seg 格式转换为 su 格式
实际中经常遇到的数据可能是 seg 格式的,这也不要紧,使用以下方法可以解决: segyread tape="*.seg" verbose=1 endian=0 conv=0 > *.su
关键就在于 endian=0 。

三、纯数据文件转换为SU格式 ( suaddhead )
在实际模拟计算中,我们大多生成一个纯数据文件,没有任何道头信息,为了在SU中进行处理,我们必须加上SU道头:
假设数据文件名为 a.dat,时间采样点 nt=3000.
suaddhead <a.dat >a.su ns=3000
然后就可以用suedit a.su 查看道头信息了
如果还想增加其他道头信息,就是用 sushw 命令修改道头。

详细信息参见sushw 使用说明。

关于数据转换暂且说到这里,大家如有什么问题,可以发帖咨询。

相关文档
最新文档