Mark 19 of the NAG Fortran Library from Nag Ltd. is installed in the directory /opt/nag/aslir6/flso619da. This installation directory will be referred to as $NAG_DIR throughout this document. Note that NAG and compilers are only available on Strauss, and not on Copland. The configuration changes to your UNIX account suggested in this document will only affect your computing environment when you are on Strauss.
This documentation assumes that your UNIX account's configuration ("dot") files are based on User Services' recommended configuration files: .cshrc, .login, .localalias, and .localenv. These files are found in the /opt/proto directory. Typing the UNIX command
~consult/proto/setupwill cause your current configuration files to be renamed (for backup purposes) and replaced with the standard configuration files. The system will display the names of the renamed and replacement files.
# NAG Fortran LibraryThese commands cause the NAG_DIR environment variable to be set properly each time you start a session on Strauss . When a new version of NAG is installed, you will need to update these lines.
setenv NAG_DIR /opt/nag/aslir6/flso619da
The next time you log onto Strauss, you will be able to start a NAG-configured shell with the command
alias nagshell "(setenv NEED_NAG; newgrp \!*)"
if $?NEED_NAG then
setenv FC f77
setenv FFLAGS "-dalign -xtarget=ultra -mt"
setenv LDLIBS "-L$NAG_DIR -lnag-spl -xlic_lib=sunperf -lsocket -lnsl -lintl"
alias exampleList "ls -x $NAG_DIR/examples/source"
alias exampleGet 'set nagex=`basename \!*`;\
cp $NAG_DIR/examples/*/${nagex}.* .;ls ${nagex}.*'
alias exampleRun "touch ${nagex}.d;cat ${nagex}.d* | ./${nagex}"
alias exampleCmp 'cmp - ${nagex}.r && echo "Program Results Match"'
alias exampleClean '\rm ${nagex}*'
endif
nagshellTo associate the new shell with a different group project id (e.g., a UNIX group assigned to a class), type the following command instead:
nagshell projectwhere project is your 4-digit group project number.
The comands in your ~/.localalias file between the if and the endif will only be executed when the NEED_NAG is set. These will set three environmental variables and five aliases just for the NAG-configured shell.
These three environment variables are the ones used by the make command to "make" an executable. Name your Fortran program with the suffix .f and type make basename using the base name (your file name without the suffix).
<99>% nagshell
<1>% echo $NAG_DIR
/opt/nag/aslir6/flso619da
<2>% exampleList | grep g11
g10cafe.f g10zafe.f g11aafe.f g11bafe.f g11bbfe.f g11bcfe.f g11cafe.f
g11safe.f g11sbfe.f g12aafe.f g12bafe.f g12zafe.f g13aafe.f g13abfe.f
<3>% exampleGet g11cafe
g11cafe.d g11cafe.f g11cafe.r
<4>% make g11cafe
f77 -dalign -xtarget=ultra -mt -o g11cafe g11cafe.f -L/opt/nag/aslir6/flso619da
-lnag-spl -xlic_lib=sunperf -lsocket -lnsl -lintl
g11cafe.f:
MAIN:
<5>% exampleRun
G11CAF Example Program Results
Deviance = 0.5475D+01
Strata No. Cases No. Controls
1 2 2
2 1 2
Parameter Estimate Standard Error
1 -0.5223 1.3901
2 -0.2674 0.8473
<6>% exampleRun | exampleCmp
Program Results Match
<7>% exampleClean
<8>% exit
exit
<100>%
Last modified: June 28, 2005
This page maintained by Dean Nairn
Copyright © University of Delaware, 2005.