google / fully-homomorphic-encryption

An FHE compiler for C++
Apache License 2.0
3.5k stars 252 forks source link

Performance Lag while building the Canonical Examples on Ubuntu 20.0.0 LTS Locally #29

Closed Deepansharora27 closed 1 year ago

Deepansharora27 commented 1 year ago

Hi,

I was trying to build out the Canonical Demos/Code Samples supplied with the Project but unfortunately from the past few days, everytime I am trying to compile, it takes me even more than 2 hours to load all the dependencies and additionally even the build process does not complete successfully. My Machine goes into a Lag State and all the process that took me around 2-2.5 hours to setup goes into Vain.

I am skeptical whether is this Common for Ubuntu Users or this is something specific that I am only Facing

Any Help will be appreciated on this Part

j2kun commented 1 year ago

Indeed, in our continuous builds, a fresh build + running all tests on Ubuntu 16.04.7 LTS takes almost 3 hours. I believe most of the runtime is due to the fact that the project compiles LLVM from scratch, which is a very large project. However, after the first successful build of LLVM on your machine, the compiled objects will be cached by bazel and not built again by default.

One thing you can try is compiling subsets of the project at a time (e.g., bazel build @yosys//:all, bazel build @abc//:all, bazel build @openfhe//:all, etc.). Future builds will use the cached results.

Bazel has a means to link with a pre-compiled libraries, but I have not tried it on this project. If it works, it would likely substantially reduce the build time. I understand this is frustrating, but we don't have any more specific guidance at this time.