-
Notifications
You must be signed in to change notification settings - Fork 13
2. Installation
Cadmium 2 is a header-only library. This means that you don't need to compile nor install it in your machine. You just have to include the header files to your project.
Let us assume that you want to have all your Cadmium models in the same directory. We will call this directory WORKSPACE. Open a terminal (Windows users should use a Cygwin terminal) in WORKSPACE and download the repository:
cd WORKSPACE
git clone https://github.com/SimulationEverywhere/cadmium_v2.gitNow, the Cadmium 2 library will be located in WORKSPACE/cadmium_v2. Now, we have to download all the submodules of Cadmium 2. To do so, insert the following commands in the same terminal:
cd cadmium_v2
git submodule update --init --recursiveinclude_directories(${CMAKE_CURRENT_SOURCE_DIR}/../cadmium_v2/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../cadmium_v2/json/include)
We use GitHub Actions, a tool for Continuous Integration (CI), to ensure that the devel and main branches pass all the tests. You can check there whether the code is stable or not. However, after building everything on your machine, you may want to run some tests to make sure that everything works as expected. You have two options:
- Use
maketo run the tests:
cd build
make test
- Run the
run_tests.shshell script:
./run_tests.sh
If you want to store the test results in a file (e.g., the test_results.txt file), you can type the following command:
./run_tests.sh > test_results.txt
To run the application, type the following commands
cd bin
./sim_lifecycle RELATIVE_PATH_TO_WORKFLOW_JSON_FILE
Where RELATIVE_PATH_TO_WORKFLOW_JSON_FILE corresponds to the relative path from the bin/ folder to the JSON file containing all the simulation workflow fields.
You must run the main application from the bin/ folder. All the file paths included in your workflow JSON file must be relative to this folder. Otherwise, the application won't be able to find the desired files.
We provide a set of valid workflow JSON files in the data/ folder. For example, you can run a simple model as follows:
cd bin
./sim_lifecycle ../data/demo_1/demo.json
The simulation output of this workflow example will be stored in the data/demo_1/output folder.
You can run a more complex scenario as follows:
cd bin
./sim_lifecycle ../data/demo_2/provinces_workflow.json
The simulation output of this workflow example will be stored in the data/demo_2/output folder.