MK-TFHE
MK-TFHE copied to clipboard
compile error on mac
running "make" gives me an error
/Users/haochen/Documents/Libraries/MK-TFHE/src/libtfhe/fft_processors/nayuki/fft_processor_nayuki.cpp:15:35: error: implicit conversion from '_Complex double' to 'double' is not permitted in C++ omegaxminus1[x]=cos(xM_PI/N)-1. + sin(xM_PI/N) * 1i; ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ 1 error generated. make[3]: *** [libtfhe/fft_processors/nayuki/CMakeFiles/tfhe-fft-nayuki-portable.dir/fft_processor_nayuki.cpp.o] Error 1 make[2]: *** [libtfhe/fft_processors/nayuki/CMakeFiles/tfhe-fft-nayuki-portable.dir/all] Error 2 make[1]: *** [all] Error 2 make: *** [all] Error 2
Please, disable Nayuki (when "ccmake ../src" in build) and try to re-run make again. Let me know if it solves the issue.
I did and there's still an erorr: I ran the command
cmake ../src -DENABLE_NAYUKI_PORTABLE=off -DCMAKE_BUILD_TYPE=debug
and I got
/Users/haochen/Documents/Libraries/MK-TFHE/src/libtfhe/mkTFHEkeygen.cpp:84:12: error: use of undeclared identifier 'result' assert(result->params->n_extract == N); ^ 1 error generated.
The following change to fft_processor_nayuki.cpp
in src/libtfhe/fft_processors/nayuki
should fix the problem:
-omegaxminus1[x]=cos(x*M_PI/N)-1. + sin(x*M_PI/N) * 1i;
+omegaxminus1[x]=cplx(cos(x*M_PI/N)-1., sin(x*M_PI/N)); // instead of cos(xM_PI/N)-1. + sin(xM_PI/N) * 1i
In other words, replace this:
omegaxminus1[x]=cos(x*M_PI/N)-1. + sin(x*M_PI/N) * 1i;
with this:
omegaxminus1[x]=cplx(cos(x*M_PI/N)-1., sin(x*M_PI/N)); // instead of cos(xM_PI/N)-1. + sin(xM_PI/N) * 1i
(Duplicate issue: tfhe/tfhe#213)