homenc / HElib

HElib is an open-source software library that implements homomorphic encryption. It supports the BGV scheme with bootstrapping and the Approximate Number CKKS scheme. HElib also includes optimizations for efficient homomorphic evaluation, focusing on effective use of ciphertext packing techniques and on the Gentry-Halevi-Smart optimizations.
https://homenc.github.io/HElib
Other
3.11k stars 760 forks source link

How to run examples? #432

Closed DGQAQ closed 2 years ago

DGQAQ commented 3 years ago

I am new, I just installed HElib and want to run examples by

cd BGV_binary_arithmetic cmake -Dhelib_DIR=/usr/local/share/cmake/helib

but there is an error . wang@wang-virtual-machine:~/HElib/examples/BGV_binary_arithmetic$ cmake -Dhelib_DIR=/usr/local/share/cmake/helib -- Configuring done -- Generating done -- Build files have been written to: /home/wang/HElib/examples/BGV_binary_arithmetic

can you tell me how to run examples ? thanks.

DGQAQ commented 3 years ago

wang@wang-virtual-machine:~/HElib/examples/BGV_binary_arithmetic$ cmake -Dhelib_DIR=/usr/local/share/cmake -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project:

helib_DIR

-- Build files have been written to: /home/wang/HElib/examples/BGV_binary_arithmetic

faberga commented 3 years ago

@DGQAQ , Please follow the install instructions in the README.md file in the "examples" directory.

All the examples are built from the "examples" directory.

christianepeters commented 3 years ago

I took the liberty of writing up a simplified version of the howto that gets you right to the examples.

Hang-shao commented 3 years ago

It's my note

DylanWangWQF commented 3 years ago

Hi, @Hang-shao @christianepeters @faberga . Why do we need to build the NTL as a shared library libntl.so rather than libntl.a when building the dependencies?

_BUILD_SHARED=ON/OFF (default is OFF): Build as a shared library. Note that building HElib (regardless of BUILDSHARED) will fail if NTL is not built as a shared library. The default for NTL is static library, to build NTL as a shared library use ./configure SHARED=on in step 1.

In my project, I need to build these as static libraries (e.g., libhelib.a, libntl.a, libgmp.a). I'm not clear with these principles. Thanks in advance!

faberga commented 2 years ago

@DylanWangWQF The main reason for linking with libntl.so is a licensing one. NTL is LGPL v2.1+ and HElib is Apache 2, hence the default linking for HElib is with libntl.so.

Technically you can link statically and it should work. but in this case you should adhere to the LGPL v2.1+ rules for the distribution and use of your code.

ByShui commented 2 years ago

hi,i made a note for describe the install and run examples clearly, but in chinese, if you need:安装HElib并运行示例程序

faberga commented 2 years ago

@ByShui Thank you. We don't have a version of the documentation in Chinese, but I will keep the link should anyone else ask.

faberga commented 2 years ago

Closing as resolved.