6 Compiling and linking

Before compiling applications which use the REF library on UNIX systems, you should normally “log in” for REF software development with the following shell command:

  % ref_dev

This will create links in your current working directory which refer to the REF include files. You may then refer to these files using their standard (upper case) names without having to know where they actually reside. These links will persist, but may be removed at any time, either explicitly or with the command:

  % ref_dev remove

If you do not “log in” in this way, then references to REF include files should be in lower case and must contain an absolute pathname identifying the Starlink include file directory, thus:

  INCLUDE ’/star/include/ref_par’

The former method is recommended.

Applications which use the ADAM programming environment (SG/4) may be linked with the REF library by specifying ‘ref_link_adam‘ on the appropriate command line. Thus, for instance, an ADAM A-task which calls REF routines might be linked as follows:

  % alink adamprog.f ‘ref_link_adam‘

(note the use of backward quote characters, which are required).

“Stand-alone” (i.e. non-ADAM) applications which use the REF library may be linked by specifying ‘ref_link‘ on the compiler command line. Thus, to compile and link a stand-alone application called ‘prog’, the following might be used:

  % f77 prog.f ‘ref_link‘ -o prog