There are three Fortran include files available for use with the Error Message Service: SAE_PAR
,
EMS_PAR
and EMS_ERR
(see Appendix E 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 installed in /star/include
for use in C code which is calling EMS – they
are named sae_par.h
, ems_par.h
and ems_err.h
. In addition, ems.h
contains the function prototypes
for each of the C functions. The syntax
should be used within the C code, and the compiler option -I/star/include
used when compiling C
and Fortran code.
The Error Message Service is included automatically when programs are linked using the ADAM
application linking commands, alink
etc.
To link a non-ADAM Fortran program with the the Error Message Service, the command line would be something like:
The command to compile and link a C program might be:
Note that the commands used to invoke the C and Fortran compilers vary from one UNIX implementation to another (indeed, there may be more than compiler of each type on the same machine).
If the C program makes no use of the EMS Fortran interface, the ‘ems_link‘
command may be
changed to ‘ems_link Conly‘
. This will avoid the linker looking for the Starlink CNF library, which
may not be present at a non-Starlink site.