MK-TFHE icon indicating copy to clipboard operation
MK-TFHE copied to clipboard

compile error on mac

Open haochenuw opened this issue 5 years ago • 3 comments

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

haochenuw avatar Jun 17 '19 19:06 haochenuw

Please, disable Nayuki (when "ccmake ../src" in build) and try to re-run make again. Let me know if it solves the issue.

ilachill avatar Jun 18 '19 11:06 ilachill

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.

haochenuw avatar Jun 24 '19 01:06 haochenuw

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)

SeekingMeaning avatar Jan 13 '20 05:01 SeekingMeaning