24 COMPILING AND LINKING

 24.1 Standalone Applications
 24.2 ADAM Applications

In what follows, please note that the standalone and ADAM versions of the NDF_ library differ, in that those routines which use parameters (i.e. those listed in §C.14) are not available in the standalone version.

24.1 Standalone Applications

Standalone applications which use NDF_ routines may be linked by including execution of the command “ndf_link” on the compiler command line. Thus, to compile and link a Fortran application called “prog”, the following might be used:

     % f77 -I$STARLINK_DIR/include prog.f -L$STARLINK_DIR/lib ‘ndf_link‘ -o prog

while for an application written in C, you might use:

     % cc prog.c -I$STARLINK_DIR/include -L$STARLINK_DIR/lib ‘ndf_link‘ -o prog

Note the use of backward quote characters, which cause the “ndf_link” command to be executed and its result substituted into the compiler command.

24.2 ADAM Applications

Users of the ADAM programming environment (SG/4) should use the “alink” command (SUN/144) to compile and link applications, and can access the NDF_ library by including execution of the command “ndf_link_adam” on the command line, as follows:

     % alink adamprog.f ‘ndf_link_adam‘

Again, note the use of backward quote characters. To build a program written in C (instead of Fortran), simply name the source file “prog.c”, instead of “prog.f”.