Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/KarypisLab/ParMETIS/llms.txt

Use this file to discover all available pages before exploring further.

ParMETIS is distributed as source code and must be compiled on the target system. The build system uses CMake and GNU Make. You must first install a C compiler, MPI library, and the two upstream dependencies (GKlib and METIS) before building ParMETIS itself.

Prerequisites

You need the following tools available on your system before you begin:
RequirementMinimum versionNotes
C compiler (gcc)C99 supportOther C99-compliant compilers also work
CMake2.8Required by the build system
MPI libraryAnyMPICH and OpenMPI are both supported
GKlibLatestMust be installed before METIS
METISLatestMust be built with the same integer/float widths as ParMETIS
ParMETIS, METIS, and GKlib must all use the same data type widths (32-bit or 64-bit integers and floating-point numbers). The widths are set in METIS’ include/metis.h via the IDXTYPEWIDTH and REALTYPEWIDTH constants.

Installation steps

1

Install system dependencies

On Ubuntu or Debian, install the compiler toolchain, CMake, and an MPI library with apt-get.
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install mpich
After installation, verify your MPI compiler wrapper is available:
mpicc --version
2

Install GKlib

Clone the GKlib repository and install it to your chosen prefix. The example below uses ~/local as the install prefix, which is also the default for ParMETIS.
git clone https://github.com/KarypisLab/GKlib.git
cd GKlib
make config prefix=~/local
make install
3

Install METIS

Clone and build METIS. Use the same prefix as GKlib so that ParMETIS can find both automatically.
git clone https://github.com/KarypisLab/METIS.git
cd METIS
make config cc=gcc prefix=~/local
make install
Before building METIS, you can set the integer and floating-point data type widths by editing include/metis.h and setting IDXTYPEWIDTH to 32 or 64. ParMETIS inherits these widths automatically. On 32-bit systems, only IDXTYPEWIDTH=32 is supported.
4

Clone and configure ParMETIS

Clone the ParMETIS repository, then run make config to generate the CMake build files. Pass cc=mpicc to ensure the MPI compiler wrapper is used.
git clone https://github.com/KarypisLab/ParMETIS.git
cd ParMETIS
make config cc=mpicc prefix=~/local
If GKlib and METIS were installed to a different prefix than ~/local, specify their paths explicitly:
make config cc=mpicc prefix=~/local gklib_path=~/local metis_path=~/local
5

Build and install

Compile the library and install the binaries, headers, and library files:
make install
The following output directories are created under your install prefix:
DirectoryContents
~/local/binCommand-line programs
~/local/includeHeader file (parmetis.h)
~/local/libStatic or shared library (libparmetis.a / libparmetis.so)

Configuration options

Pass these options to make config to customize the build.

Core options

cc
string
default:"mpicc"
The C compiler to use. Set to mpicc (or your MPI compiler wrapper) to enable MPI support.
shared
number
default:"0"
Set to 1 to build a shared library (libparmetis.so) instead of the default static library (libparmetis.a).
prefix
string
default:"~/local"
The installation root. Headers go to PREFIX/include, libraries to PREFIX/lib, and programs to PREFIX/bin.
gklib_path
string
The prefix where GKlib is installed. Omit this if GKlib was installed to the same prefix as ParMETIS.
metis_path
string
The prefix where METIS is installed. Omit this if METIS was installed to the same prefix as ParMETIS.

Debug options

These options are intended for development and testing. They reduce performance and should not be used in production builds.
gdb
number
default:"0"
Set to 1 to include GDB debug symbols in the build.
debug
number
default:"0"
Set to 1 to enable general debugging support.
assert
number
default:"0"
Set to 1 to enable internal assertions.
assert2
number
default:"0"
Set to 1 to enable very expensive internal assertions. Only use this when diagnosing deep bugs.

Other make commands

CommandEffect
make uninstallRemoves all files placed by make install.
make cleanRemoves compiled object files but keeps the CMake configuration.
make distcleanRemoves all object files and the build directory. Run before reconfiguring from scratch.

Verifying the installation

After installation, confirm the library and header are in place:
ls ~/local/lib/libparmetis*
ls ~/local/include/parmetis.h
To confirm the MPI environment works, compile a minimal test:
echo '#include <parmetis.h>' | mpicc -x c - -I~/local/include -L~/local/lib -lparmetis -lmetis -o /dev/null
A clean exit (no error output) confirms the compiler can find the headers and link against the library.
Add ~/local/lib to your LD_LIBRARY_PATH if you built a shared library and want to run programs without specifying the library path explicitly:
export LD_LIBRARY_PATH=~/local/lib:$LD_LIBRARY_PATH

Build docs developers (and LLMs) love