Batch Compiler

About Batch Compiler

OmniMark Batch Compiler is a compiler for the OmniMark programming language. It is used to generate compiled programs that can be run using OmniMark Concurrent Processing Engine or OmniMark Single Processing Engine. Compiled OmniMark programs can be run on any supported platform.

OmniMark Batch Compiler will notify you when compilation has failed.

Installing and Configuring OmniMark on Windows

On a Windows machine, you install OmniMark by running the OmniMark installer. You will be guided through the installation and licensing process.

You configure your copy of OmniMark by choosing from the options in the installation program. To change your configuration, re-run the installation program at any later time: you will be presented with the option of modifying your installation.

Include Files and Modules on Windows

OmniMark ships with a number of include (.xin) files, and modules .xmd. Your OmniMark programs can call the functions defined in these files. You can also write your own include files and modules, or obtain them from third parties. If you run OmniMark programs from source, OmniMark must be able to locate these files. When you install OmniMark on Windows, the installer records in the Windows registry the location of the include files. OmniMark can find these automatically. You can prevent OmniMark from searching the directories named in the registry with the -noenvargs or -noea command line option. If you want a specific OmniMark program to use a different set of include files or modules, you can specify their location using the -i command line option.

When searching for include files and modules, OmniMark searches in the following order:

  1. the current directory,
  2. paths specified on the OmniMark command line, and
  3. paths specified in the Windows registry.

Installing and Configuring OmniMark on UNIX

On a UNIX machine, you install OmniMark by untarring the files into a suitable directory. Once OmniMark is installed, you must license it. To license your copy of OmniMark you must request an authorization key from Stilo.

Licensing OmniMark Batch Compiler on UNIX

To receive and install your license key, begin by running OmniMark Batch Compiler with the -reqkeygen command-line option with the following arguments:

  1. the serial number you received when you purchased OmniMark,
  2. the email address you want the license key sent to, and
  3. a string of your choice that will let you identify the license key you will receive; this is useful if you are licensing several copies of OmniMark at once.
  4. the number of the port you select for Batch Compiler to use; we recommend a number not less than 32000.

Capture the output in a file. For example, suppose that your serial number is SN-Yy3X-ptdi-gpa-u[4, the selected port number is 40999 and you want to save the request key in the file req.txt:

  ombc -log req.txt -reqkeygen "SN-Yy3X-ptdi-gpa-u[4" [email protected] "Machine Sol23" 40999

OmniMark Batch Compiler will generate a request key and write it to the specified file. Email the contents of req.txt in the body of a plain text email to [email protected]. You will receive an authorization key by return email.

Create an environment variable called OMNIMARK_INFO and give it the value AUTH: followed by your authorization key. If you already have an OMNIMARK_INFO environment variable, you can add your new key to the end of the existing key using a semi-colon as a separator. For details on setting environment variables, consult the documentation for your shell or contact your system administrator.

Include Files and Modules on UNIX

OmniMark ships with a number of include (.xin) files, and modules .xmd. Your OmniMark programs can call functions in these files. You can also write your own include files and modules, or obtain them from third parties. If you run OmniMark programs from source, OmniMark must be able to locate these files. When you install OmniMark on a UNIX system, directories containing the include files and modules are not located automatically. You must do one of the following:

  • set the OMNIMARK_INCLUDE environment variable, or
  • use the -i command-line option.

When setting the OMNIMARK_INCLUDE variable under UNIX, paths should be separated by a colon. For details on setting environment variables, consult the documentation for your shell or contact your system administrator. You can prevent OmniMark from searching the directories named in the environment using the -noenvargs (or -noea) command line option. If you want a specific OmniMark program to use a different set of include files or modules, you can specify their location on the command line using the -i command line option.

When searching for include files and modules, OmniMark searches in the following order:

  1. the current directory,
  2. paths specified on the OmniMark command line, and
  3. paths specified in environment variables.

Running OmniMark Batch Compiler

To compile an OmniMark program on Windows start a Command Prompt window by selecting Command Prompt from the Start Menu; on UNIX, bring up a shell prompt.

To compile OmniMark programs,

  1. write and debug your program, and
  2. compile the program using the -s command-line option to specify the source file, and the -save command-line option to specify the filename of the compiled output.

Using arguments files

You can combine several command line options into a file called an arguments file. You then name the arguments file on the OmniMark Batch Compiler command line using the -f command-line option. The command-line options in the arguments file will be read as if they had been entered on the command line. Arguments files are usually given the extension .xar. The following command line compiles the program program.xom and reads command line options from the file arguments.xar.

  ombc -s program.xom -f arguments.xar

If you place the -s argument into an arguments file, you can start OmniMark Batch Compiler using an arguments file alone. The following command line causes OmniMark Batch Compiler to read options, including the -s option, from the arguments file program.xar.

  ombc -f program.xar

When you create an arguments file, you should place command line arguments one per line, like this:

  #!/usr/bin/ombc -f
  -s program.xom
  -save program.xvc
  -i /opt/OmniMark/xin/
          

You can include the #! directive in an arguments file. It will be interpreted appropriately on a UNIX system and will generally be ignored on a Windows system. If used, the #! line must contain the -f command-line option, which causes OmniMark Batch Compiler to read the arguments file.

You may include command line arguments meant for the OmniMark program as well as OmniMark Batch Compiler arguments in an arguments file. Additionally, you can load one arguments file from inside another arguments file.

Command-line options

The command-line options for OmniMark Batch Compiler are listed below. Many command-line options have short forms.

Compiling OmniMark programs

To compile an OmniMark program, specify the source file name using the -s command-line option, and the name of the compiled output using the -save command-line option:

  -s sourcefile.xom -save sourcefile.xvc
The -s command-line option can also be written -source or -src.

You can specify the OmniMark program directly on the console (stdin) using the -term command-line option.

The identification banner can be suppressed using the -brief command-line option.

Specifying arguments files

To specify an arguments file that is to be read as part of the command line, use

  -f testprogram.xar
The -f command-line option can also be written -argsfile.

Generating function traces

To generate a function trace when the program is executed, compile the program using the -ftrace command-line option.

Locating include files and modules

To specify a path to include files or modules, use

  -i path
The -i command-line option can also be written -include.

To force OmniMark to ignore include paths specified in environment variables and Windows registry entries, use

  -noenvargs
The -noenvargs command-line option can also be written -noea.

Information and logging

The -log command-line option is used to specify a file to which OmniMark will write log messages generated by the OmniMark program:

  -log testprogram.log
To append to the log file instead of overwriting its contents, use the -alog command-line option:
  -alog testprogram.log

To add program execution statistics, including memory usage and execution times, to the log, use

  -stats

You can find out which version of OmniMark you are using the -version command-line option.

To display the authorization key for OmniMark, or to view diagnostic information in the case of an authorization failure, use the -authkey command-line option.

Generating a license request key (port locking)

To generate a licence request key, use the -reqkeygen command-line option, providing it with a serial number, an email address, an identifying string, and a port number. For example,

  -reqkeygen "SN-Yy3X-ptdi-gpa-u[4" [email protected] "Machine Sol23" 40999
The output goes to the log stream. It can be captured using the -log command-line option; however, in this case the -log command-line option must appear before the -reqkeygen.

Prerequisite Concepts