Getting the SoftwarePlease 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.
libMeshrequires a C++17 compliant compiler.
Testing the Library
libMeshContinuous 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
libMeshincludes a number of examples in the
examplesdirectory. From the top-level directory you can build and run the example programs by typing
Note that many of the the example programs create output in the
ExodusIIformat, 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 TestsThe repository contains a top-level
testsdirectory with a series of unit tests that can be used to validate a
libMeshinstallation. These unit tests require CPPUnit to run properly. To run the unit test suite, from the build directory, simply do
make -C tests check
libMeshhas 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 ApplicationSince
libMeshcan be configured with many additional packages we recommend including the
Make.commonfile created in the top-level directory in the
Makefileof any application you want to use with the library. This will properly set the
libmesh_LIBSvariables, which you can append to with your own stuff.
For testing simple programs you may want to use the
libmesh-configscript included in the
contrib/bindirectory 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
`libmesh-config --cxx` -o foo foo.C `libmesh-config --cxxflags --include --ldflags --libs`
Building on Windows
After installing msys2 you need to install the mingw-w64 C++ compiler. To check that the installation was successfull, you can run
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.
- fparser, Function Parser for C++
- METIS, Serial Graph Partitioning and Fill-reducing Matrix Ordering
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