Linking to the NAg libraries --- Static and Dynamic Linking

Source

Compilation on Cosmos

Use of /software/SUNWspro/bin/f90 (the default) leads to link errors. Use an alias to ensure you pick up the right compiler:

  alias f90='/software/SUNWspro_4.2/bin/f90'
(Alternatively use Version 5 or 6 of the compiler and augment the compilation/linking command with -lF77 at the end.)


Static linking to the NAg library:

  f90 wrapper.f90 caller.f90 -lnag


Fully static linking:

  f90 -Bstatic -o nag_ex nag_example.f90 -lnag 


Dynamic linking:

  f90 -o quad quadratic.o /software/nag/naglib_f77_mark19/libnag.so.19