Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
128 views33 pages

Cps Install

Download as doc, pdf, or txt
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 33

INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.

30

Computer Programs in Seismology


Version 3.30

Installation Guide

R. B. Herrmann

28 November 2004

Revised 26 March 2006

1
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Installation of Computer Programs in


Seismology Version 3.30
R. B. Herrmann, rbh@eas.slu.edu
Table of Contents

1 Introduction..............................................................................4
1.1 CDROM distribution........................................................4

1.2 FTP install.......................................................................4

2 Installation on UNIX/Linux/MacOS–X........................................6
2.1 Compilers........................................................................6

Solaris..........................................................................6

Linux............................................................................6

MacOS–X....................................................................6

2.2 Getting the Programs......................................................6

FTP..............................................................................6

CDROM.......................................................................7

2.3 Installation of the Programs............................................7

2.4 Compiling........................................................................7

Changing PATH............................................................9

2.5 Documentation................................................................9

3 Installation on Windows using Cygwin......................................11


3.1 Getting Cygwin..............................................................11

WEB...........................................................................11

CDROM......................................................................11

3.2 Cygwin installation........................................................12

3.3 Modify the Cygwin environment....................................25

2
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Start Cygwin...............................................................25

Change the search order for X11 programs...............25

Modify the “/etc/passwd”............................................25

Modify your “.bash_profile”.........................................26

Set up your X11 environment.....................................26

Now start X11.............................................................26

3.4 Optional setup...............................................................29

3.5 Cygwin Help..................................................................29

3.6 Cygwin X11 Help...........................................................30

Keyboard...................................................................30

Copy/Paste................................................................30

Graphics....................................................................31

3.7 CYGWIN X11 and Windows XP Security......................31

3.8 Installation of Computer Programs in Seismology.........31

3.9 Documentation..............................................................32

3.10 SHELL scripts...............................................................32

3.11 Printing..........................................................................32

4 Ground Motion Regression.....................................................34

3
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

1 Introduction
This document describes the installation of Version 3.30 of the Computer Programs in
Seismology package created by R. B. Herrmann of Saint Louis University. This
installation has been tested for the Solaris operating system running on a Sun Sparc, on
Linux and Windows on PC platforms and on Apple’s MacOS–X system.

Installation Files
There are two ways of distributing this software – a special CDROM or Internet
download using ftp.

1.1 CDROM distribution


The CDROM contains the source code documentation for the software, the complete
CYGWIN package for use with Windows and precompiled binaries for some
architectures. The installation of the software under UNIX/LINUX and MacOS-X is
described in Section 3 of this document. The installation of CYGWIN and the compilation
of Computer Programs in Seismology for Windows is discussed in detail in Section 4.

In addition, the CDROM distribution has precompiled binaries for several operating
systems. If the CDROM drive is “D:”, these binaries are

D:/usr/cps330lnx.tgz – for LINUX


D:/usr/cps330osx.tgz – for MacOS-X
D:/usr/cps330cyg.tgz – for CYGWIN
D:/usr/cps330sol.tgz – for Solaris

To install any of these, use the command

gunzip –c cps330lnx.tgz | tar xf –

This will unpack the binaries and documentation into the directories

PROGRAMS.330/bin
PROGRAMS.330/DOC

The bin folder contains the executable binaries and shell scripts. The DOC folder is split
into sub-folders that contain tutorials in PDF format.

The binaries should work on the various systems. If they do not, unpack the file
NP330.tgz and compile everything following the instructions of Sections 3 or 4.

1.2 FTP install


The distribution is available for download after completing a registration form

4
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

http://www.eas.slu.edu/People/RBHerrmann/ComputerPrograms.html

This will lead you to the ftp area for download. You will be able to get the following

CPSInstall.doc - this document


CPSInstall.pdf - PDF form of this document
NP330.tgz - Computer Programs in Seismology distribution

Send email to me if you to try the binary distribution.

5
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

2 Installation on UNIX/Linux/MacOS–X

2.1 Compilers

Solaris
Either the Sun cc/f77 suite is required or the freely available gcc/g77 compilers.
Precompiled gcc/g77 binary executables of these compilers are available for free at the
site:

http://sunfreeware.com

Just select the version corresponding to your operating system and architecture. There
are also other interesting software packages there too.

Linux
You will need the gcc/g77 compilers and the X11 programming support files.

MacOS–X
You will require the gcc/g77 compilers. You will have to search the web for them. You
may have to do a Web search for the pattern ‘g77 Mac OSX’. One such link is

http://hpc.sourceforge.net

for high performance computing using Mac OS–X.

2.2 Getting the Programs

FTP
The most recent version of the Computer Programs in Seismology package will always
be available for ftp download from the site:

ftp://ftp.eas.slu.edu/pub/rbh/PROGRAMS.330

In this directory you will find files ending in “.Z” or “.tgz” which are compressed “tar” files
in either “compress” or “gzip” formats. The gzip’d files are smaller. You only require one
of the two formats.

6
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

CDROM
This is the distribution on this CDROM. The are stored in the directory/folder “ /usr” in
the file “NP330.tgz”

2.3 Installation of the Programs


The programs will be installed in a directory of your choosing. For example, if I place the
downloaded “.Z” or “.tgz” files in “/home/rbh”, then I would do the following:

“.Z” compressed files: Using sh, bash or csh shells:

sh or bash csh
for i in *.Z foreach i ( *.Z)
do zcat $i | tar xf –
zcat $i | tar xf – end
done

“.tgz” gzipped files: Using sh, bash or csh shells:

sh or bash csh
for i in *.tgz foreach i ( *.tgz)
do gunzip –c $i | tar xf –
gunzip –c $i | tar xf – end
done

Eventually you may remove the “.Z” or “.tgz” files to save space. You will not require
these any more.

2.4 Compiling
Note that in the example below “rbh>” is the shell prompt indicating that you are in the
“rbh” directory. If your directory name is different, the prompt will be different.
Commands for you to type are indicated in bold, such as “cd”.

First, go to the PROGRAMS.330 directory.

rbh> cd PROGRAMS.330 (go to the Programs directory)

7
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Then run the Setup program:

rbh> ./Setup (get correct syntax)


Checking for existence of bin and lib directories
Directory bin exists
Directory lib exists
Usage: Setup SOL WIN32 SOL-EGCS LINUX CYGWIN OSX
SOL SUN Solaris Compilers
SOL-EGCS SUN Solaris with gcc/g77 compilers
WIN32 WIN 95/98/NT/2K/XP gcc/g77 Compilers
CYGWIN CYGWIN 95/98/NT/2K/XP gcc/g77 Compilers
LINUX Linux with gcc/g77 compilers
OSX Apple Mac with gcc/g77 compilers
OSF DEC/Compaq ALPHA with f77/cc compilers
rbh> ./Setup LINUX (for my LINUX system – you will use your system
type. This command will define the Makefile to use for the system)
Checking for existence of bin and lib directories
Directory bin exists
Directory lib exists
Linux
Copying VOLI/src/Makefile.LNX VOLI/src/Makefile
Copying VOLII/src/Makefile.LNX VOLII/src/Makefile
Copying VOLIII/src/Makefile.LNX VOLIII/src/Makefile
Copying VOLIV/src/Makefile.LNX VOLIV/src/Makefile
Copying VOLV/src/Makefile.LNX VOLV/src/Makefile
Copying VOLVI/src/Makefile.LNX VOLVI/src/Makefile
Copying VOLVII/src/Makefile.LNX VOLVII/src/Makefile
Copying VOLVIII/src/Makefile.LNX VOLVIII/src/Makefile
Copying VOLVIII/gsac.src/Makefile.LNX VOLVIII/gsac.src/Makefile
Copying VOLIX/src/Makefile.LNX VOLIX/src/Makefile
Copying CALPLOT/src/cmd.unx/Makefile.LNX CALPLOT/src/cmd.unx/Makefile
Copying CALPLOT/src/clib.unx/Makefile.LNX CALPLOT/src/clib.unx/Makefile
Copying CALPLOT/src/flib.unx/Makefile.LNX CALPLOT/src/flib.unx/Makefile
Copying CALPLOT/src/util/Makefile.LNX CALPLOT/src/util/Makefile
Copying IRIS/rdseed4.5/Makefile.LNX IRIS/rdseed4.5/Makefile
Copying IRIS/DOCOMPILE.LNX IRIS/DOCOMPILE
Copying CALPLOT/src/XVIG/src/Makefile.LNX CALPLOT/src/XVIG/src/Makefile
Copying CALPLOT/testf/Makefile.LNX CALPLOT/testf/Makefile
Copying CALPLOT/testc/Makefile.LNX CALPLOT/testc/Makefile
Copying CALPLOT/Utility/Makefile.LNX CALPLOT/Utility/Makefile
The proper Makefiles have been installed for your Operating System
Verify that these are correct with respect to compilers, flags
and libraries
If everything is correct, enter the command

./C (for the complete distribution or)


./Ccal (for just CALPLOT)
to “make” everything.

When the compilation is done, the executables will be in the “ /bin” directory and the
libraries in “/lib”.

8
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Changing PATH
In order to use the programs you must change the PATH environment parameter. First
determine the name of the SHELL that you are using.

rbh> echo $SHELL


You will see something like “/bin/sh”, “/bin/bash” or “/bin/csh”. To change the PATH we
must edit a file in your login directory. For discussion, let the login directory be
“/home/rbh”. In the bash or c-shell, the tilde, “~”, is an alias to indicate this login
directory. Do the following for the appropriate shell. Recall that the Programs are
installed in “/home/rbh/PROGRAMS.330” (where “/home/rbh” will be different for your
computer).

/bin/sh

Edit “/home/rbh/.profile” to add the following lines after the last reference to PATH.

PATH=$PATH:/home/rbh/PROGRAMS.330/bin
export PATH
/bin/bash

Edit “/home/rbh/.bash_profile” or equivalently “~/.bash_profile” to add the following lines


after the last reference to PATH.

PATH=$PATH:/home/rbh/PROGRAMS.330/bin
export PATH
/bin/csh

Edit “/home/rbh/.cshrc” or equivalently “~/.cshrc” to add the following lines after the last
reference to PATH.

set path = ( ~/PROGRAMS.330/bin $path)


When you log onto the computer the next time, the PATH will be reset. You can see the
new PATH with the command

rbh> echo $PATH


You should now see “PROGRAMS.330/bin” in the PATH listing. As an added check, you
can ask the system to find a program, as in

rbh> which calxvig plotxvig surf96


~/PROGRAMS.330/bin/calxvig
~/PROGRAMS.330/bin/plotxvig
~/PROGRAMS.330/bin/surf96

2.5 Documentation
Documentation is in the directory DOC in both PDF and PS formats.

You are now ready to use Computer Programs in Seismology! Have Fun

9
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

3 Installation on Windows using Cygwin


The Windows distribution can be made directly from the CDROM. There are three steps
for a successful installation:

1. Installation of the Cygwin package

2. Modification of the Cygwin environment for the user

3. Installation of Computer Programs in Seismology

3.1 Getting Cygwin

WEB
Use the browser to go to the Cygwin website at http://www.cygwin.com.

Get the current version of setup.exe.

Start setup.exe from the control panel or from the run option of windows.

CDROM
Cygwin is on the CDROM in the “ usr” folder. For example if the CDROM drive is “D:”,
then you will want to run the program D:\usr\setup.exe. In the control panel, you need
only to click on the setup icon

10
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

3.2 Cygwin installation


Cygwin is a Linux-like environment for Windows. This set of instructions explains how to
use the provided Cygwin installation CD to install the software package Cygwin on your
Windows XP computer.

11
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

The first thing to do is to start the Cygwin Setup. You will see the following:

12
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

We now indicate the source of the installation: For the distribution CD, we will use “Install
from Local Directory”.

13
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Indicate the installation folder. The default of “C:\cygwin” is OK to use.

14
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

The program asks for the local package directory. If the CDROM is on the “D:” drive,
then modify the next screen to use “D:\usr\cygwin.dist”.

Cygwin will now provide a menu by which you can install everything or just part of the
distribution. To modify a selection, just click on the Default entry. If you click on the
Default entry under the upper level category All, then you will get the entire
distribution. This is the simplest way to install. If you do not have enough disk
space for the entire distribution, follow instructions below to select the minimum
necessary files.

15
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

The window list of categories looks like this.

16
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Open the category “Devel” by clicking on the “+” to the left of the name “Devel”.
A long list of all the packages in the Devel category will open.

17
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Scroll the window down until you see “gcc” in the Package column.
Select the “gcc” package for installation by single clicking next to the word “Skip” across
from “gcc”.
When properly selected for installation, it will display the version number of the gcc
package it will install.
Similarly, select the “gcc-g77” package for installation by clicking next to “Skip”.

18
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Scroll the window down some more until you see the package “gdb”.
Select the “gdb” package for installation by clicking the word “Skip” once to change the
display to the package version number.

19
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Scroll down farther until you see the package “make”.


Select the “make” package for installation.
Note that some other packages may be listed for installation already. Do not change
their installation status.

20
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Scroll the window down farther until the “Editors” category appears on the left.
Open the “Editors” category by clicking the “+” next to the category name.
Select the package “vim” for installation. If you wish a graphical editor, select “nedit.”
“ed” is useful for editing within shell scripts.

21
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Scroll farther down until you see the “X11” package.


Install the entire “X11” package by carefully clicking the word “Default” once.
Please wait after clicking for the system to change the status word to “Install”. It may
take a moment. If you click too much and the word “Install” doesn’t appear, please click
again until it does.
Once you see “Install” next to “X11”, then you are finished selecting packages.
Press “Next” to actually start the installation.

22
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

When the installation has finished, select “Finish” to exit the setup program.

The installation is now complete. Click “OK” to acknowledge.

A Cygwin icon will appear on the Desktop and in the Start menu Programs tab.

Note: The entire Cygwin package is available from the official Cygwin web page
http://www.cygwin.com. If you wish to add more programs or to update from the internet,
if you have a high speed connection, repeat the “setup” procedure.

23
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

3.3 Modify the Cygwin environment

Start Cygwin
At this point you should have a Cygwin icon on your desktop. Click this icon. A terminal
window will appear. We need to modify some startup information for Cygwin to allow it
to find all the programs we want to use.

Change the search order for X11 programs


We must do this to permit the program “GhostScript” to work properly.

Edit the file “/etc/profile” so that the search PATH has “/usr/X11R6/bin” first. This line at
the beginning of the file must look like:

PATH=”/usr/X11R6/bin:/usr/local/bin:/usr/bin:/bin:$PATH”
export PATH

Modify the “/etc/passwd”


Windows will typically attempt to place one in a named folder under
C:\Documents and Settings\Owner
If you log in as user “Owner”. The problem here are the spaces in the folder name. One
must be very careful with these spaces under the bash shell because spaces can only
be used if they are quoted. There are two ways to handle this.

The simplest is to edit the file /etc/passwd. Look for the entry for you user name, e.g.,
mkh:unused_by_nt/2000/xp:1009:513:mkh,U-FARLEY\mkh,S-1-5-21-632854848-
2332866997-1805960406-1009:/cygdrive/c/Documents and Settings/mkh:/bin/bash
or something like this. Then enclose the PATH by double quotes:
mkh:unused_by_nt/2000/xp:1009:513:mkh,U-FARLEY\mkh,S-1-5-21-632854848-
2332866997-1805960406-1009:/cygdrive/c/”Documents and Settings”/mkh:/bin/bash

The other approach is to keep all CYGWIN stuff away from the normal WINDOWS files
by placing the user directly under the CYGWIN tree. This is done by ensuring that the
user HOME directory is located directly under the CYGWIN installation, specifically that
there be a
/home/Owner
directory. If /home or /home/Owner do not exist when you log in, create it using the
command
mkdir /home

24
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

mkdir /home/Owner
Now modify the Owner entry in /etc/passwd to read as
Guest:unused_by_nt/2000/xp:501:513:U-FARLEY\Guest,S-1-5-21-632854848-
2332866997-1805960406-501:/home/Guest:/bin/bash
mkh:unused_by_nt/2000/xp:1009:513:mkh,U-FARLEY\mkh,S-1-5-21-632854848-
2332866997-1805960406-1009:/home/mkh:/bin/bash
Owner:unused_by_nt/2000/xp:1003:513:rbh,U-FARLEY\Owner,S-1-5-21-632854848-
2332866997-1805960406-1003:/home/Owner:/bin/bash
You only have to worry about the bold faced name fo the login directory. Note that there
are no spaces.
Now exit by typing exit and then restart the CYGWIN program.

Modify your “.bash_profile”


You will need a way to find the programs that is independent of the system’s idea.
Change directory to your login directory by entering the command “ cd” to get to your
login directory.

cd
Now edit the “.bash_profile” file there so that it looks like the following:

export PATH=$PATH:/cygdrive/c/usr/PROGRAMS.330/bin:

In this example, the PROGRAMS are installed on the C: drive in a folder called “ usr”.
Cygwin defines the Windows C: drive in a UNIX-like manner through the file path
“/cygdrive/c”. To see the Cygwin view of the file system, enter the command “df”.

Set up your X11 environment


To get a useful X11 window system, do the following:

cd
cp /etc/X11/xinit/xinitrc .xinitrc
Now edit the “.xinitrc” file by commenting out the reference to the xterm command at the
end and invoking the “wmaker” window manager. The last line should look like:

wmaker
#exec xterm -sl 1000 -sb -rightbar -ms red -fg yellow -bg black -e /usr/bin/bash -l
which is obtained by commenting the xterm line with the “#” symbol and adding the
“wmaker” command.

25
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Now start X11

There are two choices here. Either you can start up the GNUstep window manager or
you can start just two terminal session without the clutter of an additional window
manager.

No Window Mananger:

This is the simplest to start. However to make it easier to use edit the following file:

/usr/X11R6/bin/startxwin.sh

Then find the line that starts with “xterm” and duplicate the line. This last lines of this
shell script should then appear as follows when you are done:

# Startup the X Server with the integrated Windows-based window manager.


# WARNING: Do not use 'xwinclip' in conjunction with the ``-clipboard''
# command-line parameter for XWin. Doing so would start two clipboard
# managers, which is never supposed to happen.

XWin -multiwindow -clipboard &

# Startup an xterm, using bash as the shell.

xterm -sl 1000 -sb -rightbar -ms red -fg yellow -bg black -e /usr/bin/bash -l &
xterm -sl 1000 -sb -rightbar -ms red -fg yellow -bg black -e /usr/bin/bash -l &

#
# Startup the twm window manager.
# WARNING: Do not use an external window manager in conjunction with
# the ``-multiwindow'' command-line parameter for XWin. Doing so
# would start two window managers, which is never supposed to happen.
#

# twm &

# Set a background color. Only needed when not using -multwindow for XWin.

# xsetroot -solid aquamarine4

# Return from sh.


exit

To start the X11 session from your first DOS command terminal, just enter the command

26
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

startxwin.sh &

Two “xterm” sessions will appear from which you can start any Computer Programs in
Seismology program, even one using X22 graphics.

GNUstep Session:

The other alternative is to just enter the command

xinit
The computer will spend some time copying window manager files to your login
directory. When the window manager starts, just hit the mouse buttons. You will see a
menu appear.

Now start an Xterm session. From one of the menu items you can start an xterm
terminal session. You can also exit or switch to another window. Not all of the menu
options are implemented.

At this point you can “ssh” to other computers if you have access to them. You can start
other programs from within the X11 environment:

27
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

3.4 Optional setup


The CDROM also contains the file rbhenv.tgz which has my versions of .bashrc
.bash_profile .xinitrc and the GNUStep directory. This will ensure that the Window
manager works well – it also implements my preference of moving a mouse cursor over
a window to raise it instead of clicking. To install this from the CDROM, do this under
CYGWIN

cd
cp D:/usr/rbhenv.tgz | tar xf –

if D: is the name of the CD drive used. Of course please examine these files. You will
see that I have implemented some simple aliases that you may wish to use.

3.5 Cygwin Help


Much information is provided with the distribution. From within a Cygwin terminal
window enter the command

28
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

cd /usr/share/doc
To answer specific questions go to the Cygwin website http://www.cygwin.com at which
you will find a link to a User's Guide under documentation.

Since the commands are those of Linux systems, a book on Linux or the bash shell
would be useful.

3.6 Cygwin X11 Help


The fine tuning of X11 is not simple because of the fact that the X11 distribution tries to
be as independent of Windows as possible. Many details of the installation are given at
the Cygwin/X home at http://x.cygwin.com.

The frequently asked questions (FAQ) at http://x.cygwin.com/docs/faq will be able to


assist you. The documentation is available in HTML, PDF, PS, RTF and TXT formats.

There are several important issues that must be addressed.

Keyboard
The bash shell uses certain characters: # ` ~ & % / \ { } | that may not be directly
available on non-US keyboards. Windows knows about your keyboard, but X11 does
not. This means that a symbol typed under Windows may not appear the same under
X11.

Copy/Paste
There may be times that you wish to copy text between Windows and X11. You will not
be able to copy graphics images though. Text copying can be done as follows:

You copy text to the clipboard in Windows with Ctrl+C. You then paste that in X11 with
either a middle mouse button click or via a menu in the current application (if it has a
Paste menu item).

You copy text in X11 by highlighting it and, optionally, clicking the Copy button in a menu
(if the application has a Copy menu item). Leave the text highlighted just to be sure. To
paste that text in Windows, press Ctrl+V.

The difficulty with this is that the lines of text files in Windows are terminated by a
carriage return (CR) and a line feed (LF), but by just a line feed (LF) in UNIX and the
way that we set up Cygwin. It is better to do the following:

On Windows, save the text as a text file under SAVE AS. Then from within Cygwin run
the command “dos2unix textfile”. This program replaces the CR LF combination by just
a LF.

On X11, save the text as a textfile and then run the command “unix2dos textfile”.

29
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

Graphics
The ImageMagick package (which requires GhostScript) permits conversion of graphics
formats. For example, the Computer Programs in Seismology package graphics
consists of a binary graphics metafile, which can be converted to Encapsulated
PostScript. If this CALPLOT file is called SHWMOD96.PLT, then I can create a portable
network graphics file (PNG) for insertion into MS Office documents or web pages using
the commands:

plotnps –F7 –W10 –EPS –K < SHWMOD96.PLT > SHWMOD96.eps


convert –trim SHWMOD96.eps SHWMOD96.png
The “–trim” flag eliminates any unnecessary white space.

3.7 CYGWIN X11 and Windows XP Security


With the recent security patch to Windows XP, any communication between the PC and
the outside world is now severely limited by default. This security concern affects the
initial operation of X11 programs, both those distributed as part of CYGWIN and the
Computer Programs in Seismology programs plotxvig, calxvig, do_mft and do_pom.
When these programs are run the first time, an XP interface appears. Select the option
that permits the use of these programs through DNS. This is necessary because X11
components inter-communicate using networking protocols.

In another instance, Norton Firewall software prohibited the use of ssh and scp. Either
turn the Norton Firewall off temporarily or learn enough to tell it that ssh and scp packets
can be transferred.

3.8 Installation of Computer Programs in Seismology


First, create a folder called “usr” on one of your drives or partitions. You can do this from
the Windows Control Panel or from within Cygwin. Do the following to place everything
on the C: drive

cd /cygdrive/c
mkdir usr
Now copy the distribution from the CD and unpack it. If the CDROM is on the D: drive
just drag or copy/paste “D:/usr/NP330.tgz” to the “usr” folder.

From the Cygwin terminal window,

cd /cygdrive/c/usr
gunzip –c NP330.tgz | tar xf –
This will create the folder PROGRAMS.330. To compile and install the programs we
follow the procedure similar to that for the UNIX/Linux/MacOS–X systems:

cd PROGRAMS.330
./Setup CYGWIN
./C

30
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

If your SHELL path is properly set, you will be able to do the following:

which plotxvig
To test the distribution, I would do the following.

cd PROGRAMS.330/CALPLOT/testc
plotxvig < PLTTST.1
This will draw a set of colored circles. Now try

make new
new
This test program uses the cursor and tests some of the CALPLOT library calls.

3.9 Documentation
To view the documentation you can use your Adobe acroread program or the Cygwin
“gv” to access the pdf files in the folders that end with “ .pdf” in Computer Programs in
Seismology. All documentation is within the PROGRAMS.330/DOC folder.

3.10 SHELL scripts


This comment applies primarily to user written shell scripts black under CYGWIN, but
may also apply to other operating systems.

In sh or bash shell scripts, it is often convenient to indicate the relative location of an


executable directory through the following sequence:

export PATH=:../bin:$PATH

On Windows machines, it is permissible to have a path component that looks like

:/cygdrive/c/Program Files/Common Files/Adaptec Shared/System

Note the blanks between Command and Files and between Adaptec and Shared. These
will cause the export command to fail. The remedy is to use the following in SHELL
scripts:

export PATH=:../bin:”$PATH”

The double quotes permit the original PATH variable to be used in its entirety.

3.11 Printing
Single page graphics plots in Computer Programs in Seismology are output in
encapsulated postscript using the commands

plotnps -F7 -W10 -EPS < calplot_binary_plot_file > plot.eps

31
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

The plot.eps can be converted to a png using the commands

convert -trim plot.eps plot.png

The PNG file plot.png can then be included in Powerpoint of MS Word files.

If it is necessary to print something, I would do the following. First create a PostScript file
using plotnps for CALPLOT graphics or a2ps for text files. Then go to the Windows Start
and select ghostgum/ghostview to open the EPS file and then to print. This is the
preferred way to print anything since Windows knows about attached printers.

The distribution CD includes a version fo GhostScript and GhostView. From My


Computer, go to the CD and then click on gs813w32.exe to install GhostScript and the
click on gsv46w32.exe to install GhostView. Use the suggested defaults for installation.

32
INSTALLATION OF COMPUTER PROGRAMS IN SEISMOLOGY – 3.30

4 Ground Motion Regression


This distribution also includes the file “gmproto.tgz.” To install this you must

rbh> mkdir GMPROTO

rbh> cd GMPROTO

rbh> gunzip –c ../gmproto.tgz | tar xvf –

This will create prototype directories for high frequency regression studies. For
information on the installation please read the DOC/Tutorial.pdf/gmdmot.pdf. You must
have PROGRAMS.330 already installed. You will run the script MAKELOCAL which will
place a copy of the programs and data directories for your data set. This type of
installation was chosen since we often use this same set of tools to study ground motion
data sets from different regions.

33

You might also like