You'll need a unix terminal to execute the necessary commands. MacOS and Linux have this by default, typically called "terminal". If you're using Windows, install git bash.
This project utilizes make to simplify the setup and execution of our project. MacOS and Linux distros typically come with this preinstalled, but Windows does not. The following section details how to install make on each OS, in the event that it isn't installed.
To check whether you already have make installed, run the following command in a terminal:
make --versionIf this runs without error, skip past this section. If you receive an error, install make using the steps below:
-
Click the following link, which downloads make from GnuWin32
-
Run the downloaded .exe, following the installation prompts. Make sure to leave the default install paths.
-
Go to Windows search and access "Edit the system environment variables".
-
Select "Environment Variables"
-
Edit Path
-
Add the following path
-
Install homebrew by running the following command in terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install make by running the following command in terminal:
brew install make
-
Run the following command in terminal
sudo apt update && sudo apt install -y make
-
Run the following command in terminal
sudo pacman -Su make
Git is required to clone repositories from Github. It's also required for code development and version control.
- If you already installed Git Bash, this is covered
-
Make sure you've installed Homebrew from the previous step (make)
-
Install Git from the command line using:
brew install git
- Run the following command in terminal
sudo apt-get install git
- Run the following command in terminal
sudo pacman -Su git
Once you've installed Git, it still needs to be configured. First, set your name and email (associated with commits). This can be achieved with the following command:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"Go to the OpenModelica Website. Under "Download", pick your specified operating system. Installation varies across machines, but reach out to code owners if you run into any issues. Note that this process is easiest on Windows and probably most difficult on MacOS (need to install via a Docker container).
- Run the following commands in terminal
yay -S openmodelica yay -S openmodelica-omlibraries
Make sure the second checkbox is checked
Docker isn't required to run workflows locally, but it is highly recommended. Docker containers give a unified runtime environment, making debugging easier with fewer runtime issues.
-
Click the following link, and select the proper download for your machine
-
Run the downloaded .exe, following the installation prompts. Make sure to leave the default install paths.
-
Go to Windows search and open the new Docker Desktop application.
-
Check if docker installed successfully by running the following command (in git bash)
docker run hello-world
-
Install make by running the following command in terminal:
brew install --cask docker
-
Check if docker installed successfully by running the following command
docker run hello-world
-
Run the following commands in terminal
sudo apt-get update sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \ https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io sudo usermod -aG docker $USER newgrp docker -
Check if docker installed successfully by running the following command
docker run hello-world
-
Run the following commands in terminal
sudo pacman -Syu docker sudo systemctl enable docker.service sudo systemctl start docker.service sudo usermod -aG docker $USER newgrp docker
-
Check if docker installed successfully by running the following command
docker run hello-world
Assuming you already have Python installed, this covers all requirements for the project.
There are two methods for running workflows locally. You can run through docker containers (recommended) OR you can call python directly.
-
Open the Docker application
-
Run the following command in terminal
make testThis runs the full testing workflow to ensure docker runs properly
-
Run the desired simulation workflow. Options are shown below:
make sim SIM=kin MODEL_PATH=Nightwatch.yml make sim SIM=kin MODEL_PATH=Nightwatch.yml COMPARISON_PATH=Scratchpad.yml make sim SIM=qss MODEL_PATH=Nightwatch.yml
-
Locate the workflow outputs under ./outputs
-
Create and activate a virtual environment in "./simulation_toolkit" to contain the necessary Python libraries.
- MacOS or Linux
python3 -m venv .venv source .venv/bin/activate- Windows:
python -m venv .venv source .venv/Scripts/activate -
Open a terminal directed at "./simulation_toolkit"
-
Run the following command:
make init
This installs the necessary Python libraries and remote files for project functionality.
-
Run the desired simulation workflow. Options are shown below:
- MacOS or Linux
python3 -m kernel kin Nightwatch.yml python3 -m kernel kin Nightwatch.yml Scratchpad.yml python3 -m kernel qss Nightwatch.yml
- Windows:
python -m kernel kin Nightwatch.yml python -m kernel kin Nightwatch.yml Scratchpad.yml python -m kernel qss Nightwatch.yml
-
Locate the workflow outputs under ./src/simulations/{your simulation name}/{your simulation name}_outputs
