1

I'd really appreciate some help getting HElib to work on Windows 10 x64 using the MSVC 2017 compiler. I successfully managed to compile its dependency, NTL, using the same compiler by following this tutorial and also ran its tests, so it seems to work well.

However, in the case of HElib I tried generating Visual Studio projects using cmake and then compiled it successfully (see NOTE below), but running it fails. For example, I ran the Test_binaryCompare.cpp_exe test (has its own vcproj generated by cmake), but it fails because it reaches a part of code I doubt it's supposed to (it attempts to do an operation called bootstrapping and it is disabled for that test). However, on Linux it works.

LINUX: The reason I'd really like to run this on Windows is because I find it a lot easier to debug using Visual Studio. I'm also more used to Windows overall..

NOTE: Compiling HElib successfully required some modifications like fixing broken tr1 includes (e.g it was trying to include <tr1/memory> instead of just memory although the latter was actually available), suppressing the 4146 error (I also had to do this for NTL) and fixing two instances of variable-length arrays which Microsoft's compiler sadly does not support.

PhantomR
  • 605
  • 4
  • 16
  • 1
    In a small team of 12 programmers with varying experience, 7 voted to use Win 2K (yes, a long time ago). In that same team, that 7 had only windows experience, and the other 5 had both windows and *nix. I learned a lot about mingw in those years. – 2785528 Jun 24 '18 at 18:27
  • Wow! I assume you were one of the 5 then, haha! [EDIT: Oops, actually my logic was flawed.. I guess you could have been on either side, but still 'forced' to use MinGW] Do you think I should try using MinGW? I checked it now and I found that it's possible to use MinGW in Visual Studio instead of MSVC. Thank you for your suggestion! :) – PhantomR Jun 24 '18 at 18:37
  • 1
    Your comment "a lot easier to ... with this tool or another" reminded me ... but my anecdote was intended as a gentle nudge: "... is this your opportunity to study another tool?" – 2785528 Jun 24 '18 at 21:03
  • Sadly, I'm a little short on time with this one, but I think MinGW would be nice to learn in the future.. – PhantomR Jun 27 '18 at 15:18

1 Answers1

1

Without any error messages I can't really help you figure out your exact issues but I ported HElib to Windows some time ago: https://github.com/AlexanderViand/HElib/tree/Windows
It's a bit out of date but if the tests works in that version you can check the changes I made against your changes.

There's also the option that you're simply running into this issue: https://github.com/shaih/HElib/issues/228
If your linux version of NTL is slightly older, it might just be that your windows version of NTL is the buggy one.

Finally, I'd very much recommend against running HElib on Windows because without GMP it seems painfully slow.

Instead I ended up setting up a docker virtual machine and SSH'd into that from visual studio: https://hub.docker.com/r/alexanderviand/visual-studio-linux-build-box-with-helib/

Currently I'm using WSL and CLion (which supports WSL quite well) when I'm working with HElib on Windows.

Alexander
  • 539
  • 5
  • 16