AOCL-Cryptography uses CMAKE as a build system generator and supports make and Ninja build systems. This document explains the different build flags which can be used to disable/enable specific features for the project. For a quick start into AOCL-Cryptography, please refer to AOCL-Cryptography Linux Quick Starter.
Run from build directory
$ cmake -DOPENSSL_INSTALL_DIR=[path_to_openssl_install_dir] -DAOCL_UTILS_INSTALL_DIR=[path_to_utils_install_dir] ../
$ make -j
$ cmake -G "Ninja" -DOPENSSL_INSTALL_DIR=[path_to_openssl_install_dir] -DAOCL_UTILS_INSTALL_DIR=[path_to_utils_install_dir] ../
$ ninja
- Enable Examples - To compile example/demo code.
- Enable AOCL-UTILS - To dispatch correct kernel with CPU identification.
- Enable DEBUG Build - To compile code in Debug Mode.
- Enable Address Sanitizer Support
- Enable Valgrind Memcheck Support
- Enable Bench - To compile bench code.
- Enable Tests - To compile test code
- Build docs in pdf form
- Build Doxygen and Sphinx docs
- Build with dynamic compiler selection
- Build with assembly disabled
- Disabling/Enabling Optional Features
To enable examples, append -DALCP_ENABLE_EXAMPLES=ON
to the cmake configuration command.
$ cmake -DALCP_ENABLE_EXAMPLES=ON ../
ALCP_ENABLE_EXAMPLES is ON by default
To enable aocl utils checks, append -DAOCL_UTILS_INSTALL_DIR=path/to/aocl/utils/source
and -DENABLE_AOCL_UTILS=ON
to the cmake configuration command.
$ cmake -DENABLE_AOCL_UTILS=ON -DAOCL_UTILS_INSTALL_DIR=path/to/aocl/utils/source ../
ENABLE_AOCL_UTILS is ON by default
To build in debug mode, append -DCMAKE_BUILD_TYPE=DEBUG
to the cmake configuration command.
$ cmake -DCMAKE_BUILD_TYPE=DEBUG ../
CMAKE_BUILD_TYPE is set to RELEASE by default
To enable sanitizers (asan, tsan etc), append -DALCP_SANITIZE=ON
to the cmake configuration command.
$ cmake -DALCP_SANITIZE=ON ../
ENABLE_AOCL_UTILS is OFF by default
In order to build ALCP to run binaries with valgrind to detect any memory leaks
$ cmake -DALCP_MEMCHECK_VALGRIND=ON ../
ALCP_MEMCHECK_VALGRIND is OFF by default
Note: Due to a known limitation in AOCL-Utils, any executables exercising RSA / EC routines might fail when ran with valgrind.
To build benchmarking support with alcp library, append -DALCP_ENABLE_BENCH=ON
to the cmake configuration command.
$ cmake -DALCP_ENABLE_BENCH=ON ../
ALCP_ENABLE_BENCH is OFF by default
Benchmarks will be built into bench/{algorithm_type}/
Please look into README.md from bench.
$ ./bench/{algorithm_type}/bench_{algorithm_type}
$ ./bench/digest/bench_digest --benchmark_filter=SHA2_<SHA SCHEME>_<Block Size>
$ ./bench/digest/bench_digest --benchmark_filter=SHA2_512_16 (runs SHA256 schemes for 16 block size)
$ ./bench/digest/bench_digest --benchmark_filter=SHA2 (runs for all SHA2 schemes and block sizes)
To enable tests, append -DALCP_ENABLE_TESTS=ON
to the cmake configuration command.
$ cmake -DALCP_ENABLE_TESTS=ON ../
ALCP_ENABLE_TESTS is OFF by default
Test executables can be found inside tests/{algorithm_type}
directory
For more details see README.md from tests.
$ ./tests/{algorithm_type}/test_{algorithm_type}
These documentations include design documents, Provider documentation etc in PDF format which will be generated.
$ cmake -DALCP_ENABLE_DOCS=ON ../
ALCP_ENABLE_DOCS is OFF by default
Note: Needs the proprietary font “Klavika” to be installed in the system
To enable sphinx documentation before running the CMAKE command install the required python dependencies by
cd aocl-crypto
pip install -r sphinx/requirements.txt
To enable the HTML documentations - Sphinx and doxygen
$ cmake -DALCP_ENABLE_HTML=ON ../
ALCP_ENABLE_HTML is OFF by default
To generate only the Doxygen html documentation without Sphinx documentation
$ cmake -DALCP_ENABLE_HTML=ON -DALCP_ENABLE_DOXYGEN=ON -DALCP_ENABLE_SPHINX=OFF ../
ALCP_ENABLE_DOXYGEN, ALCP_ENABLE_SPHINX both are OFF by default
If this option is enabled it will dynamically select between gcc/clang for compiling certain files to improve performance.
$ cmake -DALCP_ENABLE_DYNAMIC_COMPILER_PICK=ON ../
ALCP_ENABLE_DYNAMIC_COMPILER_PICK is on by default
$ cmake -DALCP_DISABLE_ASSEMBLY=ON ../
ALCP_DISABLE_ASSEMBLY is OFF by default
By default all of the below features are OFF and they can be enabled optionally by setting their corresponding flags to ON
- To enable multi update feature for all supported ciphers append
-DALCP_ENABLE_CIPHER_MULTI_UPDATE=ON
to build flags. - To Enable CCM multi update feature append flag
-DALCP_ENABLE_CCM_MULTI_UPDATE=ON
to build flags. - To Enable OFB multi update feature append flag
-DALCP_ENABLE_OFB_MULTI_UPDATE=ON
to build flags.