The following diagram shows the static build process resulting in the executable simulator problem.exe. Red font is used to indicate systems program like the C++ compiler and linker. Blue font is used to indicate the SPARK programs and files involved in the build process. The bold arrows indicate file dependencies at runtime, whereas the normal arrows indicate build operations performed before runtime.
- The file libsolver.a is the static library for the fixed part of the SPARK solver.
- The problem.cpp and problem.prf files are generated by the setup step (See Setup step).
This mode of operation is accomplished by executing the SPARK makefile with the following flag at the command-line:
gmake SPARK_STATIC_BUILD=yes <some-target> <enter>
- Note:
- On UNIX/Linux platforms, the resulting executable file is named problem without extension.
- On Windows platform, the static library for the fixed part of the solver is called libsolver.lib if you are using the Microsoft VC++ compiler in place of the mingw compiler.
At runtime, the only files that are needed to run a statically-built problem with the default driver function are:
- the executable simulator, problem.exe
- the preference file, problem.prf
- the run control file, problem.run.
To simulate a statically-built problem, type at the command line:
problem problem.run problem.prf <enter>
Once the simulator is built, the C++ compiler and the linker are no longer needed. All needed atomic classes and the solver library are statically linked along to produce the executable simulator, thus producing a self-contained simulator program that can be shared with and reused by different users on the same platform.
- Note:
- It is also possible to build dynamic SPARK problems that are built at runtime from the problem.xml file and the dynamic libraries containing the compiled atomic classes (See Build a SPARK problem dynamically).