You can generate a listing file containing the compile results by including the -list qualifier as a modifier to the argument to the ZLINK command in Direct Mode. This can also be done by redirecting the compiler messages to a file by adding >filename 2>&1 to the mumps command when compiling a program from the shell. See “Compiling from the Shell” for an explanation of the M command describing -list, and other valid qualifiers for the M 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.
ZLINK compiles under these circumstances:
Auto-ZLINK compiles under the first two circumstances, but can never encounter the last one.
For complete descriptions of ZLINK and auto-ZLINK, see Chapter 6: “Commands” .
Example:
GTM>do ^payroll GTM>do ^taxes
This uses the M DO command to invoke the GT.M compiler implicitly from the GTM> prompt if the routine requires new object code. When the compiler runs, it produces two object module files, payroll.o and taxes.o.
If you receive error messages from the compilation, you may fix them immediately by returning to the editor and correcting the source. By default, the GT.M compiler operates in "compile-as-written" mode, and produces object code even when a routine contains syntax errors. This code includes all lines that are correct and all commands on a line with an error, up to the error. Therefore, you may decide to tailor the debugging cycle by running the program without removing the syntax errors.
![]() | Caution |
---|---|
The DO command does not add an edited routine to the current image if the image already includes a routine matching the DO argument routine name. When the image contains a routine, GT.M simply executes the routine without examining whether a more recent version of the module exists. If you have a routine in your image, and you wish to change it, you must explicitly ZLINK that routine. |
Example:
GTM>zlink "payroll" GTM>zlink "taxes.m"
The first ZLINK compiles payroll.m if it cannot locate payroll, or if it finds that payroll.m has a more recent date/time stamp than payroll.o. The second ZLINK always compiles taxes.m producing a new taxes.o.
For more information on debugging in GT.M Direct Mode, see Chapter 4: “Operating and Debugging in Direct Mode”.
From the shell, invoke the compiler by entering mumps file-name at the shell prompt.
$ mumps payroll.m $ mumps taxes.m
Use the mumps command at the shell prompt to:
The mumps command invokes the compiler to translate an M source file into object code.
The format for the MUMPS command is:
MUMPS [-qualifier[...]] pathname
Source programs typically have an extension of .m. GT.M accepts other file extenions for explicit compilation commands, but not for auto-ZLINK.
Each pathname identifies an M source program to compile. If you do not specify a .m file extension, the mumps command assumes the .m file extension.
Qualifiers determine characteristics of the compiler output.
Qualifiers must appear after the command, but before the file name to be properly applied.
GT.M allows the UNIX * and ? wildcards in a file name.
The MUMPS command returns a status of 1 after any error in compilation.
The * wildcard accepts any legal combination of numbers and characters including a null, in the position the wildcard holds.
The ? wildcard accepts exactly one legal character in its position.
For example, mumps *.m compiles all files in the current default directory with an .m extension. mumps *pay?.m compiles .m files with names that contain any characters followed by pay, followed by one character. Unlike when using ZLINK or ZCOMPILE, the filename must be fully specified when compiling from the shell.
![]() | Caution |
---|---|
When forming routine names, the compiler truncates object filenames to a maximum length of 31 characters. For example, for a source file called Adatabaseenginewithscalabilityproven.m the compiler generates an object file called Adatabaseenginewithscalabilityp.o. Ensure that the first 31 characters of source file names are unique. |
Invokes a small GT.M image that immediately initiates Direct Mode.
-direct_mode does not invoke the M compiler.
The -direct_mode qualifier is incompatible with a file specification and with all other qualifiers.
Controls the page length of the listing file.
The M compiler ignores the -length qualifier unless it appears with the -list qualifier.
![]() | Important |
---|---|
Both -DYNAMIC_LITERALS and -NOINLINE_LITERNALS help optimize performance and virtual memory usage for applications whose source code includes literals. As the scalability and performance from reduced per-process memory usage may or may not compensate for the incremental cost of dynamically loading and unloading the data structures, and as the performance of routines vs. inline code can be affected by the availability of routines in cache, FIS suggests benchmarking to determine the combination of qualifiers best suited to each workload. Note that applications can freely mix routines compiled with different combinations of qualifiers. |
Instructs the compiler to suppress error output; the default is -warning.
When used with the -list qualifier, the -nowarning qualifier does not affect errors in the listing.
![]() | Note |
---|---|
When used with the -noobject qualifier, the -nowarning qualifier instructs the compiler to produce no object with no indication of the fact or the cause of any errors. |