f77 main.f sub.f -o main.exe -L/opt/lib -lnagAnd for calling IMSL routines, the command is
f77 main.f sub.f -o main.exe -L/opt/lib -lsocket -lnsl -limslThe options "-lsocket" and "-lnsl" are required only for IMSL.
An alternative to using the "-L" compiler option is using the LD_LIBRARY_PATH environment variable. This is described below.
setenv LD_LIBRARY_PATH /opt/lib:${LD_LIBRARY_PATH}to your .localenv file. Then, the f77 command is
f77 main.f sub.f -o main.exe -lnagand in the case of accessing IMSL routines
f77 main.f sub.f -o main.exe -lsocket -lnsl -limslRather than typing in this long command you can define the following alias in your .localalias file:
alias f77imsl 'f77 \!* -o \!^:r.exe -limsl -lsocket -lnsl'Then you would type
f77imsl main.f sub.fYou must be using the current collection of startup files, "dotfiles", for this to work. The files .cshrc, .login, .localenv, and .alias are stored in the /opt/proto directory. Typing
~consult/proto/xsetupwill back up your current "dotfiles" and replace them with the /opt/proto versions. This is strongly recommended. Instructions are available on U-Discover!. Select the following entries: Computing & Technology/ Instructions, Tips and Answers/ UNIX/ Configuring Your Account.
***************************************************************** * * * Correspondence to VS FORTRAN * * * ***************************************************************** * * * VS FORTRAN UNIX * * ========== ==== * * * * Accessing NAG Library Routines * * ============================== * * * * * * global txtlib vsf2fort nagvlib * * fortvs2 main * * load main (start f77 main.f -o main.exe -L/opt/lib -lnag* * main.exe * * * * (See text for alternative methods.) * * * * * * * * Accessing IMSL Library Routines * * =============================== * * * * * * global txtlib vsf2fort imsl1 imsl2 * * fortvs2 main * * load main (start f77 main.f -o main.exe -L/opt/lib * * -lsocket -lnsl -limsl * * main.exe * * * * (See text for alternative methods.) * * * *****************************************************************