METIS is a C library built from source using CMake. The top-levelDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/KarypisLab/METIS/llms.txt
Use this file to discover all available pages before exploring further.
Makefile acts as a proxy that translates make config options into CMake flags, runs CMake inside a build/ directory, and then delegates all subsequent make targets to the generated build system. Before you can build METIS you must install its required external dependency, GKlib, as well as a C compiler and CMake.
System requirements
You need the following tools installed before proceeding:- GCC (or another C99-compatible compiler)
- CMake 3.10 or later
- Make
- Git
GKlib is a required external dependency that is not bundled with METIS. You must clone and install it separately before configuring METIS. Follow the instructions at github.com/KarypisLab/GKlib.
Installation
Install GKlib
Clone GKlib and install it to a local prefix. The default prefix used by both GKlib and METIS is If you install GKlib to a different path, note it — you will need to pass it to METIS via
~/local.gklib_path.Configure the build
Run If you installed GKlib to a prefix other than See the configuration options section below for the full list of available flags.
make config with your desired options. This step creates the build/ directory, writes type-width headers, and runs CMake.~/local, pass it explicitly:Build and install
Compile METIS and install the binaries, headers, and library:After installation, the following files will be placed under your
prefix:| Path | Contents |
|---|---|
<prefix>/bin | CLI executables: gpmetis, ndmetis, mpmetis, m2gmetis, graphchk, cmpfillin |
<prefix>/include | Public header: metis.h |
<prefix>/lib | Static or shared library: libmetis.a / libmetis.so |
Configuration options
All options are passed tomake config as key=value pairs. Running make config always triggers make distclean first, so it is safe to re-run with different options.
Build options
| Option | Description | Default |
|---|---|---|
cc=<compiler> | The C compiler to use | Determined by CMake |
shared=1 | Build a shared library (.so/.dylib) instead of a static archive (.a) | Off (static) |
prefix=<path> | Installation prefix for bin/, include/, and lib/ | ~/local |
gklib_path=<path> | Path to the GKlib installation prefix. Omit if GKlib and METIS share the same prefix | ~/local |
i64=1 | Use 64-bit integers for idx_t (vertex and adjacency data). Required when vertex count or total edge count exceeds 2^31−1 | Off (32-bit) |
r64=1 | Use 64-bit doubles for real_t (floating-point weights). Enables double-precision arithmetic throughout | Off (32-bit float) |
Debug options
These options are intended for development and debugging. They should not be used in production builds.| Option | Description | Default |
|---|---|---|
gdb=1 | Compile with GDB debug symbols (-g) | Off |
debug=1 | Enable debug mode, disables compiler optimizations | Off |
assert=1 | Enable standard assertion checks throughout the library | Off |
assert2=1 | Enable expensive (performance-impacting) assertions for deep correctness checking | Off |
Other make commands
Once METIS has been configured, the following commands are available:| Command | Description |
|---|---|
make install | Build and install METIS to the configured prefix |
make uninstall | Remove all files installed by make install (reads build/install_manifest.txt) |
make clean | Remove compiled object files while retaining the CMake configuration in build/ |
make distclean | Remove the entire build/ directory, including all configuration and object files |