CopperSpice Overview  1.5.1
Build Overview

A key objective for CopperSpice was to create a C++ library which used a standard build process. CopperSpice can be built using CMake or the GNU Autotools system. To ensure the build process is working properly both build systems are tested in our continuous integration Jenkins system.

There are several configuration options available when building CopperSpice. These options can be set by passing flags to the configure script.

For platform specific GCC and clang compiler requirements on Unix, Linux, FreeBSD, Windows, and Mac OS X refer to the Supported Platforms table.


CMake

CopperSpice requires CMake version 3.4.3 or newer.

For additional information about CMake refer to the following link:   CMake

CMake Build Process

The build process using CMake consists of two basic steps.

Step 1  Configure CopperSpice by running cmake

The following command will configure CopperSpice for a release version. If you need to pass any CFLAGS or CXXFLAGS they should be set in your environment or passed on the command line.

cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release [path_to_copperspice]

Step 2  Compile CopperSpice by running the following command.

ninja

To generate a package use one of the following commands.

cpack -G ZIP
cpack -G TGZ

 


Autotools

Autotools is a suite of programming tools designed to assist in making source code packages portable to many Unix-like systems. The GNU build system uses Bourne-compatible shell scripts to assist the user in the configuration and build process.

(1)   Autoconf is a tool used for producing configure scripts for building, installing, and packaging software. This tool makes your packages portable by performing tests to discover system characteristics, before the package is compiled. Your source code can be modified to leverage platform specifics.

The system on which you build, does not need to have Autoconf installed. Autoconf is needed only to generate the configure script, which is usually shipped with the software. We provide the configuration script with the CopperSpice source.

CopperSpice uses Autoconf version 2.67 or greater.

(2)   Automake is a tool for generating a portable 'Makefile' of what to build. Automake substantially simplifies the process of describing the organization of a package and performs additional functions such as dependency tracking between source files.

Automake is written in the Perl programming language and must be used with GNU Autoconf. On Windows Perl is installed as part of the MSYS project.

CopperSpice requires Automake version 1.12.1 or greater.

(3)   The GNU build system is widely used in many open source packages.

CopperSpice uses GNU Make version 3.81 or greater.

For additional information about Autotools refer to the following links:

   Autotools Wiki
   Autoconf
   Automake
   GNU Make

Autotools Build Process

The build process with Autotools consists of three basic steps.

(1)  This step is normally not required since the CopperSpice source distribution includes the generated configuration files. Any time the files configure.ac or Makefile.am are modified, the following command must be run to generate new configuration files.

autoreconf -i

For reference, autoreconf uses configure.ac to generate configure and then Makefile.am to create Makefile.in.


(2)  The configure script uses Makefile.in to generate the actual Makefile used to build CopperSpice.

./configure


(3)  To compile CopperSpice use the following command.

make


When running GNU make there is a "-j N" parameter which can be passed to specify the number of cores make should use. Make will start multiple parallel jobs, which can speed up compiling considerably. There is no clear recommend value for N. We found the best value is the numbers of processor cores plus 1.

It is worth noting that using this parameter will alter the order source files are compiled. This may look a bit strange but it is normal and expected since multiple processes are running.