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.

    $ export gtm_chset="UTF-8"
  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>/gtmchrc 
  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 enviornment variable gtm_chset to UTF-8.

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

    $ source <path_to_gtm_installation_directory>/gtmchrc 
  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. If possible, add 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-related GT.M functionality. Type a command like the following:

    $ gtmroutines=". $gtm_dist `echo $gtm_dist | sed 's/utf8\(\/\)*//'`" 
  3. Ensure that you have installed ICU 3.6 (or above) and have set appropriate values for LC_CTYPE, LC_ALL, LD_LIBRARY_PATH, and TERM.

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

  4. Add gtm_dist to the system environment variable PATH.

  5. Set gtm_chset to UTF-8.

  6. If possible, add these environment variables in your login file so you do not have to create them again the next time you start your shell.

  7. 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"
  8. Type the following command to start GT.M in direct mode. 

    $ gtm 
  9. 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 wildcards (* and ?) are acceptable within the file 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 the shell being used, 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> d ^TEST links the object file TEST.o and executes it; if the TESTM program calls other M routines, those are automatically compiled and linked.