MeshKit  1.0
Frequently Asked Questions

I'm implementing a new algorithm; should I put the source files directly in src/algs, or add a new subdirectory below that?
In general, if there are fewer than about 4 new files, put them in algs, otherwise put them in a new subdirectory.

How do I add a new subdirectory, e.g. a new mesher with multiple files, to the MeshKit source?
Let's say you have a new algorithm, myalg, that is implemented in several files. If that number of files is greater than about 4, we recommend you put it in its own subdirectory, under the src/algs directory in the MeshKit source. To integrate this with the MeshKit autotools-based build process, do the following steps:

  1. Create your subdirectory src/algs/myalg and its include directory src/algs/myalg/meshkit
  2. In src/algs/myalg/meshkit, put any include files you expect the application to see; these are the headers that contain the API to your new mesher.
  3. Put the remaining files, both header and source files, in src/algs/myalg.
  4. In the top-level configure.ac file, just before the end of the file, add a line to create the src/algs/myalg/Makefile (make it look like the others).
  5. In src/algs/Makefile.am, add myalg to the list of directories assigned to SUBDIRS
  6. In src/algs/Makefile.am, add your library to the LIBADD list for libMeshkitalgs.la
  7. Add your directory to the AM_CPPFLAGS in src/algs/Makfile.am so that you can include your algorithm in src/algs/register_algs.cpp
  8. Add an entry to src/algs/register_algs.cpp to register your algorithm with MKCore. (See Writing A New MeshOp Class).
  9. In src/algs/myalg, create a Makefile.am. It is probably easiest to copy an existing one from elsewhere (e.g. some other subdir of algs/).
  10. Append to AM_CPPFLAGS the list of places that you expect the compiler to search for header files. Keep in mind that for building in a separate directory from the source directory to work you will need to prefix paths with $(srcdir)/.
  11. In the variable nobase_libMeshKitmyalg_la_include_HEADERS, substitute the names of all the files you put in src/algs/myalg/meshkit
  12. Put the names of all the files you put in src/algs/myalg in libMeshKitmyalg_la_SOURCES (including the header files there)
  13. In the top-level MeshKit directory, run autoreconf -fi
  14. Run make; the code in myalg should build

Top: MeshKit: A Library for Mesh Generation Prev: MeshKit: A Library for Mesh Generation Next: MeshKit: A Library for Mesh Generation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines