Installation

Here is the guide for the installation of FedTree.

Contents

Prerequisites

  • CMake 3.15 or above

  • GMP library

  • NTL library

  • gRPC 1.50.0 (required for distributed version)

You can follow the following commands to install NTL library.

wget https://libntl.org/ntl-11.5.1.tar.gz
tar -xvf ntl-11.5.1.tar.gz
cd ntl-11.5.1/src
./configure SHARED=on
make
make check
sudo make install

If you install the NTL library at another location, please pass the location to the NTL_PATH when building the library (e.g., cmake .. -DNTL_PATH=”PATH_TO_NTL”).

For gRPC, please remember to add the local bin folder to your path variable after installation, e.g.,

export PATH="$gRPC_INSTALL_DIR/bin:$PATH"

We suggest you install gPRC 1.50.0, i.e., using -b v1.50.0 when cloning gRPC repo.

If your gRPC version is not 1.50.0, you need to go to src/FedTree/grpc directory and run

protoc -I ./ --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ./fedtree.proto
protoc -I ./ --cpp_out=. ./fedtree.proto

Clone Install submodules

Run the following commands:

git clone https://github.com/Xtra-Computing/FedTree
cd FedTree
git submodule init
git submodule update

Build on MacOS

On MacOS, you can use Apple Clang to build FedTree.

Build with Apple Clang

Install libomp if you haven’t:

brew install libomp

Run the following commands:

mkdir build
cd build
cmake -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" \
  -DOpenMP_C_LIB_NAMES=omp \
  -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" \
  -DOpenMP_CXX_LIB_NAMES=omp \
  -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib \
  ..
make -j

Building Options

There are the following building options passing with cmake.

  • USE_CUDA [default = OFF]: Whether using GPU to accelerate homomorphic encryption or not. It is available only when setting DISTRIBUTED to OFF.

  • DISTRIBUTED [default = ON]: Whether building distributed version of FedTree or not.

  • NTL_PATH [default = /usr/local]: The PATH to the NTL library.

For example, if you want to build a version with GPU acceleration, distributed version with NTL library under /home/NTL directory, you can use the following command.

cmake .. -DUSE_CUDA=ON -DDISTRIBUTED=ON -DNTL_PATH="/home/NTL"
make -j