Source code to run OPL: oplrunsample

Presents an example that shows how the oplrun program is used to execute a model or project from the Windows command line.

C++: oplrunsample.cpp

Java: OplRunSample.java

C#: OplRunSample.cs

See Starting the IDE from Windows in Introduction to the CPLEX Studio IDE.

The oplrunsample example illustrates how to execute a model or project from the Windows command line. It is available for C++, Java, and C#. See Running CPLEX Studio from the command line.

Calling external functions is not possible if the application is statically linked with the OPL libraries (like oplrunsample ). This is because the Java OPL library uses the shared library version of OPL (oplxx.dll/.so) which cannot be mixed with the static version. You can use an external call to Java in the CPLEX Studio IDE, in oplrun , and in custom OPL or ODM Enterprise applications launched from Java.

Syntax

oplrunsample [options] model-file [data-file ...]

oplrunsample [options] -p project-file [run-configuration]

Options

This example supports only a limited set of the options available for oplrun , and the options provided in both oplrun and oplrunsample do not always offer the same functionality. See Table 1 in oplrun Command Line Interface.