[Santa Clara University]
Department of Mathematics
and Computer Science

Math 169

General Information about Compilers on Dell Server "math"

D. C. Smolarski, S.J.

[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.


Fortran

  1. The version of Fortran available on the Dell server "math" is "gfortran." Information can be obtained via http://gcc.gnu.org/wiki/GFortran.
  2. 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.

  3. SPECIAL CHARACTERISTICS
    1. (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.

    2. 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.

  4. 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
    

Lisp

  1. The version of Lisp available on the Dell server "math" is "gcl." Information can be obtained via http://www.gnu.org/sofware/gcl/.
  2. Create a source code (program) file using an editor of your choice (e.g., Emacs or VI). The extension should be .lsp
  3. To exit, use (quit) or (bye).
  4. To recover from an error, use :q

Icon

  1. Information on the Icon programming language can be obtained via http://www.cs.arizona.edu/icon.
  2. Create a source code (program) file using an editor of your choice (e.g., Emacs or VI). The extension should be .icn
  3. You run the code by invoking icon and the sourcefile name (with extention).

Cobol

  1. The version of Cobol available on the Dell server "math" is "OpenCOBOL." Information can be obtained via http://www.opencobol.org/
  2. Create a source code file and use the extension .cob or .COB
  3. 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
    
  4. The executable file will (by default) be in a file with the same name as the source code and NO extension, e.g, helloworld.
  5. Additional help can be obtained via cobc --help
  6. 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.

  7. 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).

MPI

  1. The version of MPI on "math" is MPICH2 -- see website at http://www-unix.mcs.anl.gov/mpi/mpich2/
  2. 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.
  3. 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.)
  4. Programs cannot be run with more than 3 "processes" or else they will hang before the last output is printed.
  5. One may run a compiled MPI program using mpiexec -n rather than mpirun -np
  6. To shutdown the MPD daemon processes, type mpdallexit before logging off.
  7. 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.