Browse Source

updated readme to work with conda

Ian Quah 1 year ago
parent
commit
8d77844ece
2 changed files with 31 additions and 18 deletions
  1. 0 16
      CMakeLists.txt
  2. 31 2
      README.md

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

+ 31 - 2
README.md

@@ -5,6 +5,8 @@
 - [Building](#building)
   - [Prerequisites](#requirements)
   - [Linux Install](#linux)
+    - [Installing the .so: Conda](#conda)
+    - [Installing the .so: System](#system-install)
 - [Running Examples](#examples)
 
 ## Building
@@ -27,9 +29,36 @@ mkdir build
 cd build
 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