Compiling a Source Program

Compiling from GT.M
Compiling from DCL
Qualifiers for the MUMPS Command

If you wish to focus on program development outside the GT.M environment, skip the next section and continue with the section "Compiling from DCL".

GT.M compiles M source code files and produces object files for complete integration into the VMS environment consisting of VMS standard object language. The object modules have the same name as the compiled M source file with a .OBJ file extension, unless otherwise specified. The VMS standard object language contains machine instructions and information necessary to connect the routine with other routines, and map it into memory. An M routine source file must be compiled after it is created or modified. Within GT.M, you can compile explicitly with the ZLINK or ZCOMPILE commands, or implicitly with auto-ZLINK. At the DCL command line, compile by issuing the MUMPS command.

The compiler checks M code for syntax errors and displays error messages on the terminal, when processing is complete. Each error message provides the source line in error with an indicator pointing to the place on the line where the error is occurring. For a list and description of the compiler error messages, refer to the GT.M Message and Recovery Procedures Reference Manual.

You can also generate a listing file containing the results of the compile, by including the /LIST qualifier as a modifier to the argument to the ZLINK command in Direct Mode or on the MUMPS command when compiling from the DCL command line. The explanation of the MUMPS command in the section "Compiling from DCL" describes /LIST and other valid qualifiers for the MUMPS and ZLINK commands.

The compiler stops processing a routine line when it detects an error on that line. Under most conditions the compiler continues processing the remaining routine lines. This allows the compiler to produce a more complete error analysis of the routine and to generate code that may have valid executable paths. The compiler does not report multiple syntax errors on the same line. When it detects more than 127 syntax errors in a source file, the compiler ceases to process the file.