NFLlib
NFLlib copied to clipboard
when using nfllib on mac, some errors occurred
previously, make test, everything is ok. but when i run a program that use this nfllib, some error occurs:
In file included from /Users/xietiany/nfllib/include/nfl/poly.hpp:26: /Users/xietiany/nfllib/include/nfl/ops.hpp:257:60: error: too many arguments provided to function-like macro invocation auto make_op(Args const&... args) -> decltype(_make_op<Op, Args...>{}(args...)) ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:609:11: note: macro 'decltype' defined here
define decltype(__x) __decltype(__x)
^
In file included from src/main.cpp:7: In file included from src/ibe/user.hpp:7: In file included from src/params.hpp:8: In file included from /Users/xietiany/nfllib/include/nfl.hpp:17: /Users/xietiany/nfllib/include/nfl/poly.hpp:346:1: error: too many arguments provided to function-like macro invocation DECLARE_BINARY_OPERATOR(operator-, submod) ^
@ifeelok92 did you find what was the issue ? Can you confirm if it comes from the lib ? Can you give some code/platform to reproduce it ?
@ifeelok92 the "-Wa,-q" option is to tell clang to use its internal assembler which is required on Mac to use AVX instructions (and other extended sets). How is it that your clang doesn't recognize it ? Which version of clang do you have installed ?
xty@xtys-MacBook-Air ~/D/N/_build> cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/NFLlib -- The CXX compiler identification is AppleClang 10.0.0.10001145 -- The ASM-ATT compiler identification is AppleClang -- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test COMPILER_SUPPORTS_CXX11 -- Performing Test COMPILER_SUPPORTS_CXX11 - Success -- Performing Test COMPILER_SUPPORTS-MARCH=NATIVE -- Performing Test COMPILER_SUPPORTS-MARCH=NATIVE - Success -- Performing Test COMPILER_SUPPORTS-MTUNE=NATIVE -- Performing Test COMPILER_SUPPORTS-MTUNE=NATIVE - Success -- Performing Test COMPILER_SUPPORTS-FUNROLL-LOOPS -- Performing Test COMPILER_SUPPORTS-FUNROLL-LOOPS - Success -- Found GMP: /usr/local/lib/libgmp.dylib -- Found MPFR: /usr/local/lib/libmpfr.dylib -- Configuring done -- Generating done -- Build files have been written to: /Users/xty/Documents/NFLlib/_build xty@xtys-MacBook-Air ~/D/N/_build> make Scanning dependencies of target nfllib_static [ 0%] Building ASM-ATT object CMakeFiles/nfllib_static.dir/lib/prng/nfl_crypto_stream_salsa20_amd64_xmm6.s.o [ 11%] Building CXX object CMakeFiles/nfllib_static.dir/lib/params/params.cpp.o clang: error: unsupported argument '-q' to option 'Wa,' make[2]: *** [CMakeFiles/nfllib_static.dir/lib/params/params.cpp.o] Error 1 make[1]: *** [CMakeFiles/nfllib_static.dir/all] Error 2 make: *** [all] Error 2
You can remove the -q
in CMakeCompilers.txt and it will compile. For me it is still performant even without these particular optimizations.