PEP is an acronym for "Polymorphic Encryption and Pseudonymization". The software provides a data repository featuring secure and privacy friendly data storage and dissemination. More information is available on the project home page, which also contains a link to the user documentation.
-
Install required packages (ubuntu packages in monospace)
git- conan (e.g. via
pipx) cmake3.28 or newer (see https://apt.kitware.com/ for how to get this for older versions of debian-based OSs)- ninja (
ninja-build) clang(v18 is known to work (01-2024); see https://apt.llvm.org/ for how to get recent versions for older versions of debian-based OSs) (g++supported but not recommended for compiler performance reasons related to templates & RxCpp)- C++ STL, e.g.
libstdc++-dev(v13 is known to work (01-2024), see https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test for how to get recent versions likelibstdc++-13-devon older Ubuntu-based OSs) - For Qt GUI: APT packages can be installed via Conan, or pass
-o'&:use_system_qt=False'toconan installto use Conan package instead - For Go watchdog:
-
Install the
golangpackage (version 1.21 or newer. See https://launchpad.net/%7Elongsleep/+archive/ubuntu/golang-backports, if you use a linux distro based on Ubuntu 22.04) -
set environment variables (e.g. in
.bashrcor.zshrc):export GOPATH="$HOME/go" export PATH="$GOPATH/bin:$PATH"
-
install the Go protobuf compiler:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
-
-
Clone repository including submodules (
--recurse-submodules) -
Create Conan profile:
CC=clang CXX=clang++ ./docker-build/builder/conan/init_conan_profile.sh
Note: Conan <2.3 may not pick up your default compiler (
cc/c++) withoutCC/CXX. -
Build dependencies and generate CMake presets:
conan install ./ --build=missing -s:a build_type=Debug
- This creates a build folder like
./build/Debugon your system.Debugmay also be e.g.Release. See./conanfile.pyfor options that you can pass via-o name=value, e.g.-o with_assessor=Falseto disable the Qt GUI. These options can also be put in your profile under[options]as e.g.pep/*:with_assessor=False. - If you are not going to use
windeployqt/maydeployqt, you can also pass-s build_type=Debuginstead of-s:a ..., to build tools likeprotocasRelease. - It is also possible to build dependencies as
Releasebut PEP asDebug. For this, useconan install ./ --build=missing -s "&:build_type=Release"(&means the consuming package, so pep). - You only need to repeat this command if you: delete the build folder, change
conanfile.py, change your compiler, or want to update dependencies (pass--update). - If this fails, you can try using the lockfile that the CI uses, via
--lockfile=./docker-build/builder/conan/conan-ci.lock.
- This creates a build folder like
-
Configure using cmake:
cmake --preset conan-debug
(or e.g.
conan-release). If you have an older CMake version, you can instead use the CMake configure command that Conan prints at the end.- Make sure you see CMake print that the Conan toolchain is used. If it's not, delete
build/Debug/CMakeCache.txtand reconfigure; this can happen if you configured before without using the Conan preset/toolchain.
- Make sure you see CMake print that the Conan toolchain is used. If it's not, delete
-
Build:
cmake --build --preset conan-debug
(Use
--target <...> [...]to specify targets to build, e.g. justpepcli). If you have an older CMake version, you can specify the build folder (e.g../build/Debug) instead of the preset. You could also e.g. callninjain the build folder. -
Run servers locally:
cd ./build/Debug/cpp/pep/servers/ && ./pepServers
-
Interact with cli:
./build/Debug/cpp/pep/cli/pepcli --help
-
To enable autocompletion for the CLI tools, see
autocomplete/README.md.
You can create separate build folders using -o subbuild_name <...>, for example:
conan install ./ --build=missing -o subbuild_name=ppp -o cmake_variables="CASTOR_API_KEY_DIR=~/pep/ops/keys/;PEP_INFRA_DIR=~/pep/ppp-config/config/acc/;PEP_PROJECT_DIR=~/pep/ppp-config/config/acc/project/"Building on Windows can be done very similar to on *nix.
- Install prerequisites such as git and a toolchain.
- Install Conan: see Conan documentation, or via
winget install conan - Optionally (recommended for ease of use) enable creation of symbolic links:
- First in the Windows settings by enabling 'Developer Mode'
- Then in git via
git config --global core.symlinks true(if you did this with an existing repo, you may need to remove the--globalflag and do agit restore ./conanfile.pyafter) - Alternatively: use
./docker-build/builder/conan/conanfile.pyinstead of./inconan install(or just use.\scripts\cmake-vs.bat)
- Clone repository including submodules (
--recurse-submodules) - When using Visual Studio, you may use
.\scripts\cmake-vs.batinside a Visual Studio command prompt and open the generated solution. Otherwise, proceed like on *nix- To update dependencies, pass
--updateas theConan argswhen invoking thecmake-vs.batfrontend.
- To update dependencies, pass
If the (Conan-based) meson build fails because your Python executable "is not a valid python or it is missing distutils", then run "python -m pip install --upgrade setuptools" to fix things. See https://stackoverflow.com/a/78050586 .
Multiconfig builds (using the same folder for Debug & Release) are currently not supported, so always pass a build type.
To ease the job of working with the docker-build submodule, you may want to execute these git commands:
git config --global submodule.recurse true
git config --global submodule.propagatebranches true
git config --global status.submodulesummary trueSee the separate instructions and guidelines if you wish to contribute to the PEP project.