Programming

Compilers Available

  • FORTRAN
    • gfortran - GNU FORTRAN 95 compiler
    • g95 - FORTRAN 95 compiler
    • ifort - Intel FORTRAN compiler - Linux PCs only
  • C
    • gcc - GNU C compiler
    • icc - Intel C compiler
  • C++
    • g++ - GNU C++ compiler
    • icpc - Intel C++ compiler
  • Pascal
    • ppc386 - free pascal compiler available on the Linux PCs only
    • p2c - pascal to C convert

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 2013. 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

There are two versions of the NAG FORTRAN77 library.

Using the ifort compiler a typical compile command would be

ifort -o myexec prog.f -lnag -lpthread

Using the gfortran compiler a typical compile command would be

gfortran -o myexec prog.f -lnag -lpthread

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

NAG FORTRAN 90

Typical compile command would be

ifort -I/opt/nagfl90/include -o myexec prog.f -lnagfl90 -lcrypt -lpthread

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