Skip to content

Adding a build type

Oleksii Oleksenko edited this page Feb 23, 2017 · 1 revision

Build is the first step of an experiment. It is controlled by Makefiles in two directories:

  • makefiles/: defines build parameters for different build types. Usually, it includes compilation flags and build variables. See makefiles/gcc_native.mk for a reference.
  • src/*/Makefile: defines benchmark-specific parameters. Each of such makefiles has to list source files (SRC) variable, benchmark name (NAME), together with required compilation flags and custom targets. See makefiles in src/parsec/*/ for a reference.

The resulting build is a combination of these two, with benchmark-specific parameters having higher priority than type-specific ones. For convenience, we also provide common.mk file which defines common variables (e.g., project directories) and generic build targets.

Example: compiling with -O2

To add a new build type, it is enough to create a corresponding file in makefiles/ directory. In this simple case it will contain only 3 lines:

include Makefile.gcc_native  # get generic GCC build variables
CCFLAGS := $(filter-out -O%,$(CCFLAGS))  # if optimization level is set elsewhere, remove it
CCFLAGS += -O2  # set optimization level to O2
Clone this wiki locally