CMake downloads the unmodified source tarfile from MUMPS developers and builds.
CMake builds MUMPS in parallel faster and more conveniently than the original Makefiles.
CMake allows easy reuse of MUMPS in external projects via CMake
FetchContent
or ExternalProject or cmake --install
.
MUMPS CeCILL-C license is distinct from this CMake script license. MUMPS teams typically make new releases each year.
Many compilers and systems are supported by CMake build system on Windows, MacOS and Linux.
Static (default) or Shared cmake -DBUILD_SHARED_LIBS=on
MUMPS builds are supported.
Platforms known to work with MUMPS and CMake include:
By default PORD ordering is used. Scotch, METIS, and parMETIS ordering can be used.
Several LAPACK vendors are supported.
The MUMPS project is distinct from this CMake script wrapper. See the MUMPS Users email list and MUMPS User Guide for any questions about MUMPS itself.
From this repo's top directory:
cmake -B build
cmake --build build
Numerous MUMPS build options are available.
With the default options the build/ directory contains library binaries (Windows binaries have different names):
If -DMUMPS_parallel=no
was set, an additional helper library is built in place of linking MPI libraries:
These libraries can be linked into C, C++, Fortran, etc. programs, or even be used with appropriate interfaces from Matlab and Python PyMUMPS and python-mumps.
Optionally, run self-tests:
ctest --test-dir build
To build the example, first "install" the MUMPS package-the default install location is under the MUMPS build/local directory:
cmake --install build
cmake -S example -B example/build -DMUMPS_ROOT=build/local
cmake --build example/build
Linking the MUMPS binaries into a user-program is project-dependent. An example using the examples in this project with GNU GCC, using the "mpicxx" MPI compiler wrapper:
mpicxx ./example/d_example.cpp -I./build/local/include -L./build/local/lib -ldmumps -lmumps_common -lpord -lscalapack -lblacs -llapack -lblas -lgfortran
If -DMUMPS_parallel=no
was used to build MUMPS, instead do:
g++ ./example/d_example.cpp -I./build/local/include -L./build/local/lib -ldmumps -lmumps_common -lpord -llapack -lblas -lmpiseq -lgfortran