Open Tabaie opened 3 years ago
Unfortunately, I do not have any knowledge in Xcode. If you compile from the terminal, everything should work as described. I think you should tell Xcode to use cmake
for configuration. I'm sure there is a way :)
Thank you for the prompt response. I tried the following cmake
script:
project(emp_zk_compile_err)
set(CMAKE_CXX_STANDARD 17)
add_executable(emp_zk_compile_err main.cpp)
target_include_directories(emp_zk_compile_err PUBLIC "/path/emp-zk")
target_include_directories(emp_zk_compile_err PUBLIC "/path/emp-tool")
target_include_directories(emp_zk_compile_err PUBLIC "/path/emp-ot")
target_include_directories(emp_zk_compile_err PUBLIC "/usr/local/opt/openssl@1.1/include")
Still got the same errors:
Aryas-MacBook-Pro:build arya$ make
[ 50%] Building CXX object CMakeFiles/emp_zk_compile_err.dir/main.o
In file included from /path/emp-compile-err/emp-compile-err/main.cpp:2:
In file included from /path/emp-tool/emp-tool/emp-tool.h:29:
In file included from /path/emp-tool/emp-tool/utils/mitccrh.h:3:
/path/emp-tool/emp-tool/utils/aes_opt.h:12:15: error: always_inline function '_mm_aesenclast_si128' requires target feature 'aes', but would be inlined into function 'ks_rounds' that is compiled without support for 'aes'
block aux = _mm_aesenclast_si128 (x2, con);
^
/path/emp-tool/emp-tool/utils/aes_opt.h:79:13: error: always_inline function '_mm_aesenc_si128' requires target feature 'aes', but would be inlined into function 'ParaEnc' that is compiled without support for 'aes'
*blks = _mm_aesenc_si128(*blks, K);
^
/path/emp-tool/emp-tool/utils/aes_opt.h:89:12: error: always_inline function '_mm_aesenclast_si128' requires target feature 'aes', but would be inlined into function 'ParaEnc' that is compiled without support for 'aes'
*blks = _mm_aesenclast_si128(*blks, K);
^
/path/emp-tool/emp-tool/utils/aes_opt.h:79:13: error: always_inline function '_mm_aesenc_si128' requires target feature 'aes', but would be inlined into function 'ParaEnc' that is compiled without support for 'aes'
*blks = _mm_aesenc_si128(*blks, K);
^
/path/emp-tool/emp-tool/utils/aes_opt.h:89:12: error: always_inline function '_mm_aesenclast_si128' requires target feature 'aes', but would be inlined into function 'ParaEnc' that is compiled without support for 'aes'
*blks = _mm_aesenclast_si128(*blks, K);
^
5 errors generated.
make[2]: *** [CMakeFiles/emp_zk_compile_err.dir/main.o] Error 1
make[1]: *** [CMakeFiles/emp_zk_compile_err.dir/all] Error 2
make: *** [all] Error 2
Please use our cmake configuration at https://github.com/emp-toolkit/emp-zk/blob/master/CMakeLists.txt, crucially, this file include https://github.com/emp-toolkit/emp-tool/blob/master/cmake/emp-base.cmake#L50, that enables AES.
I can successfully install
ot
,zk
andtool
on a macOS, with all the tests passing successfully. However, the following simple program, which only makes a reference tosetup_zk_bool
won't compile with Xcode.The errors are the following:
emp-tool/utils/aes_opt.h:12:15: Always_inline function '_mm_aesenclast_si128' requires target feature 'aes', but would be inlined into function 'ks_rounds' that is compiled without support for 'aes'
emp-tool/utils/aes_opt.h:79:13: Always_inline function '_mm_aesenc_si128' requires target feature 'aes', but would be inlined into function 'ParaEnc' that is compiled without support for 'aes'
emp-tool/utils/aes_opt.h:89:12: Always_inline function '_mm_aesenclast_si128' requires target feature 'aes', but would be inlined into function 'ParaEnc' that is compiled without support for 'aes'
Since all the tests pass using the same compiler on the same machine, I suspect that the issue has to do with compiler configurations, with Xcode telling the compiler to be strict and throw errors when it could just give a warning. But I don't know which flags that could be.
A small Xcode project containing the program is available here.