IBM / fhe-toolkit-linux

IBM Fully Homomorphic Encryption Toolkit For Linux. This toolkit is a Linux based Docker container that demonstrates computing on encrypted data without decrypting it! The toolkit ships with two demos including a fully encrypted Machine Learning inference with a Neural Network and a Privacy-Preserving key-value search.
MIT License
1.44k stars 158 forks source link

No way to access ckks tutorials #107

Closed vidstrancar closed 3 years ago

vidstrancar commented 3 years ago

So I after fresh helib installation i can see fhe-toolkit-linux/samples/mlhelib_tutorial but don't know how to compile those samples from inside browser IDE, or even how to access them as the only folders in my fhe-workspace are 'build', 'examples' (old ones, excluding ckks examples/tutorials), '.vscode' and a file called 'cpptools-linux.vsix'.

Also after i 'cmake .' from inside BGV_binary_arithmetic i try to compile with 'make' but this results in following error:

[ 50%] Building CXX object CMakeFiles/BGV_binary_arithmetic.dir/BGV_binary_arithmetic.cpp.o In file included from /usr/local/include/helib/helib.h:21, from /opt/IBM/FHE-Workspace/examples/BGV_binary_arithmetic/BGV_binary_arithmetic.cpp:19: /usr/local/include/helib/Context.h:156:22: error: 'optional' in namespace 'std' does not name a template type 156 | const std::optional& mparams, | ^~~~ /usr/local/include/helib/Context.h:156:17: note: 'std::optional' is only available from C++17 onwards 156 | const std::optional& mparams, | ^~~ /usr/local/include/helib/Context.h:156:30: error: expected ',' or '...' before '<' token 156 | const std::optional& mparams, | ^ /usr/local/include/helib/Context.h:966:24: error: 'optional' is not a member of 'std' 966 | const std::pair<std::optional, | ^~~~ /usr/local/include/helib/Context.h:966:24: note: 'std::optional' is only available from C++17 onwards /usr/local/include/helib/Context.h:966:24: error: 'optional' is not a member of 'std' /usr/local/include/helib/Context.h:966:24: note: 'std::optional' is only available from C++17 onwards /usr/local/include/helib/Context.h:966:56: error: wrong number of template arguments (1, should be 2) 966 | const std::pair<std::optional, | ^ In file included from /usr/include/c++/9/bits/stl_algobase.h:64, from /usr/include/c++/9/bits/char_traits.h:39, from /usr/include/c++/9/ios:40, from /usr/include/c++/9/ostream:38, from /usr/include/c++/9/iostream:39, from /opt/IBM/FHE-Workspace/examples/BGV_binary_arithmetic/BGV_binary_arithmetic.cpp:17: /usr/include/c++/9/bits/stl_pair.h:208:12: note: provided for 'template<class _T1, class _T2> struct std::pair' 208 | struct pair | ^~~~ In file included from /usr/local/include/helib/helib.h:21, from /opt/IBM/FHE-Workspace/examples/BGV_binary_arithmetic/BGV_binary_arithmetic.cpp:19: /usr/local/include/helib/Context.h:966:57: error: expected unqualified-id before ',' token 966 | const std::pair<std::optional, | ^ make[2]: [CMakeFiles/BGV_binary_arithmetic.dir/build.make:63: CMakeFiles/BGV_binary_arithmetic.dir/BGV_binary_arithmetic.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:76: CMakeFiles/BGV_binary_arithmetic.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

And is helib 2.0.0 coming to linux soon?

boland25 commented 3 years ago

hi @vidstrancar thanks for checking out the toolkit. To answer your questions in reverse order... yes we are working on integrating with helib 2.0.0 but it takes some time to test and build, so it will take us another week or so.

• To get at the Mlhelib_tutorials, you will need to access the terminal from vscode, then cd examples/mlhelib_tutorial and once in that directory call cmake . and then make. After the binary builds, you can then call it in the command line ./mlhelib_tutorial <tutName> followed by the tutorial that you would like to see run. Choices are basics plaintexts io integers

• To build the BGV examples, you need to cmake from the CMakeLists.txt file from the examples directory. so cd examples then cmake . and make. That should get you a set of binaries that will work.

Sorry for the confusion, but you bring up a good point that more directions should be added to the toolkit. Hope this helps and let me know if you still have issues

dowem commented 3 years ago

HElib 2.0 is now merged, as of a while back. There has been no follow-up here. I think we have addressed the questions above so I am going to close this issue. @vidstrancar please let us know if there is something further that is not working for you with the newest version of the toolkits! Sorry it took a while, but we had a lot going on in this release with the new online API documentation infrastructure and such.