Compiling a Process Model

Problem

The Process Editor cannot compile a model.

Solution

  • Check Message Display – Check for errors in the Message Display; scrolling back several messages may provide additional information.
  • Check C Compiler Error Listing – Typically, C code entry errors will be detected by the C compiler, and Modeler will pop up cc_err and source code editing pads for error diagnosis. If these pads appear, focus on the first error listed in the cc_err pad. This error will be a standard C compiler error, so it can be interpreted as one would a normal C compilation error. If a line of text in the source code editing pad is highlighted, this line may be the cause of the error; however, the error may appear earlier in the code listing, causing a “domino effect” mis-interpretation of later code and a resulting error. Some of the code in the editing pad may appear unfamiliar; this is code generated by the process compiler (included in the Process Editor) based on the logic of the graphical state transition diagram. If such code is highlighted, it is very probable that an earlier syntax error is causing a “domino effect” parsing error. Similarly, if a blank line or brace is highlighted, look for syntax errors in the preceding lines.
  • Check Syntax – Common problems to check for in the code containing or preceding an error include: missing or extra syntax elements (parentheses, braces, semi-colons, commas, quotes or double-quotes, etc.), missing variable declarations, misspelling of variable or function names (including wrong case used), or an improper number of arguments to a Kernel Procedure.
  • Modify Process Model C Code – To fix a C code error, insert code modifications into the appropriate process model state executive or special block editing pads; do not enter code modifications into the popped-up C code listing or cc_err editing pads. When done with the diagnostic editing pads, dismiss them by clicking on the Close button.
  • Fix Initial Error and Recompile – After the initial error has been diagnosed, subsequent errors can be analyzed. However, due to the compounding nature of many C errors, it may be useful to fix only the first error and retry the compilation.
  • Scroll Entire Editing Pad – If no lines in the C code editing pad are highlighted, scroll the pad until the first source lines indicated by the cc_err editing pad are displayed (Modeler may have been unable to extract the line numbers from the errors).
  • Check op_admin/tmp Directory – If no diagnostic text editing pads appear, leave Modeler and change directories to the temporary file directory used by Modeler (<HOME>/op_admin/tmp). Look for the cc_err file, and if found, examine its contents. The C code text lines referenced within cc_err can be viewed in the process model C file (suffix “.pr.c”). This file can be located using the op_manfile utility. For more information, see “Program Descriptions” on page 143.
  • Check Available Memory – If no cc_err file is present, the compilation may have failed due to a shortage of memory. Contact your system administrator to determine how much memory remains available while you run Modeler. If less than 5 MB of virtual memory is available (i.e., less than “5000k”), there is a possibility that this is causing the problem. Consider increasing the amount of available virtual memory and/or workstation RAM.
  • Check for Missing C Compiler – Another possible cause of a missing cc_err file is a missing C compiler, due to a non-standard or stripped-down operating system environment. Compiler access can be verified by writing a small test C program and invoking the C compiler (“cc”) on it. If the compiler is missing, steps should be taken to procure and install this required software.
  • Compile Process Model with op_mko – This utility compiles process models in the same manner as modeler and op_runsim and therefore can provide more visibility into compilation problems. For more information, see “Program Descriptions” on page 143.