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

fatal error: 'tr1/memory' file not found #190

Open eskendrian opened 6 years ago

eskendrian commented 6 years ago

Hello,

I'm following instructions in HElib/INSTALL.txt and have had no problem until make check. But when I try to make my_own_program, or to make Test_* , the following same error occurs.

c++ mytest.cpp -L/usr/local/lib -lntl -lgmp -lm -o mytest In file included from mytest.cpp:1: In file included from ./FHE.h:20: In file included from ./DoubleCRT.h:19: ./NumbTh.h fatal error: 'tr1/memory' file not found

include <tr1/memory>

           ^~~~~~~~~~~

1 error generated.

My mytest.cpp has no extraordinary lines, mostly coming from a tutorial (http://tommd.github.io/posts/HELib-Intro.html). My compiler:

$ clang --version Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin17.4.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

The versions of gmplib and ntl are all up-to-date. Tried lower version of ntl but turned out it's of no good. Default for the Makefile.

Since <tr1/memory> file is nothing from HElib, I guess this is a problem of mine. However, if someone has an issue as similar as mine or should anyone be able to help, I would really appreciate it.

Plus, this says I have no <tr1/memory>, and I found instead that I have \<memory>. These two alternatives appear many times in HElib in the form similar of:

#if (__cplusplus>199711L)
#include <memory>
#else
#include <tr1/memory>
#endif

My __cplusplus value is 199711L. I thought this might be mistake thus edited the code to always take the __cplusplus > 199711L branch. There are 4 such pieces of code. One of those, namely OptimizePermutations.cpp yielded 1469 lines of error messages starting with:

OptimizePermutations.cpp|179 col 31 error| use of overloaded operator '!=' is ambiguous (with operand types 'LongNodePtr' (aka 'shared_ptr') and 'long') [cpp/gcc] OptimizePermutations.cpp|179 col 31 error| note: built-in candidate operator!=(int, long) [cpp/gcc] OptimizePermutations.cpp|179 col 31 error| note: built-in candidate operator!=(unsigned __int128, long) [cpp/gcc] OptimizePermutations.cpp|179 col 31 error| note: built-in candidate operator!=(unsigned long long, long) [cpp/gcc] OptimizePermutations.cpp|179 col 31 error| note: built-in candidate operator!=(unsigned long, long) [cpp/gcc]

So this also won't work. Any idea? The least advice would be so much a help.

fionser commented 6 years ago

try to add -std=c++11 to the makefile. if you are using gcc-4.x, use -std=c++0x instead.