Skip to content

Commit

Permalink
Merge pull request github#21 from iquah1/Oliveira_bootstrapping
Browse files Browse the repository at this point in the history
Improved documentation + changes to work (off of Oliveira_bootstrapping)
  • Loading branch information
reneroliveira authored May 2, 2023
2 parents 52f6292 + 8d77844 commit 1516a95
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build/
.vscode/
.vscode/
.idea
16 changes: 0 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
cmake_minimum_required (VERSION 3.5.1)

### To use gcc/g++ on a Macintosh, you must set the Compilers
### here, not inside the project
##if(APPLE)
## set(CMAKE_C_COMPILER "/usr/local/bin/gcc-7")
## set(CMAKE_CXX_COMPILER "/usr/local/bin/g++-7")
##endif()
### TODO: for now, we use CLang for Mac
###
### In order to create OpenFHE's static libraries you should enable
### the BUILD_STATIC option. For that, you run "cmake .. -DBUILD_STATIC=ON".
### After having your link completed you will find static libs
### with the suffix "_static" in ./build/libs/.
### Examples: OPENFHEpke_static.a, OPENFHEcore_static.a, etc.
### After you run "make install" in your build directory, you can build your custom application.
### If you need your application to be linked statically, then run "cmake .. -DBUILD_STATIC=ON"

project(openfhe)
set(CMAKE_CXX_STANDARD 17)
option( BUILD_STATIC "Set to ON to include static versions of the library" OFF)
Expand Down
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# [Work in Progress] Official Python wrapper for OpenFHE

## Table of Contents

- [Building](#building)
- [Prerequisites](#requirements)
- [Linux Install](#linux)
- [Installing the .so: Conda](#conda)
- [Installing the .so: System](#system-install)
- [Running Examples](#examples)

## Building

### Requirements

Before building, make sure you have the following dependencies installed:

- [CMake](https://cmake.org/)
Expand All @@ -16,11 +27,40 @@ With all the dependencies set up, clone the repository, open a terminal in the r
```bash
mkdir build
cd build
cmake ..
cmake .. // Alternatively, cmake .. -DOpenFHE_DIR=/path/to/installed/openfhe
make
make install
```
Obs.: If the last command fails, try running it with sudo.

At this point the `.so` file has been built. Your exact installation process will depend on your virtual environment.

#### Conda

```bash
conda create -n ${ENV_NAME} python=3.{X} anaconda
```

where `${ENV_NAME}` should be replaced with the name of your environment, and `{X}` should be replaced with your desired python version. For example you might have `
conda create -n openfhe_python python=3.9 anaconda`

then run

```
mkdir lib
mv *.so lib
conda develop lib
```

which creates a lib folder, moves the built `.so` file into that lib folder, and tells conda where to look for external libraries.

**Note** You may wish to copy the `.so` file to any projects of your own, or add it to your system path to source from.

#### System install

```
make install // You may have to run sudo make install
```

## Examples

After that, you can run the examples in the src/pke/examples folder:

Expand Down
2 changes: 1 addition & 1 deletion src/pke/cryptocontext_wrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <openfhe/pke/openfhe.h>
#include <openfhe.h>
#include <vector>
#include <algorithm>
#include <complex>
Expand Down

0 comments on commit 1516a95

Please sign in to comment.