Skip to content

Adding or removing source files

John W. Peterson edited this page Mar 9, 2017 · 7 revisions

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

autotools

Use libMesh-bundled autotools when generating *.in files from *.am files (below). That way the diff to *.in files will be minimal. Why? The diff can differ in size substantially depending on the autotools version. libMesh comes with *.in files generated with its bundled autotools, so if you are using your own (e.g., system-wide autotools) to generate the new *.in files, the diff may be huge. To set up libMesh-bundled autotools (assuming LIBMESH_SRC is set correctly):

cd $LIBMESH_SRC
./bootstrap --build-autotools 

To consistently use these tools, either permanently or temporarily modify your PATH to add contrib/autotools/bin.

PATH=$LIBMESH_SRC/contrib/autotools/bin:$PATH.  

Note that PATH does not play too well with relative pathnames.

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.

Clone this wiki locally