The following aliases will be useful, they should be added to your $HOME/.cshrc file.
alias for f77 -c -u -static !* alias ford f77 -c -u -g -static !* alias forO2 f77 -c -u -static -O2 !*for does normal compilation
The -u option is like specifying IMPLICIT NONE in your code. Some programs that you might have (particularly those from theorists) don't use IMPLICIT NONE. You will then get lots of compliation errors so you will need to compile without the -u option.
Very often you will want to use the CERN libraries in your program. These are
obtained with setup cern which gives you the current version. Other
versions may also be available. You can find a list with ups list -a
cern.
The libraries live in $CERN_DIR/lib. The commonly used ones are libpacklib.a
(contains hbook), libkernlib.a and libmathlib.a.
Here is an example script link_norm to compile a program called norm.f that uses CERN libraries
Normal compilation/linking
#!/bin/csh setup cern for norm.f f77 -o norm.exe norm.o $CERN_DIR/lib/libpacklib.a \ $CERN_DIR/lib/libkernlib.a \ $CERN_DIR/lib/libmathlib.a $CERN_DIR/lib/libpacklib.aDebug Compilation/linking
#!/bin/csh setup cern ford norm.f f77 -o norm.exe norm.o $CERN_DIR/lib/libpacklib.a \ $CERN_DIR/lib/libkernlib.a \ $CERN_DIR/lib/libmathlib.a $CERN_DIR/lib/libpacklib.a -gO2 compilation/linking
#!/bin/csh setup cern forO2 norm.f f77 -o norm.exe norm.o $CERN_DIR/lib/libpacklib.a \ $CERN_DIR/lib/libkernlib.a \ $CERN_DIR/lib/libmathlib.a $CERN_DIR/lib/libpacklib.a -O2For more complicated programs the make utility can be used to maintain the program. Please consult the "UNIX at Fermilab" guide for information about this topic.