Building

The Build System

PDCLib is built with Jam. The only tested and supported version is FT Jam 2.5.3rc2, which you can find here.

Compilers

PDClib requires at minimum a C99 capable compiler, and recommends a C11 capable one. The following compilers are suggested:

  • Recent versions of GCC (GPLv3)
  • Recent versions of Clang (UUIC) (in C99 mode; Clang's C11 mode is not yet sufficiently functional)

Compilers which are partially working

  • OpenWatcom: PDCLib builds on OpenWatcom, but the test suite does not link.

Other compilers which may work, but are untested:

Compilers which will not work

  • Microsoft Visual C(++), as it lacks C99 support (and Microsoft have explicitly stated that this is not an aim)

Future directions include a better compiler abstraction and detection system.

Specify the C compiler to be used to build PDClib with the CC environment variable.

Linkers & Librarians

The PDCLib tests at present assumes GNU LD, or compatible linker. Removing this requirement is a target.

PDCLib itself requires a simple librarian.

Building

PDCLib itself can be built by issuing

# Win32 only: must specify which toolchain is in use
export JAM_TOOLSET=MINGW
# If not building for the host platform
export PDCLIB_PLATFORM=your_platform 
# -q will cause Jam to exit after the first error.
jam -q

To speed up the compilation, you may wish to pass -jN (where N is the number of processes to run in parallel) as a parameter to Jam, as this will speed up the compilation.

Running tests

PDClib includes two sets of tests:

  • The standard tests, executed by running jam test. These are built against PDCLib itself, and are therefore form a functionality test suite
  • "regtests", which are executed by running jam regtest. These the mostly same tests, but run against your compiler's default C library. They serve two functions:
    • They enable you to test the conformance of your system's existing C library
    • They provide a mechanism for testing our tests - while executing correctly on the host system does not imply they are correct, failing to execute is an indicator that the test should be re-checked agianst the standard.