Starting GT.M

To start GT.M from a POSIX shell:

  1. Execute gtm from your shell prompt:

    $ <path_to_gtm_installation_directory>/gtm 

To start GT.M in UTF-8 mode from a POSIX shell:

  1. First, set $gtm_chset to UTF-8 and LC_CTYPE or LC_ALL to any usable UTF-8 locale.

    $ export gtm_chset="UTF-8"
    $ export LC_CTYPE="en_US.utf8"
  2. Execute the gtm script.

    $ <path_to_gtm_installation_directory>/gtm 

To start GT.M from a C-type shell:

  1. First source the gtmschrc script to set up a default GT.M environment. At your shell prompt, type:

  2. $ source <path_to_gtm_installation_directory>/gtmcshrc 
  3. Run the gtm alias to start GT.M in direct mode.

    $ gtm 

To start GT.M in UTF-8 mode from a C-type shell:

  1. Set the environment variable gtm_chset to UTF-8 and LC_CTYPE or LC_ALL to any usable UTF-8 locale.

    $ setenv gtm_chset UTF-8
    $ setenv LC_CTYPE en_US.utf8 
  2. Source the gtmchrc script to set up default GT.M UTF-8 environment.

    $ source <path_to_gtm_installation_directory>/gtmcshrc 
  3. Run the gtm alias to start GT.M in direct mode.

    $ gtm

To start GT.M without using any script:

  1. Define gtm_dist, gtm_log, gtm_tmp, gtmgbldir, and gtmroutines. Ensure that gtm_dist points to the location of your GT.M distribution.

  2. Add gtm_dist to the system environment variable PATH.

  3. Ensure that you have set an appropriate value for TERM.

  4. Consider adding these environment variables in your login file so you do not have to create them again the next time you start your shell.

  5. Set the following aliases to run GT.M and its utlities.

    alias dse="$gtm_dist/dse"
    alias gde="$gtm_dist/mumps -run ^GDE" 
    alias gtm="$gtm_dist/mumps -direct" 
    alias lke="$gtm_dist/lke" 
    alias mupip="$gtm_dist/mupip" 
  6. Run the gtm alias to start GT.M in direct mode.

    $ gtm 

To start GT.M in UTF-8 mode without using any script:

  1. Define gtm_dist, gtm_log, gtmgbldir, and gtmroutines. Ensure that gtm_dist points to the uft8 subdirectory of your GT.M distribution.

  2. Set gtm_routines to include the utf8 subdirectory of your GT.M distribution. Note that the utf8 subdirectory includes all Unicode(R) support related GT.M functionality.

  3. Ensure that you have installed ICU 3.6 (or above) and have LC_CTYPE or LC_ALL set to a usable UTF-8 locale.

  4. Set LD_LIBRARY_PATH and TERM to appropriate values.

  5. If you have built ICU with symbol renaming enabled, set gtm_icu_version to an appropriate ICU version.

  6. Add gtm_dist to the system environment variable PATH.

  7. Set gtm_chset to UTF-8.

  8. Consider adding these environment variables in your login file so you do not have to create them again the next time you start your shell.

  9. Set the following aliases to run GT.M and its utilities.

    alias dse="$gtm_dist/dse"
    alias gde="$gtm_dist/mumps -run ^GDE"
    alias gtm="$gtm_dist/mumps -direct"
    alias lke="$gtm_dist/lke" 
    alias mupip="$gtm_dist/mupip"
  10. Type the following command to start GT.M in direct mode.

    $ gtm 
  11. At the GT.M prompt, type the following command.

    GTM>w $ZCHSET 
    UTF-8 ; the output confirms UTF-8 mode.
[Note] Note

If you are configuring a GT.M environment without using the gtmprofile script (or the gtm script which sources gtmprofile), bear in mind the following recommendation from FIS:

  • All GT.M processes should use the same settings for gtm_log and gtm_tmp, especially for production environments. This is because gtmsecshr inherits these values from whichever GT.M process first uses its services.

  • If there are multiple GT.M versions active on a system, FIS recommends different sets of gtm_log and gtm_tmp values for each version as using the same values for different distributions can cause significant performance issues.

GT.M has three invocation modes: compiler, direct, and auto-start. To invoke GT.M in these modes, provide the following arguments to the gtm script or the mumps command.

  1. -direct: Invokes GT.M in direct mode where you can enter M commands interactively.

  2. <list of M source files>: Invokes GT.M in compiler mode, invoke GT.M by entering a list of file names to compile as a argument. GT.M then compiles the specified programs into .o files. UNIX shell globbing to resolve wild-cards (* and ?) in names.

  3. -run ^routine_name: -r invokes GT.M in auto-start mode. The second argument is taken to be an M entryref, and that routine is automatically executed, bypassing direct mode. Depending on your shell, you may need to put the entryref in quotes.

When executing M programs, GT.M incrementally links any called programs. For example, the command GTM> do ^TEST links the object file TEST.o and executes it; if the TESTM program calls other M routines, those are automatically compiled and linked.

[Caution] Caution

When possible, GT.M verifies that MUMPS, MUPIP, DSE and LKE reside in $gtm_dist. If the path to the executable and the path to $gtm_dist do not match each executable issues an error. In cases where the executable path could not be determined, each executable defers issuing an error until it is required.