Skip to content

Latest commit

 

History

History
73 lines (57 loc) · 1.93 KB

README.md

File metadata and controls

73 lines (57 loc) · 1.93 KB

Build instructions

Regular build:

mkdir build && cd build
cmake ..
cmake --build . -j$(nproc)

For building with debugging symbols use:

cmake .. -DCMAKE_BUILD_TYPE=Debug

For extra build output use:

cmake --build . -j$(nproc) -v

It may be convenient to use tool GUI:

cmake-gui -S . -B build

In Advanced Mode you may set paths for auxiliary libraries (e.g. BLAS).

Build all examples:

cmake .. -DBUILD_EXAMPLES=ON

Build specific example:

cmake .. -DBUILD_EXAMPLES=ON -DBUILD_ALL_EXAMPLES=OFF \
    -DBUILD_ADVECTION_DIFFUSION_STABILIZATION_SANDBOX_2D=ON

Each example folder has CMakeLists.txt file, where you can lookup build flag for the example.

Add project

Simulation projects are located under simulations. In order to create a new simulation:

  1. Copy simulations/default folder with different name. Let's say that the new folder is simulations/newsim
  2. Replace target name default with the unique one in simulations/newsim/CMakeLists.txt
  3. Add line add_subdirectory(newsim) to the simulations/CMakeLists.txt
  4. Build as usual. Executable file will be located in build/simulations/newsim folder

Docker image

With Docker you can run your simulations using containerized development environment.

Run your simulation in three steps:

  1. Install Docker
  2. Create image:
    docker build -t sparselizard_debian_testing:latest -f docker/debian-testing.dockerfile  .
  3. 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