Installation Instructions

Getting the Software

The libMesh source can be downloaded from the project's SourceForge homepage. Stable releases are located there as compressed tar archives. You may also access the SVN source tree for the latest code. You can get read-only access to the SVN repository via:
svn checkout https://libmesh.svn.sourceforge.net/svnroot/libmesh/trunk/libmesh 

More information regarding the libMesh SVN repository may be found here.

If you would like to contribute to the project you will need a SourceForge developer account, or you can contribute patches. To create a patch from a modified SVN tree simply do:
svn diff > patch 

in the top-level directory. You can then submit the file patch.

Compilers

libMesh makes extensive use of the standard C++ library, so you will need a decent, standards-compliant compiler. We have tried very hard to make the code completely compiler-agnostic by avoiding questionable (but legal) constructs. If you have a compiler that won't build the code please let us know. You will also need a decent C compiler if you want to build some of the contributed packages that add functionality to the library.

The library is currently tested with the GNU GCC 4.x and 3.x compilers, as well as Intel ICC 11.x, 10.x and 9.x.

Previous library versions were also tested with:

Configuration

Configuring the library is straightforward. The GNU autoconf package is used to determine site-specific configuration parameters. A standard build will occur after typing
./configure
make

in the top-level project directory. To see all the configuration options type

./configure --help

The configure script will find your compilers and create the Make.common file with the configuration for your site. If you want to use different compilers than those found by configure you can specify them in environment variables. For example, the following will build with the MIPS compilers on an SGI:
CXX=CC CC=cc F77=f77 CXXFLAGS=-LANG:std ./configure

Note that the FORTRAN compiler is not actually used to compile any part of the library, but configure uses it to find out how to link FORTRAN libraries with C++ code.

Building the Library

To build the library you need GNU Make and a supported compiler, as listed in the Compiler section. After the library is configured simply type make to build the library. Typing make bin/meshtool will build a mesh translation tool using the library.
The Makefiles distributed with the library look at the shell environment variable METHOD to determine what mode the library should be built in. Valid values for METHOD are opt (optimized mode, the default if METHOD is empty), dbg (build with debug symbols), and pro (build with profiling support for use with gprof). Once the library is configured you can build it simply by typing
make

Testing the Library

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 run_examples

Note that the example programs all create output in the GMV format, since you can download GMV for free from Los Alamos National Lab. It is a simple matter to change the source in the example to write a different format, just replace the write_gmv function call with whatever you like.

Unit Tests

The SVN repository contains a libmesh_tests entry in the main trunk that contains a series of unit tests which can be used to validate a libMesh installation. You may download the tests via
 svn checkout https://libmesh.svn.sourceforge.net/svnroot/libmesh/trunk/libmesh_tests

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:
c++ -o foo foo.C `libmesh-config --cxxflags --include --ldflags`


Site Created By: libMesh Developers
Last modified: November 02 2009 15:33:16.

Hosted By:
SourceForge.net Logo