Skip to content

Installing E3

Your Name edited this page Mar 24, 2021 · 5 revisions

This section outlines how you can install and build E3 in a Windows, Linux/Ubuntu and MacOS environment. The contents of this page include:

E3 Dependencies

E3 requires the following tools to run:

  • git
  • bash, sh
  • make (at least version 3.79.1)
  • a C++ compiler that supports C++17 (GNU G++, GCC ( ver >=5.4.0 ) for Linux; cl ( ver >= 19.10 ) for Windows)

Git can be installed easily on Windows, Linux, or Mac using the commands found in the official git documentation: https://git-scm.com/downloads. For Ubuntu users, Git can be installed using the following command:

 apt-get install git

Setting Up E3 in MacOS

Please make sure that in terminal you can run the following commands: git, g++, make. If any of those commands are missing, follow the standard Apple recommendation for their installation.

Setting Up E3 in Windows

To build E3 in Windows 2 components have to be installed:

  1. Microsoft C++ compiler
  2. Command line building tools In this instruction we describe the simplest way to install those.

Install Microsoft Visual Studio for C++ desktop. This installation creates a VS directory in Program Files. The specific versions may be different. Note a file vcvars64.bat in

C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build

Install MSYS2 from https://www.msys2.org/wiki/MSYS2-installation/ Node the directory in which it is installed, e.g. C:\msys64. Once Msys installed run its shell and install git and make by executing the following command

pacman -S make
pacman -S git

Start command line cmd and setup VS compiler variables by:

C:\>

C:\>cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build>vcvars64.bat
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.3
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28315 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build>

Now cl works as in the example above.

Add Msys environment by

set PATH=c:\msys64\usr\bin;%PATH%

And navigate to a working directory of your choice. At this moment you should be able to invoke commands cl, make, git.

Building E3 (Linux, Windows, MacOS)

After installing the dependencies and setting up the environment, follow these steps to build E3:

  1. Clone the E3 Github repository:
git clone https://github.com/momalab/e3.git
  1. Navigate into the e3/src directory and run the make command to test E3 compilation:
cd e3/src
make
make bob
make alice

For MacOS please create a file macos in e3/src:

cd e3/src
touch macos

Installing External Encryption Libraries

E3 supports the following external FHE libraries:

Library Windows Linux MacOS
TFHE yes yes no
SEAL yes yes no
PALISADE yes yes no
FHEW yes yes no
HELIB no no no

The table shows which libraries have been tested on which platforms.

To install these libraries, follow these steps:

  1. Navigate to the e3/3p directory:
cd e3/3p
  1. Run the make command with the name of the encryption library:
make [encryption library]

For instance, to install TFHE, you would run:

make TFHE

Once these libraries are installed, you can easily use them while make your program by adding the '[encryption library]=1' as a flag in your make bob or make alice command.

Clone this wiki locally