CLI Workflow
Use omc to load, build, and simulate BobLib models without OMEdit. For the make check targets, see Tests and Checks.
Load the package
From the BobLib repository root, start omc and run:
loadModel(Modelica, {"4.1.0"});
loadModel(VehicleInterfaces, {"2.0.2"});
loadFile("BobLib/package.mo");
loadFile("Tests/BobLibTest/package.mo");
getErrorString();Both loadFile(...) calls should return true. getErrorString() should be empty or show only non-critical messages.
Build or simulate an entry point
After you load the package, build the model without running it:
buildModel(BobLib.Experiments.Standards.VehicleSim);
getErrorString();Or build and run it with the model's default experiment settings:
simulate(BobLib.Experiments.Standards.VehicleSim);
getErrorString();The same calls work for BobLib.Experiments.Standards.FourPostSim. See Entry Points for the other models.
To change which vehicle architecture the entry points use, see Static Vehicle Templates.
Build in a scratch directory
A scratch directory keeps the generated C code, executables, XML, logs, and results out of the repository.
Set the paths from the BobLib repository root:
bashBOBLIB_ROOT="$(pwd)" RUN_DIR="/tmp/BobLibVehicleSim" mkdir -p "$RUN_DIR"Write a build script into the scratch directory:
bashcat > "$RUN_DIR/build_vehicle_sim.mos" <<MOS OpenModelica.Scripting.cd("$RUN_DIR"); loadModel(Modelica, {"4.1.0"}); loadModel(VehicleInterfaces, {"2.0.2"}); loadFile("$BOBLIB_ROOT/BobLib/package.mo"); buildModel(BobLib.Experiments.Standards.VehicleSim); getErrorString(); MOSRun the script:
bashomc "$RUN_DIR/build_vehicle_sim.mos"Run the executable from the scratch directory:
bashcd "$RUN_DIR" ./BobLib.Experiments.Standards.VehicleSim
For the four-post model, use a separate scratch directory and replace the model class with BobLib.Experiments.Standards.FourPostSim.
Build through BobSim
Inside BobSim, BobLib is a submodule. BobSim owns the workflow YAML, case generation, result extraction, plots, and reports. BobLib owns the physical models and records. From the BobSim root:
make standard-build
make standard-build-four-post