The main project README.md outlines the simplest way to build from source and what prerequisites are required. This page outlines other ways building. The build is always two-stage: external dependencies, followed by piac itself. The rationale is that the former can take long but is usually done once, while the latter is frequent and, since it is independent of the former, quick.
Specify the build type to cmake:
# Build external libraries
mkdir -p external/build && cd external/build && cmake .. && make && cd -
# Build piac
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make && cd -
# Test piac (optional)
cd build && ctest
Specify the clang compilers to both cmake calls:
# Build external libraries
mkdir -p external/build && cd external/build && cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. && make && cd -
# Build piac
mkdir build && cd build && cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. && make && cd -
# Test piac (optional)
cd build && ctest
You can also pass -GNinja
to either or both cmake calls:
# build external libraries
mkdir -p external/build && cd external/build && cmake -GNinja .. && ninja && cd -
# build piac
mkdir build && cd build && cmake -GNinja .. && ninja && cd -
# test piac (optional)
cd build && ctest
mkdir build && cd build && cmake -GNinja ..
ninja doc
firefox --new-tab doc/html/index.html
In debug mode:
mkdir build && cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=on ..
ninja test_coverage
firefox --new-tab doc/html/DEBUG/test_coverage/index.html
ninja cppcheck-xml
firefox --new-tab doc/html/DEBUG/cppcheck/index.html
In release/optimized mode:
mkdir build && cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCOVERAGE=on ..
ninja test_coverage
firefox --new-tab doc/html/RELEASE/test_coverage/index.html
ninja cppcheck-xml
firefox --new-tab doc/html/RELEASE/cppcheck/index.html