next up previous 264
Next: Building ADAM Applications that Use AST
Up: Compiling and Linking Software that Uses AST
Previous: Accessing AST Include Files


Linking with AST Facilities

Fortran programs may be linked with AST by including execution of the command ``ast_link'' on the compiler command line. Thus, to compile and link a program called ``prog'', the following might be used:

f77 prog.f -L/star/lib `ast_link` -o prog

On Linux systems you should usually use g77 -fno-second-underscore in place of f77 - see ``Software development on Linux'' in SUN/212.

Note the use of backward quote characters, which cause the ``ast_link'' command to be executed and its result substituted into the compiler command. An alternative is to save the output from ``ast_link'' in (say) a shell variable and use this instead. You may find this a little faster if you are building software repeatedly during development.

Programs which use AST can also be linked in a number of other ways, depending on the facilities they require. In the example above, we have used the default method which assumes that the program will not be generating graphical output, so that no graphics libraries need be linked. If you need other facilities, then various switches can be applied to the ``ast_link'' command in order to control the linking process.

For example, if you were producing graphical output using the PGPLOT graphics package, you could link with the AST/PGPLOT interface by using the ``$-$pgplot'' switch with ``ast_link'', as follows:35

f77 prog.f -L/star/lib `ast_link -pgplot` -o prog

again using g77 -fno-second-underscore in place of f77 on Linux systems.

See the ``ast_link'' command description in [*] for details of the options available.


next up previous 264
Next: Building ADAM Applications that Use AST
Up: Compiling and Linking Software that Uses AST
Previous: Accessing AST Include Files

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

Copyright (C) 2009 Science \& Technology Facilities Council