Browse Source

Merge pull request #21 from iquah1/Oliveira_bootstrapping

Improved documentation + changes to work (off of Oliveira_bootstrapping)
Rener Oliveira 1 year ago
parent
commit
1516a953c3
4 changed files with 46 additions and 21 deletions
  1. 2 1
      .gitignore
  2. 0 16
      CMakeLists.txt
  3. 43 3
      README.md
  4. 1 1
      src/pke/cryptocontext_wrapper.cpp

+ 2 - 1
.gitignore

@@ -1,2 +1,3 @@
 build/
-.vscode/
+.vscode/
+.idea

+ 0 - 16
CMakeLists.txt

@@ -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)

+ 43 - 3
README.md

@@ -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/)
@@ -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:
 

+ 1 - 1
src/pke/cryptocontext_wrapper.cpp

@@ -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>