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

How to run src/Test_binaryCompare.cpp file after sucessfully make? #321

Open qianlou opened 4 years ago

qianlou commented 4 years ago

Ubuntu 16.04: Detailed Description: I have run those two commands successfully at /helib/src/ path:

  1. cmake .
  2. make But nothing happens so that I cannot find any executable file I can run. Then I run _make ./TestbinaryCompare.cpp Then nothing happens.

Who can teach me how to run any src/x.cpp file? Thanks in advance.

jlhcrawford commented 4 years ago

@qianlou I suggest you follow the instructions for "Package Build" found here https://github.com/homenc/HElib/blob/master/INSTALL.md when building HElib.

From the HElib directory you need to create a build directory and run cmake .. from HElib/build with the necessary flags. i.e.-DPACKAGE_BUILD=ON.

The test you are trying to run is a legacy test and is planned to be phased out in the future. These tests have been ported to a new googletest framework found in HElib/src/tests. To build these tests you need to run cmake with the flag -DENABLE_TEST=ON.

To run a specific test from the HElib/build directory run ./bin/runTests --gtest_filter="*binaryCompare*". Running that command without the gtest filter will run all tests located in the HElib/src/tests directory.

Note: I would advise you to build a fresh clone of HElib instead of trying to make your existing version work as you should avoid running cmake from within the HElib/src directory of HElib as it populates it with extra files and directories.