Skip to content

Adding or removing source files

John W. Peterson edited this page Sep 11, 2017 · 7 revisions

When adding or removing .h or .C files in libMesh, use the following procedure.

autotools

First, you must follow the instructions for setting up the libmesh-specific autotools.

Directories

If new components (i.e., new subdirectories) were added to the source/header directories, update the shell scripts that detect the new source/header files by editing $LIBMESH_SRC/include/rebuild_libmesh_HEADERS.sh to add the new header directory to the headers list of directories $LIBMESH_SRC/src/rebuild_libmesh_SOURCES.sh to add the new source directory to the sources list of directories.

Files

To update the list of source and header files, run these commands:

cd $LIBMESH_SRC
cd include && ./rebuild_include_HEADERS.sh
cd ..
cd src && ./rebuild_libmesh_SOURCES.sh
cd .. 
cd include/libmesh && ./rebuild_makefile.sh
cd -
git commit -am"Update Makefile.am files."
PATH=`pwd`/contrib/autotools/bin:$PATH ./bootstrap 
git commit -am"Run bootstrap."

Note that include/libmesh/rebuild_makefile.sh uses /bin/sh, which might produce undesirable artifacts on some systems (e.g., -n in place of newline characters). If that happens, you might notice a large diff in Makefile.am related to BUILT_SOURCES. In that case use

bash ./rebuild_makefile.sh

in the above.