This guide explains how to build MSH3 from source on different platforms.
- CMake 3.16 or higher
- A C++ compiler with C++14 support
- Git (for cloning the repository and its dependencies)
git clone --recursive https://github.com/nibanks/msh3
cd msh3If you've already cloned the repository without the --recursive flag, you can fetch the submodules separately:
git submodule update --init --recursivemkdir build && cd build
cmake -G 'Unix Makefiles' ..
cmake --build .To build with specific compiler flags:
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-O3" -DCMAKE_CXX_FLAGS="-O3" ..
cmake --build .Using Visual Studio:
mkdir build && cd build
cmake -G 'Visual Studio 17 2022' -A x64 ..
cmake --build .Using Ninja:
mkdir build && cd build
cmake -G 'Ninja' ..
cmake --build .mkdir build && cd build
cmake -G 'Unix Makefiles' ..
cmake --build .To install MSH3 on your system:
cmake --build . --target installYou might need elevated privileges (sudo on Linux/macOS, or Administrator on Windows) to install to system directories.
find_package(msh3 REQUIRED)
target_link_libraries(your_target_name PRIVATE msh3::msh3)pkg-config --cflags --libs libmsh3