Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
PALISADE Development
PALISADE Development
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 2
    • Merge Requests 2
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • PALISADE
  • PALISADE DevelopmentPALISADE Development
  • Wiki
  • Instructions for building PALISADE in Linux

Last edited by Yuriy Polyakov Jun 17, 2020
Page history

Instructions for building PALISADE in Linux

Ubuntu

  1. Install pre-requisites (if not already installed) and set the default compiler.

For g++

Install g++, cmake, make, and autoconf. Sample commands using apt-get are listed below. It is possible that these are already installed.

sudo apt-get install build-essential #this already includes g++
sudo apt-get install cmake
sudo apt-get install autoconf

Note that "sudo apt-get install g++-" can be used to install a specific version of the compiler. You can use "g++ --version" to check the version of g++ that is found by the system.

For clang

Typically g++ is the default compiler for Linux but clang++ can also be installed.

First install clang++, e.g., "sudo apt-get install clang-9" to install clang 9.

If installing an older version of clang, e.g., v6, you may also need to install OpenMP. The commands for this case are

sudo apt-get install clang
sudo apt-get install libomp5
sudo apt-get install libomp-dev

Then run the following two commands to configure clang/clang++ as the default compiler for C and C++ (default paths are used here). For clang 9:

export CC=/usr/bin/clang-9
export CXX=/usr/bin/clang++-9

For a default version of clang, e.g., v6 in Ubuntu 18.04:

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
  1. Clone the repo.

  2. Download submodules:

git submodule sync --recursive
git submodule update --init  --recursive
  1. Create a directory where the binaries will be built. The typical choice is a subfolder "build". In this case, the commands are:
mkdir build
cd build
cmake ..

Note that cmake will check for any system dependencies that are needed for the build process.

  1. The PALISADE distribution includes some external libraries, such as GMP. NTL and tcmalloc. If you want to use any of these libraries, enable them when you run cmake to force them to build (see instructions on cmake options).

  2. Build PALISADE by running the following command (this will take few minutes; using the -j make command-line flag is suggested to speed up the build)

make
  1. Install PALISADE in a system directory (if desired or for production purposes)
make install

You would probably need to run "sudo make install" unless you are specifying some other install location. You can change the install location by running "cmake -DCMAKE_INSTALL_PREFIX=/your/path ..".

Testing and cleaning the build

Run unit tests to make sure all capabilities operate as expected

make testall

Run sample code to test, e.g.,

bin/examples/pke/simple-integers

To remove the files built by make, you can execute

make clean

To change the compiler, e.g., from g++ to clang++, or completely remove any cmake/make build files, delete the "build" folder and recreate it.

Installing pre-requisites for doxygen

To generate doxygen documentation, doxygen and graphviz dot need to be installed:

sudo apt-get install doxygen
sudo apt-get install graphviz

CentOS

The installation process is the same as in Ubuntu except for using yum instead of apt-get in Step 1. Here we provide additional notes specific to CentOS.

You may need to install cmake v3.x using the following commands:

sudo yum install cmake3
ln -s /usr/bin/cmake3 ~/bin/cmake

If you need to install a specific version of gcc, do the following (this example is for g++ v7):

sudo yum install devtoolset-7-gcc-c++
Clone repository
  • Build instructions
  • CI Documentation
  • Cross Compiling for ETTIS
  • Frequently Asked Questions
  • Home
  • How to rebase your branch from the master branch
  • Instructions for building PALISADE in Linux
  • Instructions for building PALISADE in Windows
  • Instructions for building PALISADE in macOS
  • Instructions for building user projects that use PALISADE
  • Known Issues
  • Library Directory Structure
  • PALISADE Contributors
  • PALISADE Programming Style Design Guide
  • Palisade Exceptions
View All Pages