Assuming all Starlink directories have been added to the environment variables PATH and LD_LIBRARY_PATH (see SUN/118), then to link a non-ADAM program with SNX and NCAR the command line would be:
% f77 program.o -L/star/lib `snx_link` -o program.out
This command line will link with the SNX, NCAR and SGS libraries.
Two subroutines provided by SNX exist in other forms elsewhere and require special handling. The first gives access to the special fonts provided by the NCAR routine PWRITX: it is a Starlink version of the NCAR subroutine AGPWRT. The second intercepts and changes the numeric labels produced by AUTOGRAPH, turning ``.1" and ``" into ``0.1" and ``" etc.: it is a Starlink version of the NCAR subroutine AGCHNL. These routines will be automatically linked by using `snx_link` if you have called the SNX routine SNX_AGOP. If you are using SNX routines as part of an NCAR/SGS mix, and have not called SNX_AGOP to initialise the graphics system, you must link with the objects directly:
% f77 program.o /star/lib/agpwritx.o /star/lib/agchnlz.o \ -L/star/lib `snx_link` -o program.out
(It is important to realise that the use of the special fonts will naturally incur a speed penalty. Advice on this is given in §.)
Compiling and linking ADAM applications is discussed in Appendix
SNX --- Starlink Extensions to the NCAR Graphics Utilities