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 759 forks source link

The issue of the NTL when building the example #470

Closed hymckks closed 2 years ago

hymckks commented 2 years ago

Hi, I just pulled the latest version of HElib, and when I was trying to build the examples that given in BGV_binary_arithmetic, I got the following errors. It seems that the compilation goes wrong. Has anyone run into the same problem? thanks in advance.

/usr/bin/ld: CMakeFiles/BGV_binary_arithmetic.dir/BGV_binary_arithmetic.cpp.o: in function `NTL::to_double(NTL::xdouble const&)':
BGV_binary_arithmetic.cpp:(.text._ZN3NTL9to_doubleERKNS_7xdoubleE[_ZN3NTL9to_doubleERKNS_7xdoubleE]+0x2e): undefined reference to `NTL::conv(double&, NTL::xdouble const&)

CMakeLists:

cmake_minimum_required(VERSION 3.16)

set(CMAKE_CXX_STANDARD 17)#set c++ version

add_executable(BGV_binary_arithmetic BGV_binary_arithmetic.cpp)

target_link_libraries(BGV_binary_arithmetic helib)

The NTL was installed in /usr/local/

hymckks commented 2 years ago

add

target_link_libraries(BGV_binary_arithmetic ntl)

before target_link_libraries(BGV_binary_arithmetic helib)