Contents Previous Next Subchapters

Creating an O-Matrix Binary Pcode Distribution

This document outlines the procedure for creating an O-Matrix pcode file with the O-Matrix Development Kit for applications that are distributed with the O-Matrix Virtual Machine .

The source code used in the steps below is available in devkit\examples\OMS\SimpleOMX\.

  1. Build Your Application - Create your application using O-Matrix, e.g. \omwin\omwin.exe This example uses the sample "mycontour.oms" which creates a simple contour plot. Your application should be organized so that it can be invoked, or started with a single function call, MyContour() in this example
         function MyContour() begin
              z = {[1,2,3], [2,4,7], [3,7,14]}
  2. Compile Your Application - Compile your application by selecting 'File | Run' from the O-Matrix menu or including it such as
         include mycontour.oms
  3. Create a Binary Image - Use the O-Matrix save command, to create a binary image of your application
         save mycontour.omx
    Test your binary pcode file by entering
         load mycontour.omx
    at the O-Matrix command line. This will run the MyContour() function as defined in the mycontour.omx file without any reference to the original .OMS source file. Note that the version of O-Matrix that you use to create the pcode file must match the version number of the O-Matrix VM that is used to load the pcode file.
  4. Create a Startup File for Your Application - Your end users that are using the O-Matrix VM will need to start your application by providing a command line argument to O-Matrix. Create a startup file such as startmycontour.oms that contains
         load mycontour.omx
  5. Test Your Startup Files - You can test your application under your licensed copy of O-Matrix by copying the file mycontour.omx and startmycontour.oms to your O-Matrix home directory, e.g. \omwin. At the command line in a DOS box enter:
         omwin startmycontour.oms
    This will load your binary application file, run the MyContour() function and create the plot.
  6. Distributing your Application - You need to provide your end users with:
    1. The OMVMSetup.exe that is provided with your development kit distribution.
    2. The binary image of your application, e.g. mycontour.omx
    3. The startup file, e.g. startmycontour.oms
    4. Instruct your end users to install the O-Matrix Virtual Machine and then copy the OMS and OMX files to the installation directory and then run your application by entering
           omwin runmycontour.oms
      at a DOS box command line. (You can simplify the running of your application by providing a Windows shortcut that executes the above command.)
  7. Distributing your Application for Use with VM Application Launcher Alternatively you can distribute your application for use with vmlaunch , The O-Matrix Virtual Machine Application Launcher. The vmlaunch utility can be used by your end users for starting VM-based applications that are provided in source form or as pcode files.