There are five Fortran include files available for use with the Message and Error System: SAE_PAR, MSG_PAR, MSG_ERR, ERR_PAR and ERR_ERR. (See Appendix A for details of the symbolic constants which they define).
The Starlink convention is that the name in upper case with no path or extension is specified when including these files within Fortran code, e.g.
Equivalent header files are provided for use in C code which is calling MSG or ERR – all the required header files, including the function prototypes, may be included by including the file mers.h.
should be used within the C code.
Assuming that the software has been installed in the standard way and /star/bin has been added to the environment variable PATH, soft links with these upper-case names pointing to the required file are set up in the user’s working directory by the the commands:
The ADAM version of MSG/ERR is included automatically when programs are linked using the ADAM application linking commands, alink etc. These will handle either Fortran or C code.
To compile and link a non-ADAM program with the stand-alone version of MSG/ERR, the command line would be, e.g.
On platforms with shareable libraries,
-L/star/lib might be replaced by
If it is necessary to link explicitly with the ADAM version of MSG/ERR and any libraries which it uses (e.g. to produce a shareable library), the script err_link_adam is available in /star/bin. The link command might be:
The compilation of C code should be used with the compiler flag -I/star/include. For example the command to compile a C program might be:
Note that the command used to invoke the C compiler varies from one UNIX implementation to another (indeed, there may be more than one C compiler available on the same machine) – you should therefore check this with your Site Manager before proceeding.
Because the MERS C interface calls Fortran routines it is also necessary to explicitly link with the required Fortran libraries, e.g.
The naming and number of the Fortran libraries differs between UNIX machines and so it is advisable to check in the relevant Fortran documentation for further details.