matsievskiysv / sparselizard

C++ FEM library | user-friendly | multi-physics | hp-adaptive
http://www.sparselizard.org
Other
1 stars 0 forks source link

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: