next up previous
Next: ast_link_adam - Link an ADAM program with the AST library
Up: UNIX Command Descriptions
Previous: ast_dev - Create links to AST include files

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 import.c -L/star/lib `ast_link -csla` -o import

Compiles and links a C program called ``import'' which does not produce any graphical output. The ``-csla'' flag indicates that the C version of SLALIB should be used by AST (to avoid conflict with the main program which may already be calling this version).

cc plotit.c -L. -L/star/lib `ast_link -mygrf` -lgrf_my -o plotit

Compiles and links a C program ``plotit''. The ``-mygrf'' switch indicates that graphical output will be delivered through a graphical interface which you have implemented yourself. Here, this interface is supplied by means of the ``-lgrf_my'' library reference.

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

  • ``-csla'': Requests that the program be linked so that it uses the C implementation of the SLALIB positional astronomy library. By default, the Fortran implementation is used (Starlink User Note SUN/67). Note that both implementations of SLALIB use the same name (``libsla.a'') for their library, so you must ensure that the directories searched to resolve library references will result in the correct version of this file (Fortran or C) being located.
  • ``-ems'': Requests that the program be linked so that error messages produced by the AST library are delivered via the Starlink EMS (Error Message Service) library (Starlink System Note SSN/4). By default, error messages are simply written to standard error.
  • ``-myerr'': Requests that no arguments be generated to specify how error messages produced by the AST library should be delivered. You should use this option only if you have implemented an interface to a new error delivery system yourself and wish to provide your own arguments for linking with it.
  • ``-mygrf'': Requests that no arguments be generated to specify which graphics system is used to display output from the AST library. You should use this option only if you have implemented an interface to a new graphics system yourself and wish to provide your own arguments for linking with it.
  • ``-pgp'': Requests that the program be linked so that graphical output from the AST library is displayed via the Starlink version of the PGPLOT graphics package (which uses GKS for its output). By default, no graphics package is linked and this will result in an error at run time if AST routines are invoked that attempt to generate graphical output.
  • ``-pgplot'': Requests that the program be linked so that graphical output from the AST library is displayed via the standard (or ``native'') version of the PGPLOT graphics package. By default, no graphics package is linked and this will result in an error at run time if AST routines are invoked that attempt to generate graphical output.



next up previous
Next: ast_link_adam - Link an ADAM program with the AST library
Up: UNIX Command Descriptions
Previous: ast_dev - Create links to AST include files

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2003 Central Laboratory of the Research Councils