deploy
Topics covered in this chapter:
This module defines two I/O drivers, deploy.csrc and deploy.exe for generating an executable program from a BIM file, along with two utility routines for accessing the program arguments with the Mosel model. Its use is discussed in Section Deploying models.
Procedures and functions
Retrieve the number of arguments passed to a model executable.
|
|
Retrieve an argument passed to a model executable.
|
I/O drivers
The two I/O drivers provided by this module are designed to be used in combination with a Mosel command compiling a model by applying them to the output filename. They are not intended to be used in any other contexts.
deploy.*:filename[,p1[-z]=fp1[,...]]
Driver csrc
csrc:filename[,p1[-z]=fp1[,...]]
The csrc driver takes the following options:
- filename
- Destination file name
- p1[-z]=fp1
- list of labels and filenames, the optional -z flag indicates that compression is to be used
Example:
mosel comp mymodel.mos -o deploy.csrc:runmymod
This command produces a file runmymod.c that contains the model mymodel.mos in compiled (BIM) form and a complete C program for executing it via the Mosel C Library API. The generated code needs to be compiled into an executable for the targeted platform (see the makefile provided with the Mosel Library API examples).
Driver exe
exe:filename[,p1[-z]=fp1[,...]]
The exe driver takes the following options:
- filename
- Destination file name
- p1[-z]=fp1
- list of labels and filenames, the optional -z flag indicates that compression is to be used
Example:
mosel comp mymodel.mos -o deploy.exe:runmymod,MYFILE-z=otherfile.txt
Provided that a C compiler is available on the system, this command produces an executable for the platform in which it is invoked (resulting in a file named runmymod on Unix platforms or runmymod.exe under Windows). The executable serves for running the specified model, it also includes a second file otherfile.txt in compressed form, identified via the model parameter MYFILE.
The generation of this executable is obtained by producing a C source using the deploy.csrc driver that is compiled using the C-compiler installed on the system. This compiler can be specified by means of the CC environment variable (default value: cl on Windows and cc on Posix systems) and its default parameters can be selected with the environment variable CFLAGS. The location of the Xpress libraries is automatically deduced from the running program that is expected to be part of a standard Xpress installation.
For a full example, the reader is refered to the source of the moseldoc tool that is provided among the Mosel examples of the Xpress distribution.
Note that the generated executable only includes the compiled model and the specified additional files, it requires the same Xpress runtime dependencies (see the chapter Creating runtime distributions of the Xpress Installation Guide) for its execution as what would be required for running the model after compiling it into a standard BIM file.
© 2001-2022 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.