4 Compiling and Linking Applications

 4.1 Compiling
 4.2 Linking on VMS
 4.3 Linking on UNIX

4.1 Compiling

On both VMS and UNIX systems, FORTRAN source code may include NBS error codes and NBS public constants using the symbolic names NBS_ERR and NBS_PAR respectively. On VMS these are logical names and UNIX the appropriate symbolic links can be made in your current directory by typing,

  % nbs_dev

These links can be deleted using nbs_dev remove if required.

The error codes are standard VMS ones and use facility number 1802. This number is one of the ones allocated to the AAO. See Appendix C for a list of the symbolic error codes.

4.2 Linking on VMS

NBS can be linked either in a stand-alone or ADAM fashion. The approriate link commands are,

  LINK program,NBS_LINK/OPT        ! Stand-alone
  
  ALINK program,NBS_LINK/OPT       ! ADAM version

The following LINK options file is used stand-alone,

  NBS_IMAGE/SHARE

and this one for linking with ADAM,

  NBS_IMAGE_ADAM/SHARE

If you are linking in lots of other sub-systems as well, you may need to incorporate these lines into your own options file (unfortunately, LINK options files cannot be nested).

4.3 Linking on UNIX

The linking process on UNIX is even simpler than that of VMS. To link against the stand-alone version simply append a ‘nbs_link‘ to the compiler or loader command line.

  % f77 program.f ‘nbs_link‘

Similarly for the ADAM version,

  % alink program.f ‘nbs_link_adam‘