-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Pascal Horton edited this page Oct 16, 2024
·
16 revisions
There are different ways to build hydrobricks:
- To work on the Python code, you should install it in editable mode (first instructions)
- To build a Python wheel without installing development tools, use cibuildwheel (second instructions)
- If you want to build the C++ core only, follow the instructions of the last section.
To build hydrobricks, you need:
- A C++ compiler (GCC, Visual Studio)
- CMake
- Python 3
Create a Python virtual environment and activate it
python -m venv ~/venv_hb
# On Linux:
source ~/venv_hb/bin/activate
# On Windows
source ~\venv_hb\Scripts\activateFrom the hydrobricks directory:
pip install -e .Test the package:
pip install pytest
# Optionally, install all requirements to test the maximum number of features.
pip install -r python/requirements-optional.txt
pytest ./python/tests/To build hydrobricks wheel, you need:
- Python 3
- Docker
If you haven't installed docker, you can install Docker Desktop on Windows, or follow these instructions on Linux (example for Ubuntu):
sudo snap install docker
# Allow your user to user docker (you might need to reboot)
sudo groupadd docker
sudo usermod -aG docker ${USER}Create a Python virtual environment and activate it
python -m venv ~/venv_hb
source ~/venv_hb/bin/activateInstall cibuildwheel
pip install cibuildwheelBuild hydrobricks for your Python version (python --version). For example, for Python 3.11 under Linux:
cd hydrobricks
cibuildwheel --only cp311-manylinux_x86_64You can also build it for Windows:
# Selecting the platform
cibuildwheel --platform windows
# Selecting a specific target:
cibuildwheel --only cp38-win_amd64To build hydrobricks core, you need:
- A C++ compiler (GCC, Visual Studio)
- CMake
- Python 3
Configure and build (set the desired build type: Debug or Release, for example):
mkdir cmake-build-release
cd cmake-build-release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release