-
Notifications
You must be signed in to change notification settings - Fork 23
Installing E3_old
This section outlines how you can install and build E3 in a Windows or Linux/Ubuntu environment. The contents of this page include:
- E3 Dependencies
- Setting Up E3 in Windows
- Building E3 (Linux and Windows)
- Installing External Encryption Libraries
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 (\verb->=5.4.0-) for Linux; cl (\verb->=19.10.25224-) 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
In order to start using E3 in Windows, the following dependencies discussed in this section must be installed first. Setting up the environment variables is the key to using E3 in Windows environment. E3 is supported in various command line tools (i.e. Command Prompt, Powershell, Cygwin). In this guide, we particularly explain how to install Cygwin but the other command line tools can also similarly be used for building E3. Additionally, you also need Microsoft compiler to build C/C++ programs.
This installation guideline for Windows consists of three parts:
Make sure you have downloaded and installed required tools: git, make, bash, and Microsoft compiler. After that, you can easily set up, edit, and add the environment variables:
1.Open Control Panel > System > Advanced system settings
2.In the System Properties dialog, click Advanced > Environment Variables...
3.You can either edit User variables or System variables. If you only need the commands for your own user account, then edit the user variable. If you need it to work across the computer system regardless of which user is logged in, then edit the system variable.
4.Click on PATH and then on Edit and add the directory. For example, add 'C:\msysgit\bin'.
5.Add INCLUDE and LIB variables as well. If you do not have them already, click on New and add them.
PATH variable is usually linked to /bin/ directory, INCLUDE to /include/ directory, and LIB to /lib/ directory. For example, if your msysgit directory contains the necessary tools,
Add to PATH:
C:\msysgit\bin
Add to INCLUDE:
C:\msysgit\incude
Add to LIB:
C:\msysgit\lib
E3 uses the Visual Studio 2017. When installing the software, make sure you have included following packages/components:
Workloads:
- Desktop development with C++ Individual components:
- Windows Universal CRT SDK
- Windows 10 SDK (10.0.10240.0)
If you already have the Visual Studio 2017 installed, you can add additional packages by 'Modify'ing from the 'Visual Studio Installer' application. Installing or modifying Visual Studio 2017 might take a few minutes.
While the compilers can be used from Cygwin, you need to set the environment variables manually. You can do so in 'Edit the system environment variables', which can be found in Start Search. Detailed instructions are given here.
Assuming the compiler is installed in the default location, this should work for the Visual Studio 2017 and the Windows SDK 10.0.10240.0 in Windows 10:
Add to PATH:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
C:\Program Files (x86)\Windows Kits\10\bin\x86\ucrt
Add to INCLUDE:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
Add to LIB:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\x86
Now when you type 'cl' in Cygwin window, following message should appear:
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27032.1 for x86
Copyrights (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
Cygwin is a collection of GNU and Open Source tools that provide a Linux-like environment for Windows: using it you can install and use llvm (which includes the GCC compilers), Clang (which includes Clang compilers), GDB (a debugger used by both compilers), and make/cmake (tools that which we use to specify how to build -compile and link- C++ programs). Cygwin and its toolset occupy about 2.5 GB on disk. Detailed instructions on installing packages for Cygwin can be found here.
- Download Cygwin here.
- Run the downloaded file
- Follow the setup program
- In the 'Select Packages' window, you will select additional packages to install. In the View pull-down list, select Category. Enter the tool names and select Install in the New pull-down list for Devel package. Here, you will select git, cl, and make packages.
Installing Cygwin might take a few minutes.
After installing the dependencies and setting up the Linux/Windows environments, follow these steps to build E3:
- Clone the E3 Github repository:
git clone https://github.com/momalab/e3.git
- Navigate into the e3/src- directory and run the make command to compile the E3 tool:
cd e3/src
make
E3 supports the following external FHE libraries:
- TFHE
- SEAL
- FHEW
- HELIB
To install these libraries, follow these steps:
- Navigate to the e3/3p directory:
cd e3/3p
- 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.