0

I unzipped file HElib-master.zip on my folder Downloads.

Then I obtained my file fhe.a in folder Downloads/HElib-master/src but when I run command make Test_General as indicated here http://shaih.github.io/HElib/ I get compilation errors like the this :

/tmp/ccqnVZGx.o: In function TestIt(long, long, long, long, long, long, long, long, long, NTL::Vec<long> const&, NTL::Vec<long> const&):
Test_General.cpp:(.text+0x32a): undefined reference to FHEcontext::FHEcontext(unsigned long, unsigned long, unsigned long, std::vector<long, std::allocator<long> > const&, std::vector<long, std::allocator<long> > const&)

I copied fhe.a in my urs/local/, usr/local/include and usr/local/lib but it didn't work.

How to install HElib so that I can compile my sources ? Or what can I do to resolve these 'undefined reference' errors?

1 Answer 1

1

The correct way to build the test programs in the HElib/src directory appears to be via a target called Test_General_x rather than plain Test_General e.g.

$ make Test_General_x
HElib requires NTL version 9.4.0 or higher, see http://shoup.net/ntl
If you get compilation errors, try to add/remove -std=c++11 in Makefile

g++ -g -O2  -o Test_General_x Test_General.cpp fhe.a -L/usr/local/lib -lntl -lgmp  -lm

The relevant section of the Makefile is

./%_x: %.cpp fhe.a
        $(CC) $(CFLAGS) -o $@ $< fhe.a $(LDLIBS)

which you can see adds the fhe.a library dependency.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .