Programming

Compilers Available

  • FORTRAN
    • gfortran - GNU FORTRAN 95 compiler
    • g95 - FORTRAN 95 compiler
    • ifort - Intel FORTRAN compiler
  • C
    • gcc - GNU C compiler
    • icc - Intel C compiler
  • C++
    • g++ - GNU C++ compiler
    • icpc - Intel C++ compiler
  • Pascal
    • ppcx64 - free pascal compiler

Debuggers Available

  • gdb - GNU debugger
  • ddd - Data Display Debugger
  • idb - Intel Debugger

Using NAG Libraries

The usage of the NAG libraries in this department and the university in general is on the decline. After significant effort a new 3 year deal was taken out which runs until July 2017. This covers the use of the NAG libraries on the departmental Linux systems only.

NAG Matlab Toolbox

This is now part of our standard matlab install so no special procedure is needed anymore to use it.

You use the nag functions and routines in broadly the same way as you would within a FORTRAN programme, e.g.

a00aa - reports the version of the NAG library used
a00ac - returns 1 if a license is available
s07aa(x) - returns the value of tan(x)

NAG FORTRAN

Note as of version 23 NAG have merged the FORTRAN77 and FORTRAN90 library into a single library package.

There are two versions of the NAG FORTRAN library on the system.

Using GNU gfortran compiler

Using the gfortran compiler a typical compile command for FORTRAN77 code would be

gfortran -o myexec prog.f -lnag -lpthread -Wl,-rpath,/opt/nagfl/rtl

Using the gfortran compiler a typical compile command for FORTRAN90 code would be

gfortran -o myexec prog.f -lnag -lpthread -Wl,-rpath,/opt/nagfl/rtl -I/opt/nagfl/nag_interface_blocks/gfortran

Using Intel ifort compiler

Using the ifort compiler a typical compile command for FORTRAN77 code would be

ifort -o myexec prog.f -lnag_nag -lpthread -Wl,-rpath,/opt/nagfl/rtl -Wl,-rpath,/opt/nagfl/lib/ifort

Using the ifort compiler a typical compile command for FORTRAN90 code would be

ifort -o myexec prog.f -lnag_nag -lpthread -Wl,-rpath,/opt/nagfl/rtl -Wl,-rpath,/opt/nagfl/lib/ifort -I/opt/nagfl/nag_interface_blocks/ifort

To run the program you will need to first specify the license server, see below.

NAG C

Typical compile command would be

gcc -I/opt/nagcl/include -o myexec prog.c -lnagc -lm -lpthread

To run the program you will need to first specify the license server, see below.

Specifying the NAG license server

The binary produced from compiling checks for a valid NAG library license when run. To specify the license server:

  • setenv NAG_KUSARI_FILE licenses.maths.ox.ac.uk:7733
  • If you have an newer account using a bash shell:

    export NAG_KUSARI_FILE=licenses.maths.ox.ac.uk:7733

Running programs

Machines