Getting Started with NAG: Setting Up Your UNIX Account

The document NAG Fortran Library contains an overview of NAG and information on its use that should be read prior to reading this document.

Mark 16 of the NAG Fortran Library from Nag ltd. is installed in the directory /opt/lib/naglf16df. This installation directory will be referred to as $NAG_DIR throughout this document and others. It is important to note that NAG as well as language 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.

You must know the NAG installation directory to use the most current version of available on strauss and mahler. The long Fotran compile command is Rather than repeatedly issuing these and other commands to enable you to program using NAG, this document suggests a series of changes to your configuration files that accomplish the same objective.

This documentation assumes that your UNIX account's configuration ("dot") files match, or are based upon, the 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/setup
will 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.

Configuration changes to identify the NAG library location

Add the following lines to your ~/.localenv file:
# NAG Fortran Library
setenv NAG_DIR /opt/nag/aslir6/flso619da
if ! -d $NAG_DIR unsetenv NAG_DIR
These commands cause the NAG_DIR environment variable to be set properly each time you start a session on Strauss. Whenever a new version of NAG is installed, you will need to update these lines.

Configuration changes to define the UNIX environment for the NAG library

Creating some aliases (user-defined commands) in your ~/.localalias file will reduce the future typing needed to use NAG and find the example programs. Add the following lines to start a shell on Strauss which has all relevant environment variables set.
if $?NAG_DIR then
alias nagshell "(setenv NEED_NAG; newgrp \!*)"
else
alias nagshell echo "Nag not available on `uname -n`"
endif
if $?NEED_NAG then
setenv LINK_NAG "-L$NAG_DIR -lnag"
setenv LDLIBS "$LINK_NAG"
alias exampleList "ls -x $NAG_DIR/examples/source | sed '"'s/\.f//g'"'"
alias exampleGet 'cp $NAG_DIR/examples/source/\!*.f .'
alias exampleRun "./\!* < $NAG_DIR/examples/data/\!*.d && \rm \!*"
endif
The next time you log onto Strauss, you will be able to start a NAG-configured shell with the command
  nagshell
To 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 project
where project is your 4-digit group project number.

Configuration changes for X terminals and other X Windows servers

A work environment having multiple windows provides a more efficient and productive setting for programming with NAG. Use of any workstation functioning as an X Windows server will allow you to open several windows at once - a documentation window, an editor window and a compile/run window - to do your program development. This could be done on

Effective use of any of these X Windows servers requires you to further modify your UNIX configuration files. These changes are described in the document X Windows configuration setup for using NAG.

[Back to NAG home page]

Last modified: March 3, 2005
This page maintained by Dean Nairn
Copyright © University of Delaware, 2005.