Instructions for installing GMP and NTL

This section describes how to install GMP and NTL onto your system, and how to use them in OpenFHE. Install autoconf if it is not already present: .. topic:: on Linux

sudo apt-get install autoconf
brew install autoconf
pacman -S autoconf

Note

scroll to the bottom for an all-in-one install script

The standard binary install using tools like apt-get will not work, and manual installation of GMP and NTL from the source code is needed. The steps are detailed below.

Installing GMP and NTL for OpenFHE:

  1. First, download gmp-6.1.2.tar.lz from https://ftp.gnu.org/gnu/gmp/

wget https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.lz
  1. Unpack:

tar --lzip -xvf gmp-6.1.2.tar.lz

Note

You may need to install lzip - Debian based systems:sudo apt-get install lzip

  1. Build and install GMP (installed in /usr/local/lib by default):

1cd ./gmp-6.1.2
2./configure
3make
4make check
5sudo make install
  1. Download ntl-10.5.0.tar.gz from http://www.shoup.net/ntl/download.html

wget https://libntl.org/ntl-10.5.0.tar.gz
  1. Unpack:

tar -xvf ntl-10.5.0.tar.gz
  1. Build and install NTL (https://libntl.org/doc/tour-unix.html) (in /usr/local/lib by default):

cd ./ntl-10.5.0/src
./configure NTL_THREADS=on NTL_THREAD_BOOST=on NTL_EXCEPTIONS=on SHARED=on NTL_STD_CXX11=on NTL_SAFE_VECTORS=off TUNE=generic
make
make check
sudo make install

GMP AND NTL INSTALL

GMP

 1curl -O https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.lz
 2tar --lzip -xvf gmp-6.1.2.tar.lz
 3( \
 4  cd ./gmp-6.1.2 || exit; \
 5  ./configure; \
 6  make; \
 7  make check; \
 8  sudo make install; \
 9  cd ..; \
10)
11
12rm gmp-6.1.2.tar.lz
13rm -rf gmp-6.1.2

NTL

 1curl -O https://libntl.org/ntl-10.5.0.tar.gz
 2tar -xvf ntl-10.5.0.tar.gz
 3( \
 4  cd ./ntl-10.5.0/src || exit; \
 5  ./configure NTL_THREADS=on NTL_THREAD_BOOST=on NTL_EXCEPTIONS=on SHARED=on NTL_STD_CXX11=on NTL_SAFE_VECTORS=off TUNE=generic; \
 6  make; \
 7  make check; \
 8  sudo make install; \
 9  cd ../.. \
10)
11
12rm ntl-10.5.0.tar.gz
13rm -rf ntl-10.5.0