Regular build:
mkdir build && cd build
cmake ..
cmake --build . -j$(nproc)For building with debugging symbols use:
cmake .. -DCMAKE_BUILD_TYPE=DebugFor extra build output use:
cmake --build . -j$(nproc) -vIt may be convenient to use tool GUI:
cmake-gui -S . -B buildIn Advanced Mode you may set paths for auxiliary libraries (e.g. BLAS).
Build all examples:
cmake .. -DBUILD_EXAMPLES=ONBuild specific example:
cmake .. -DBUILD_EXAMPLES=ON -DBUILD_ALL_EXAMPLES=OFF \
-DBUILD_ADVECTION_DIFFUSION_STABILIZATION_SANDBOX_2D=ONEach example folder has CMakeLists.txt file, where you can lookup build flag for the example.
Simulation projects are located under simulations.
In order to create a new simulation:
- Copy
simulations/defaultfolder with different name. Let's say that the new folder issimulations/newsim - Replace target name
defaultwith the unique one insimulations/newsim/CMakeLists.txt - Add line
add_subdirectory(newsim)to thesimulations/CMakeLists.txt - Build as usual. Executable file will be located in
build/simulations/newsimfolder
With Docker you can run your simulations using containerized development environment.
Run your simulation in three steps:
- Install Docker
- Create image:
docker build -t sparselizard_debian_testing:latest -f docker/debian-testing.dockerfile . - Build:
docker run -it --rm -v "$(pwd):/workdir" sparselizard_debian_testing
Notes:
- Docker container is running in interactive mode, so you can interrupt it from keyboard
- By default UID 1000 is used. It may be adjusted in
docker/debian-testing.dockerfile - Binaries and libraries created using Docker container are linked inside this container and cannot be used without it