Table of Contents
E) Compiling the "3dma" executable
A) Distribution Contents
The 3DMA_Rock distribution comes as a Unix gzip'd, tar'd file
containing the following directory structure.
As we frequently find ourselves with several versions of the
3DMA-Rock executables present, compiled for different Unix
architectures, we have adopted the convention that the names of
executables involved with running the 3DMA-Rock code have an
architecture identifying string appended. The string to be appended
can be chosen by the user; we employ obvious choices such as "sun",
"sgi", "irix", "lnx". For purposes of this discussion, we shall
use the string "lnx".
The affected executables are:
The 3DMA-Rock code consists of the main executable, "3dma_lnx",
which executes command-line strings. (See further discussion in
the primers:
http://www.ams.sunysb.edu/~lindquis/3dma/3dma_rock/3dma_rock_03_primer/primer.html)
or
http://www.ams.sunysb.edu/~lindquis/3dma/3dma_rock/3dma_rock_04_primer/primer.html)
Before these executables can be run, some associated executables in
"/nfs/3dma_rock/bin" must be constructed.
% cd /nfs/3dma_rock/bin/src_jgraph
To compile and run the 3DMA-Rock code executables, the "path"
environmental variable must list the directory "/nfs/3dma_rock/bin".
The syntax for setting your path is slightly dependent on which shell you are
using
(shell type can be checked by typing 'echo $shell')
For tcsh or csh:
For bash:
E1) Makefile changes:
Edit the file "/nfs/3dma_rock/src/makefile" and check the macro
definitions on lines 1 through 64.
The string "ARCH" must be set to the architecture identifying string
chosen in section B) Prelimary Note.
Significant changes were made to the Gnu C++ compiler starting with
the RedHat8.0 release. The "3dma" source code has been updated to
reflect these changes. If the machine on which "3dma" will be compiled
is running RedHat8.0 or higher, no changes to the code are necessary.
For RedHat7.0 and below, you can still compile and run the "3dma"
executable. All C++ changes occured in the "seg_krig" and "fluids"
directories.
For backwards compatibility, there is a "seg_krigRH6" directory and
a file "fluids/fld_seg_RH6.O.C" which contain the affected source code
for running "3dma" on RedHat7.X and below.
To exchange the source code so that "3dma" can be compiled on
RedHat7.X or below, execute the following commands:
E3) Changes for SUN Solaris OS:
The following changes have had to be made when compiling under SUN Solaris.
Solaris may not support the round-float-to-int system call rintf().
For version 3dma_rock.0304: The host/network byte order conversion macro
htonl() may require explicit inclusion of the include file
Use of the 'f77' FORTRAN compiler may not automatically link the FORTRAN 77
system calls pow_ri and r_sign.
E4) To compile the "3dma" executable:
Note the makefile uses the utility "/nfs/3dma_rock/bin/nar"
which provides modifications to the UNIX "ar" command.
Once you have built the "3dma_lnx" executable, the 3DMA-Rock code can
be run following the instructions in the primers
http://www.ams.sunysb.edu/~lindquis/3dma/3dma_rock/3dma_rock_03_primer/primer.html.
( return to table of contents)
( next section)
3dma_rock
bin src USER_AGREEMENT
For purposes of this discussion, we assumed the user installs the
distribution at the absolute address "/nfs/3dma_rock".
B) Preliminary Note
( prev section)
( return to table of contents)
( next section)
stripcomm_lnx
3dma_lnx
C) Associated executables
( prev section)
( return to table of contents)
( next section)
% cd /nfs/3dma_rock/bin
There are also the supporting executable shellscripts
% gcc stripcomm.c -o stripcomm_lnx
% make jgraph
% mv jgraph ..
% make clean
in "/nfs/3dma_rock/bin" which do not have to be compiled.
nar
differ
runcase
D) Environmental Variables
( prev section)
( return to table of contents)
( next section)
% set path=( $path /nfs/3dma_rock/bin )
% export PATH=$PATH:/nfs/3dma_rock/bin
These commands can be typed each time you login, however it is preferable
to add the command to the files .bashrc (for bash) or .cshrc (csh, tcsh) so
that the path is automatically set whenever the system executes a new shell
for you.
E) Compiling the "3dma" executable
( prev section)
( return to table of contents)
( next section)
ARCH = lnx
E2) For RedHat Linux 7.0 and below:
% cd /nfs/3dma_rock/src
% mv seg_krig seg_krigRH8
% mv seg_krigRH6 seg_krig
% cd /nfs/3dma_rock/src/fluids
% cp flg_seg_RH6.0.C fld_seg.C
Edit the file src/min_surf_wdg/preperim.c, and change the line 1434
to read
rd = rint((double)(max_d/min_d));
Make the same change in the file src/min_surf_wdg/wdg_throat_main.c,
line 900.
Edit src/arch.h. After line 5, add
#include < netinet/in.h >
Edit src/makefile. Change line 16 to
FC = g77
% cd /nfs/3dma_rock/src
% make 3dma >& makelog &
This will install the the executable "/nfs/3dma_rock/bin/3dma_lnx".
F) Testing the 3DMA-Rock executables
( prev section)
( return to table of contents)
or
http://www.ams.sunysb.edu/~lindquis/3dma/3dma_rock/3dma_rock_04_primer/primer.html.
This html file also explains how to perform an initial test by
downloading data into a Test directory.