Installation Instructions

Getting the Software

Please follow the instructions in the README file to download/clone and install libMesh. Note that the installation instructions may change over time, but the README file should always contain the most up-to-date information.

Compilers

libMesh requires a C++17 compliant compiler.

Testing the Library

libMesh Continuous Integration testing (example codes and unit tests) is automatically performed on all PRs for members of the libMesh Project's "Associates" Team. If you submit a PR, you will be invited to join this Team so that your PRs are tested automatically.

Running the Examples

libMesh includes a number of examples in the examples directory. From the top-level directory you can build and run the example programs by typing
make check

Note that many of the the example programs create output in the ExodusII format, since you can download Paraview for free, and it is a highly capable postprocessing tool. It is a simple matter to change the source in the example to write a different formats, however.

Unit Tests

The repository contains a top-level tests directory with a series of unit tests that can be used to validate a libMesh installation. These unit tests require CPPUnit to run properly. To run the unit test suite, from the build directory, simply do
make -C tests check 

External Software

libMesh has many features which are enabled via integration with various third-party libraries, a few of which are redistributed in our contrib directory, others of which may be separately installed on your system. The libMesh configure script attempts to autodetect these libraries when possible. Some of the supported libraries have occasionally changing (or even frequently changing) APIs. We attempt to provide a range of backwards compatibility for old versions of third-party APIs.

Linking With Your Application

Since libMesh can be configured with many additional packages we recommend including the Make.common file created in the top-level directory in the Makefile of any application you want to use with the library. This will properly set the libmesh_INCLUDE and libmesh_LIBS variables, which you can append to with your own stuff.
For testing simple programs you may want to use the libmesh-config script included in the contrib/bin directory instead of creating a Makefile. This script may be used to determine the relevant compilation and linking flags used by libMesh. For example, you could build the application foo from foo.C like this:
 `libmesh-config --cxx` -o foo foo.C `libmesh-config --cxxflags --include --ldflags --libs`

Building on Windows

The libMesh library can be built on Microsoft Windows using the msys2 software distribution and the mingw-w64 compiler. There are, however, a few specifics that need to be taken into account.

After installing msys2 you need to install the mingw-w64 C++ compiler. To check that the installation was successfull, you can run

g++ --version

in the msys2 shell.

When you checkout the current version of libMesh using Git on Windows symlinks might not work. You can check whether your symlinks are set correctly by inspecting whether the README file points to the README.md file. If this is not the case, you should run the contrib/bin/fix_windows_symlinks.sh from within the git repository using the msys2 shell. This script removes all symlinks and copies the symlink targets to the corresponding places.

Not all optional dependencies are available on Windows. It is known that the following packages do not compile on Windows.

Hence, these libraries need to be deactivated, using the corresponding flags. For example by configuring libMesh with the following command.

./configure --prefix=c:/libmesh \
    --disable-metis \
    --with-fparser=none

Then, the library can be built and installed using:

make
make install