-
Notifications
You must be signed in to change notification settings - Fork 89
Building HAL
If you plan to use HAL for your own research, we strongly recommend building it yourself instead of using our ppa. HAL officially supports (and is tested for) Ubuntu 20.04 LTS and macOS only, but you are free to add support for other platforms.
If you want to build HAL on your machine, run the following commands:
git clone https://github.com/emsec/hal.git && cd hal- To install all neccessary dependencies execute
./install_dependencies.sh mkdir build && cd build-
cmake ..+ your desired configuration (see below) make-
make install(optionally)
Using the CMake build system, the HAL build can be configured quite easily (by adding -D<OPTION>=1 to the cmake command).
Here is a selection of the most important options:
-
BUILD_TESTS: builds all available tests which can be executed by runningctestin the build directory. This also builds all tests provided by the enabled plugins. -
PL_<plugin name>: enable (or disable) building a specific plugin -
BUILD_ALL_PLUGINS: all-in-one option to build all available plugins, overrides the options for individual plugins -
BUILD_DOCUMENTATION: build the C++ and Python documentation -
SANITIZE_ADDRESS,SANITIZE_MEMORY,SANITIZE_THREAD,SANITIZE_UNDEFINED: builds with the respective sanitizers (recommended only for debug builds)
The default CMAKE_BUILD_TYPE (if not otherwise specified by the user) is set to Release.
Please make sure to use a compiler that supports OpenMP. You can install one using, e.g., Homebrew via: brew install llvm.
To let cmake know of the custom compiler use following command.
cmake .. -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++