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

make install? #201

Open rbharath opened 6 years ago

rbharath commented 6 years ago

I've been experimenting with HELib to write a few simple programs. For now, I've been placing my code in the src directory (say as Program.cpp) and compiling with the make Program_x command. This is fine for now, but is a little kludgy especially as I'm getting confident about trying some more complicated programs.

Is there an install command already available? If not, would there be interest in adding a make install command to the HELib makefile? I'm glad to make a pull request if so.

fionser commented 6 years ago
  1. basically, we just place the built fhe.a in the link path, e.g., /usr/lib and /usr/local/lib, and place the header files in the include path.
  2. or you can set these paths in your makefile with -I <include_path> and -L <link_path>.

For example,

/home
      /Alice
          /SomeDir
              /HElib/src <-- fhe.a and the head files are here
         /OtherDir
              /projectDir
                   /makefile
                   /program.cpp

Your program.cpp can be like this

#include "FHEcontext.h"
int main() {
    FHEcontext context(1024, 2, 1);
    ....
}

Then you can write the makefile as

gcc -o main program.cpp -L /home/Alice/SomeDir/HElib/src -lfhe -lgmp -I /home/Alice/SomeDir/HElib 
rbharath commented 6 years ago

@fionser Thanks for the answer!

Would there be interest in having a make install command added by PR to move FHE.a and the header files to the right locations?