-
Notifications
You must be signed in to change notification settings - Fork 297
Adding a new example
John W. Peterson edited this page Apr 13, 2016
·
15 revisions
There are a few "boilerplate" steps required when adding a new example.
- Choose a category which fits your example (adaptivity, adjoints, etc), create a new directory, and add the necessary source and header files.
- Copy a Makefile.am from one of the other examples (e.g. examples/adjoints/adjoints_ex1/Makefile.am) to your new example. Fill in the
install_dir
,data
, andCLEANFILES
variables with values relevant to your example. - Copy over a
run.sh
from one of the other examples (e.g. examples/adjoints/adjoints_ex1/run.sh) and update theexample_name
andexample_dir
variables appropriately. - Add a line to the
SUBDIRS
variable inexamples/Makefile.am
for your new example. - Add a line to the
AC_CONFIG_FILES
section of top-levelconfigure.ac
for your new example. - Run
./bootstrap
at the top level (it is best to use the bundledautotools
when bootstrapping):
PATH=`pwd`/contrib/autotools/bin:$PATH ./bootstrap
Note that the reason for using `pwd`
instead of the simpler .
is that PATH
might not work correctly with relative paths on it.
- Check in the bootstrap changes:
git commit -am"Ran boostrap for the new example."
- Add a Table of Contents entry for the new example in doc/html/src/examples.html.