Build Instructions

The default is to build libmesh "out of tree," i.e. within a separate build directory, rather than in the source tree itself. This simplifies the process of having multiple, independently-configured builds.

  1. cd to location of libmesh clone or extracted tarball.
  1. mkdir build
  1. cd build
  1. ../configure --prefix=/path/to/libmesh/install
  1. make
  1. make check (optional, runs the example programs and unit tests when possible)
  1. make install


libMesh supports the notion of multiple methods, that is, configuration settings used to build the library. The major methods supported by the library are:

To select a set of methods, you can pass them to configure in one of two ways:

../configure --with-methods="opt dbg devel"


../configure METHODS="devel oprof"

If unspecified, METHODS="opt dbg devel" is the default.

Multiple Builds with Different Compilers

libMesh fully supports out-of-tree builds, and users are encouraged to use this feature when needed to support multiple compilers. For example, on a system where multiple compilers are available and accessible via modules, you can share the same source tree by creating a subdirectory for each compiler build:

export LIBMESH_SRC=/local/libmesh
module load gcc/6.3
cd $LIBMESH_SRC && mkdir gcc-6.3 && cd gcc-6.3 && ../configure && make && make install
module swap gcc/6.3 intel/17.0
cd $LIBMESH_SRC && mkdir intel-17.0 && cd intel-17.0 && ../configure && make && make install


libMesh has no required dependencies other than a reasonably modern C & C++ compiler. To run on distributed memory platforms in parallel, you will also need MPI.

Optional Packages

We support a large number of optional packages. Some of these are distributed inside the contrib directory and compiled directly with libMesh, others can be used via third-party installations.


LibMesh is open source software distributed under the LGPL license, version 2.1.