Closed DylanWangWQF closed 3 years ago
Thank you very much for helping us to improve the quality of our software. The FHE Toolkit develiopment team want to sincerely thank you for submitting your first issue and joining our technical community! We will get started on your issue immediately.
Sry about the wrong label bug
.
Hi @DylanWangWQF, thank you for your interest in IBM's FHE toolkit.
Indeed by default we build only the shared library of HElib, as seen in Dockerfile.ALPINE.HElib
:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED=ON -DENABLE_THREADS=ON ..
if you'll change that to -DBUILD_SHARED=OFF
it should build the libhelib.a
file. I expect the rest of the setup to keep working even with the static library (.a
) but I haven't tried that.
Hi, @dubek .Thanks for your help!
After I change that to-DBUILD_SHARED=OFF
, it still returns the libhelib.so
shared library. I don't know why it doesn't work. So I manually rebuild it in the Alpine container and finally get the libhelib.a
.
BTW, once I manually rebuild HElib
to get libhelib.a
, I found it does require the NTL and GMP to be the shared libraries .so
. Here, I have a question. When I use libhelib.a
in my own project, it's not available to work on libntl.a
and libgmp.a
?
BTW, once I manually rebuild
HElib
to getlibhelib.a
, I found it does require the NTL and GMP to be the shared libraries.so
. Here, I have a question. When I uselibhelib.a
in my own project, it's not available to work onlibntl.a
andlibgmp.a
?
I think this might be related to different licenses of GMP, NTL, and HElib and their ability to (legally) link together.
@DylanWangWQF @dubek is correct in saying that if you build HElib as a static library it requires NTL and GMP to also be built as static. It may be a situation that if you turn off SHARED in the HElib, it will expect that you are feeding it NTL and GMP libraries that are also .a and it isn't there so it doesn't build.
You can look at the macOS repo to see how we build everything statically and run it there. The flags would generally be the same for your alpine build.
Also NTL and GMP are different licenses than HElib so if you are planning on packaging and using this commercially it would require you to use shared libraries (.so)
Hi, @boland25 @dubek . I see. Many thanks for your help!
Sry for reopening this issue again. @dubek @boland25 I want to install GMP by myself inside the alpine container. But it doesn't work after I modify the dockerfile.alpine (as well as alpine.HElib).
And I don't have permission to ./configure
inside the container to install the GMP and build other packages.
@DylanWangWQF You can always start you own Dockerfile from scratch to install whatever you need in it. Not sure this is related to fhe-toolkit-linux.
@dubek Thank you for your help! This has been solved.
Question In the built Alpine Docker container, I found the static library
libmlhelib.a
and dynamic librarylibhelib.so
.So we didn't build the static library
libhelib.a
in this example? (I need this library built on Alpine Linux for my experiment)