Skip to content

Public mirror of the core repository of PEP

License

Notifications You must be signed in to change notification settings

chiefruds/pep-clone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

912 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PEP

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.

Building

Building on *nix

  1. Install required packages (ubuntu packages in monospace)

    • git
    • conan (e.g. via pipx)
    • cmake 3.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 like libstdc++-13-dev on older Ubuntu-based OSs)
    • For Qt GUI: APT packages can be installed via Conan, or pass -o'&:use_system_qt=False' to conan install to use Conan package instead
    • For Go watchdog:
      • Install the golang package (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 .bashrc or .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
  2. Clone repository including submodules (--recurse-submodules)

  3. 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++) without CC/CXX.

  4. Build dependencies and generate CMake presets:

    conan install ./ --build=missing -s:a build_type=Debug
    • This creates a build folder like ./build/Debug on your system. Debug may also be e.g. Release. See ./conanfile.py for options that you can pass via -o name=value, e.g. -o with_assessor=False to 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=Debug instead of -s:a ..., to build tools like protoc as Release.
    • It is also possible to build dependencies as Release but PEP as Debug. For this, use conan install ./ --build=missing -s:a build_type=Release -s "&:build_type=Debug" (& 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.
  5. 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.txt and reconfigure; this can happen if you configured before without using the Conan preset/toolchain.
  6. Build:

    cmake --build --preset conan-debug

    (Use --target <...> [...] to specify targets to build, e.g. just pepcli). 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. call ninja in the build folder.

  7. Run servers locally:

    cd ./build/Debug/cpp/pep/servers/ && ./pepServers
  8. Interact with cli:

    ./build/Debug/cpp/pep/cli/pepcli --help
  9. To enable autocompletion for the CLI tools, see autocomplete/README.md.

Separate build folders

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

Building on Windows can be done very similar to on *nix.

  1. Install prerequisites such as git and a toolchain.
  2. Install Conan: see Conan documentation, or via winget install conan
  3. Optionally (recommended for ease of use) enable creation of symbolic links:
    1. First in the Windows settings by enabling 'Developer Mode'
    2. Then in git via git config --global core.symlinks true (if you did this with an existing repo, you may need to remove the --global flag and do a git restore ./conanfile.py after)
    3. Alternatively: use ./docker-build/builder/conan/conanfile.py instead of ./ in conan install (or just use .\scripts\cmake-vs.bat)
  4. Clone repository including submodules (--recurse-submodules)
  5. When using Visual Studio, you may use .\scripts\cmake-vs.bat inside a Visual Studio command prompt and open the generated solution. Otherwise, proceed like on *nix
    • To update dependencies, pass --update as the Conan args when invoking the cmake-vs.bat frontend.

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.

Useful git config options

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 true

Contributing

See the separate instructions and guidelines if you wish to contribute to the PEP project.

About

Public mirror of the core repository of PEP

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 75.6%
  • Shell 7.4%
  • Python 5.9%
  • Go 3.6%
  • C 3.4%
  • CMake 2.6%
  • Other 1.5%