Setting up a development environment
Trident has a few prerequisites which must be installed before you can start compiling and making changes to the project. They are as follows:
Git
Python >= 3.8
SCons
Conan
A compiler (Visual Studio for Windows, GCC for Linux)
For detailed instructions, see the Development section of the User Guide.
Linux
On Linux, you can run the following script from the
base directory of the project to get started:
#!/usr/bin/env sh
set -e
# Install prerequisites
sudo apt install \
python3-venv \
python3-dev \
g++ \
cmake \
scons
# Set up Python venv
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pip install -r requirements.build.txt
pip install -r requirements.doc.txt
# Set up Conan
pip install \
conan
CONAN_PROFILES="$(conan config home)/profiles"
[ ! -e "${CONAN_PROFILES}/debug" ] && conan profile detect --name debug
sed -i 's/build_type=.*/build_type=Debug/' "${CONAN_PROFILES}/debug"
sed -i 's/compiler.cppstd=.*/compiler.cppstd=gnu20/' "${CONAN_PROFILES}/debug"
[ ! -e "${CONAN_PROFILES}/release" ] && conan profile detect --name release
sed -i 's/build_type=.*/build_type=Release/' "${CONAN_PROFILES}/release"
sed -i 's/compiler.cppstd=.*/compiler.cppstd=gnu20/' "${CONAN_PROFILES}/release"
# Attempt to install internal conan repos
conan config install git@gitlab.sintef.no:ngltm/internal-conan-config.git
# Install deps and build
conan install . --output-folder build -pr debug -o cplex/*:bundled=True
scons build
This should be enough to configure the environment, and do a basic build at the end to verify that it was set up correctly.
Windows
When using Windows, the following options are available:
Build, test and run Trident directly on Windows
Build, test and run Trident in Windows Subsystem for Linux (WSL) with Ubuntu
Build, test and run Trident in a VSCode development container with Ubuntu
For building on Windows directly, or with a VSCode development container, see the Windows or VSCode devcontainer sections of the User Guide.
WSL
To use WSL, first install it by running the following command in the Windows terminal:
wsl --install
Then enter and set up WSL by simply running the wsl command. You may be
asked to restart your computer at some point in the process. Do so and proceed
through the installation process.
Once you’ve successfully installed and activated WSL, follow the instructions in the Linux section to get set up.