Math 169
General Information about Compilers on Dell Server "math"
[Return to Math 169 Homepage |
Return to Supplement Listing Page]
Contents
NOTE: This page is intended to provide basic information as to how to
invoke the compilers/interpreters for the languages listed on
the Dell Server "math." Information contained below supercedes
corresponding information on the other language pages and contains
the major peculiarities of running languages on the Dell Server. Please
consult other pages for additional information.
- The version of Fortran available on the Dell server "math" is "gfortran."
Information can be obtained via
http://gcc.gnu.org/wiki/GFortran.
- Create a source code (program) file using an editor of your
choice (e.g., Emacs or VI). The extension should be
.f90 or .f95 which assumes the file is in "free source format" as
opposed to the older "fixed source format" (with certain components
limited to certain "columns").
If one uses the extension .f or .for the contents
are assumed to be in "fixed source format" even though the code may, in fact,
contain Fortran-90/95 structures/features.
- SPECIAL CHARACTERISTICS
- (Using Emacs) Proper indentation can be achieved by using the
<tab>. (In "fixed source format," if the first character in a
line is a number, this
number is assumed to be in "column 6" and is interpreted as a
continuation card symbol.) If the character after the <tab> is
not a number, it is
interpreted as a standard initial statement and indented appropriately.
- File i/o can be performed using the default files
fort.xx where xx is an appropriate
number (other than 5 or 6). E.g., one uses WRITE(21,102) or READ(53,105) to write
to or read from files fort.21 or fort.53. This will work
for all numbers between 1 and 99 except for 5 and 6 which
automatically write to the terminal screen.
- After the source code file is created, execution of the code
is via the standard Unix/Linux sequence of steps assuming the compiler
name is gfortran. E.g.,
gfortran mpfor.f95
a.out
Of course, standard Unix practice is to redirect the executable into
a file other than a.out and this is done, e.g., by
gfortran -o mpfor mpfor.f95
In this case, typing mpfor will run the program. To redirect
input and output (assuming 5 and 6 were used in READ and
WRITE statements), one uses the standard Unix file redirection,
namely:
mpfor < forinp > forout
- The version of Lisp available on the Dell server "math" is "gcl."
Information can be obtained via http://www.gnu.org/sofware/gcl/.
- Create a source code (program) file using an editor of your
choice (e.g., Emacs or VI). The extension should be
.lsp
- To exit, use (quit) or (bye).
- To recover from an error, use :q
- Information on the Icon programming language can be obtained via http://www.cs.arizona.edu/icon.
- Create a source code (program) file using an editor of your
choice (e.g., Emacs or VI). The extension should be
.icn
- You run the code by invoking icon and the sourcefile name
(with extention).
- The version of Cobol available on the Dell server "math" is "OpenCOBOL."
Information can be obtained via
http://www.opencobol.org/
- Create a source code file and use the extension .cob or
.COB
- One compiles the source file using cobc. If the source
file is in "free" format, one should compile using the -free
flag, e.g.,
cobc -free helloworld.cob
- The executable file will (by default) be in a file with the
same name as the source code and NO extension, e.g,
helloworld.
- Additional help can be obtained via cobc --help
- FILE-CONTROL subsection should be such as:
SELECT HELLO-OUT
ASSIGN TO "COBHELLO.OUT",
ORGANIZATION IS LINE SEQUENTIAL.
(the last line forces each read to start on a new line, after the
carriage return).
In the FILE SECTION no references to filenames are
given.
- To ensure that each output line does begin on a new line (with
correct Unix/Linux newline characters), one should use
WRITE OUTPUT-LINE AFTER ADVANCING 1 LINE.
for the output statements (to the output file).
- The version of MPI on "math" is MPICH2 -- see website at
http://www-unix.mcs.anl.gov/mpi/mpich2/
- In the .cshrc startup file, the path command should be
set path=( $path /usr/local/mpich2-install/bin . )
The corresponding line in .profile file for bash or sh users is
modified with a similar path.
- Before running any compiled MPI programs, one should invoke
mpd &
at the command prompt. This starts the default process manager for
MPICH2 (MPD = Multi-Purpose Daemon). (The process manager for Windows is SMPD.)
- Programs cannot be run with more than 3 "processes" or else they
will hang before the last output is printed.
- One may run a compiled MPI program using mpiexec -n rather than
mpirun -np
- To shutdown the MPD daemon processes, type mpdallexit before
logging off.
- To compile a program written in C++, use mpicxx followed
by the source file name. The header file to be included is mpi.h (in
double-quotes).
Because of a name-conflict, compile a file with an extra "switch" as follows:
mpicxx -DMPICH_IGNORE_CXX_SEEK -o filename filename.cc
My email address is
dsmolarski at scu.edu
This page last updated 19 October 2007.