Current build system uses Cmake.
- Ubuntu 16.04/18.04/20.04
- C++17 capable compiler (tested with GCC 9.3)
- CMake 3.12
- GMP >=6.2.0 from http://www.gmplib.org or
apt-get install libgmp-dev
- NTL >=11.5.1 from https://libntl.org/download.html or
apt-get install libntl-dev
For a quick guide on getting started with the HElib CPU Reference Backend, please refer to the Quickstart Guide. Otherwise, for a more detailed walkthrough on modifying the build configuration / running this backend, continue below.
By default, the build system will pull the required third-party component versions from remote repos and build locally. Thus, this build system requires Internet access and being able to clone the required third-party repos using git
.
The majority of warnings generated by third-party libraries are shown by default. If users want to hide these (e.g. to make debugging this project easier), set CMake flag -DHIDE_EXT_WARNINGS=ON
. This will hide most warnings generated by third-party components built by this build system.
If no build type is specified, the build system will build in Debug mode. Use -DCMAKE_BUILD_TYPE
configuration variable to set your preferred build type:
-DCMAKE_BUILD_TYPE=Debug
: debug mode (default if no build type is specified).-DCMAKE_BUILD_TYPE=Release
: release mode. Compiler optimizations for release enabled.-DCMAKE_BUILD_TYPE=RelWithDebInfo
: release mode with debug symbols.-DCMAKE_BUILD_TYPE=MinSizeRel
: release mode optimized for size.
Users can pull, build and pre-install the required third-party components. This feature is mostly tailored for development, testing, and debugging. Otherwise, using the default behavior is recommended and this section can be skipped.
If no pre-installed version of a component is found, the correct version will be pulled from remote repo and build locally.
The build system will search for pre-installed third-party components in each of the locations below, in order, until one is found:
-D{COMPONENT_NAME}_INCLUDE_DIR
and/or-D{COMPONENT_NAME}_LIB_DIR
(lib dir is not needed for header only components).-D{COMPONENT_NAME}_INSTALL_DIR
/usr/local
Note that if pre-installed versions are incompatible with the current version of the frontend, the build will fail.
Also note that specific details on how this backend is being configured in cmake can be found inside the top level CMakeLists.txt.
See the following sections for the specific configuration variable names for each required third-party component.
This backend requires the following third party components:
- HEBench API Bridge
- HElib Homomorphic Encryption Library: HElib (v2.2.1).
The API Bridge is the component in HEBench that allows communication between Test Harness and backends.
If API Bridge has been pre-built, users can point the build system to the pre-installed version of API Bridge using the following CMake config variables:
-DAPI_BRIDGE_INCLUDE_DIR
: include
directory for API Bridge.
-DAPI_BRIDGE_LIB_DIR
: lib
directory for API Bridge.
-DAPI_BRIDGE_INSTALL_DIR
: base directory for API Bridge. Contains both include
and lib
. This will be used if any of the previous config variables for API Bridge have not been set.
If HElib has been pre-built, users can point the build system to the pre-installed version using the following CMake config variables:
-DHELIB_INCLUDE_DIR
: include
directory for HElib.
-DHELIB_LIB_DIR
: lib
directory for HElib.
-DHELIB_INSTALL_DIR
: base directory for HElib. Contains both include
and lib
. This will be used if any of the previous config variables for HElib have not been set.
Build from the top level of helib-backend
with Cmake as follows:
# assuming helib-cpu is already cloned
cd ~/helib-cpu
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_LOCATION # change install location at will, and/or specify pre-installed third-party directories here
make -j
make install # install built components
The install step will copy the target backend library libhebench_helib_backend.so
to $INSTALL_LOCATION/lib
If not using pre-installed frontend, make install
will include the frontend components as part of the installation.
Once the backend has been built and installed successfully (assuming it has been installed to $INSTALL_LOCATION
), the frontend Test Harness can run the benchmark as follows:
test_harness --backend_lib_path $INSTALL_LOCATION/lib/libhebench_helib_backend.so --report_root_path $REPORT_OUTPUT_PATH
The Test Harness will save the reports and summary of the run to the path specified in $REPORT_OUTPUT_PATH
.
This project welcomes external contributions. To contribute to HEBench, see CONTRIBUTING.md. We encourage feedback and suggestions via Github Issues as well as discussion via Github Discussions.