ast_link

Link a program with the AST library

Description:

This command should be used when building programs which use the AST library, in order to generate the correct arguments to allow the compiler to link your program. The arguments generated are written to standard output but may be substituted into the compiler command line in the standard UNIX way using backward quotes (see below).

By default, it is assumed that you are building a stand-alone program which does not produce graphical output. However, switches are provided for linking other types of program.

Invocation

cc program.c -L/star/lib ‘ast_link [switches]‘ -o program

Examples:

cc display.c -L/star/lib ‘ast_link -pgplot‘ -o display
Compiles and links a C program called “display which uses the standard version of PGPLOT for graphical output.
cc plotit.c -L. -L/star/lib ‘ast_link -grf‘ -lgrf -o plotit
Compiles and links a C program “plotit . The “-grf switch indicates that graphical output will be delivered through a graphical interface which you have implemented yourself, which corresponds to the interface required by the current version of AST. Here, this interface is supplied by means of the “-lgrf library reference.
cc plotit.c -L. -L/star/lib ‘ast_link -grf_v2.0‘ -lgrf -o plotit
Compiles and links a C program “plotit . The “-grf_v2.0 switch indicates that graphical output will be delivered through a graphical interface which you have implemented yourself, which corresponds to the interface required by version 2.0 of AST. Here, this interface is supplied by means of the “-lgrf library reference.

Switches

The following switches may optionally be given to this command to modify its behaviour:

ERFA & PAL

The AST distribution includes bundled copies of the ERFA and PAL libraries. These will be used for fundamental positional astronomy calculations unless the " –with-external_pal" option was used when AST was configured. If " –with-external_pal" is used, this script will include " -lpal" in the returned list of linking options, and the user should then ensure that external copies of the PAL and ERFA libraries are available (ERFA functions are used within PAL).

CMINPACK

The AST distribution includes a bundled copy of the CMINPACK library. This will be used for various minimisation processes unless the " –with-external_cminpack" option was used when AST was configured. If " –with-external_cminpack" is used, this script will include " -lcminpack" in the returned list of linking options, and the user should then ensure that an external copy of the CMINPACK library is available.