Introduction to the Unix Cluster. Node: Compiling

PREV Directories UP Commands NEXT Printing


UNIX programmers generally use C as their main language, but Fortran seems to be the perennial favorite at the lab. UNIX compilers are also used as linkers (except on the Crays), so there is usually no need to explicitly call the loader (ld).

The general format for compiling and linking two modules is as follows (using fortran code as an example):

        [lyman|6] f77 -c file1.f
        [lyman|7] f77 -c file2.f
        [lyman|8] f77 -o outfile file1.o file2.o

The option c means `compile, don't link', and the option o links and specifies the name of the executable file (in this case `outfile'). To execute the program, just type its name: outfile. To run the optimizer use option O, to keep debugging information use option g (except on the Crays).

The following is a listing of some of the options we have available for working with code:

PREV Directories UP Commands NEXT Printing