Skip to content

Seismic Unix install on Ubuntu

John Stockwell edited this page Mar 15, 2016 · 1 revision

The following instructions have been tested on Ubuntu 11.10. They should apply to other similar systems with little to no modifications.

Table of Contents

Download SU from CWP website

In what follows Seismic Unix will be downloaded and installed into the current user's home directory. It is possible to install SU globally using ​​ if necessary. However, this is not recommended because iIt is possible to damage a system's file structure if the install is not done properly. First, download the compressed tar-ball and unpack it to the home directory.

mkdir -p ~/cwp/43R1
cd ~/cwp/43R1
wget ftp://ftp.cwp.mines.edu/pub/cwpcodes/cwp_su_all_43R1.tgz
tar -zxvf cwp_su_all_43R1.tgz

Add new variables to the shell environment

Add new path variables to the configuration file and make the new settings active. To do that, include the following two lines into the file using your favorite text editor such as emacs:

export CWPROOT=~/cwp/43R1
export PATH=$PATH:~/cwp/43R1/bin
or type in the terminal:
echo "export CWPROOT=~/cwp/43R1" >> ~/.bashrc
echo "export PATH=$PATH:~/cwp/43R1/bin" >> ~/.bashrc
Make the changes active by issuing a command
source ~/.bashrc

Edit the SU configuration file

Edit the file to agree with the needs of your system. It should suffice to simply comment out the parts that are for Solaris.

Here is an example for Ubuntu 11.10 contributed by Jose Colmenares. I have changed this to include XDR,
though Jose's original Makefile.config did not have SUXDR set.



#=======================================================================
#                 Makefile.config for Ubuntu 11.10
#=======================================================================
#-----------------------------------------------------------------------
# pick up the Make rules (Gnu make required)
#-----------------------------------------------------------------------

include $(CWPROOT)/src/Rules/gnumake.rules
include $(CWPROOT)/src/Rules/abbrev.rules
include $(CWPROOT)/src/Rules/cflags.rules
include $(CWPROOT)/src/Rules/suffix.rules
include $(CWPROOT)/src/Rules/misc.rules
include $(CWPROOT)/src/Rules/opengl.rules

#-----------------------------------------------------------------------
#                      CWP feature options
#-----------------------------------------------------------------------
#
# LINEHDRFLAG=SU_LINEHEADER  - adds 3200 byte text & 400 byte SEG-Y 
#                              style line headers to output. CWP/SU
#                              always reads either format unless SUXDR
#                              has been selected.


#
# XDRFLAG=-DSUXDR            - forces all SU data to be big endian
#                              independent of processor architecture
#
# LARGE_FILE_FLAG            - controls access to files > 2 GB on
#                              some systems.
#
# -DSLTSU_SEGY_H             - if defined selects SLT/SU trace header
#                              layout so both packages are compatible
#-----------------------------------------------------------------------

LINEHDRFLAG = 
XDRFLAG =  -DSUXDR
ENDIANFLAG = -DCWP_LITTLE_ENDIAN
LARGE_FILE_FLAG = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE

CWP_FLAGS = $(LARGE_FILE_FLAG) $(ENDIANFLAG) $(XDRFLAG) $(LINEHDRFLAG)

#-----------------------------------------------------------------------
# system stuff
#-----------------------------------------------------------------------


SHELL = /bin/sh
ROOT = $(CWPROOT)

LN = ln # this needs to be changed to cp for FAT32 filesystems
AR = ar
ARFLAGS = rv
RANLIB = ranlib
RANFLAGS = 
ICHMODLINE = chmod 644 $@
MCHMODLINE = chmod 755 $@

POSTLFLAGS = 

#-----------------------------------------------------------------------
# use both X11 path conventions
#-----------------------------------------------------------------------

IX11 = /usr/X11/include
LX11 = /usr/X11/lib
IMOTIF = /usr/X11R6/include
LMOTIF = /usr/X11R6/lib

LD_LIBRARY_PATH += $(CWPROOT)/lib:${LX11}:${LMOTIF}

#-----------------------------------------------------------------------

CPP = cpp

CC = gcc
OPTC = -g  -std=c99 -Wall -pedantic -Wno-long-long 
CFLAGS = -I$I $(OPTC) $(CWP_FLAGS) -D_BSD_SOURCE -D_POSIX_SOURCE

FC = gfortran
FOPTS = -g 
FFLAGS = $(FOPTS) -ffixed-line-length-none

C++FLAGS = -I$I $(OPTC) $(CWP_FLAGS)

Install the desired components

Install the basic set of codes

cd $CWPROOT/src
make install

Install the X-toolkit applications

make xtinstall
If you get an error that is missing, then you probably need to install X:
sudo apt-get install libx11-dev

If you get an error that is missing, then you need another library that can be installed with:

sudo apt-get install libxt-dev

Install the Fortran codes

First, install a Fortran compiler by either typing

sudo apt-get install gfortran
or by downloading it directly from the Ubuntu website.
make finstall

Install Mesa/Open GL (experimental)

make mglinstall
If you get the error saying that is missing then install it by typing
sudo apt-get install freeglut3-dev
If you get the errors
/usr/bin/ld: cannot find -lXmu
or
/usr/bin/ld: cannot find -lXi
be sure to install and with
sudo apt-get install libxmu-dev libxi-dev

Install (not essential)

make utils
If you get an error then try
sudo apt-get install libc6

Install Motif (not essential)

make xminstall
If you get the error of missing then check for dependencies first:
sudo apt-get update
sudo apt-get install libmotif4
sudo apt-get install libxt6
sudo apt-get install x11proto-print-dev
sudo apt-get install libmotif-dev

Install improved SEGDREAD

make sfinstall

Test the installation

Execute the following command in the terminal:

suplane | suximage title="My first test" &
If a figure appears then the installation has been done correctly.

Category:Linux