FAQ Build system overview

From DANSE

The build system uses make and shell scripts for compiling, linking, and deploying C, C++, Fortran, and Python source code distributions. The programmer controls all of these steps by a carefully structured set of Make files and environment variables.

There are several steps to successfully using the build system. These are:

  1. configuring your environment: you must set a number of environment variables. These mostly control where things are found. It is customary to set these variables in a file called .tools that lives in your home directory and gets sourced by the appropriate login script.
  2. Settings for compilers, targets, platforms, etc are all made in *.def files. Many such files come with the config package.
    • For example, config/compilers/gcc-3.0 has files called c.def, cpp.def, f77.def, etc. These files define variables that control compiler flags like -O2 etc. for the gcc version 3.0 compiler.
    • Include external packages like Python (or HDF etc.) is controlled by the *.def files in config/external/Python (or HDF etc.). These files add the package include and library directories to variables which are eventually processed into the compiler command line. So project level Make.mm files and local.def files should never have this kind of information in them.
  3. Finally, local files describe your package.
    • Make.mm describes what targets to build, and what the sources are
    • local.def is the place to include the .def files describing extrernal packages (for instance, include HDF5/default.def), and also the place to add things that are peculiar to your project (for example, CXX_DEFINES += -DTHIS_IS_MY_PACKAGE).

For more in-depth information, see the build system tutorial

Personal tools
Document Uploads/Links