quarkslab / NFLlib

NTT-based Fast Lattice library
MIT License
165 stars 52 forks source link

make error under macOS #44

Closed ifeelok92 closed 5 years ago

ifeelok92 commented 5 years ago

after I enter the command make,the following prompts:

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

How can I fix it?

ifeelok92 commented 5 years ago

verbosed make shows as follows

tianyuandeMacBook-Air:_build xietiany$ make VERBOSE=1 /usr/local/Cellar/cmake/3.12.4/bin/cmake -H/Users/xietiany/NFLlib-master -B/Users/xietiany/NFLlib-master/_build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/local/Cellar/cmake/3.12.4/bin/cmake -E cmake_progress_start /Users/xietiany/NFLlib-master/_build/CMakeFiles /Users/xietiany/NFLlib-master/_build/CMakeFiles/progress.marks /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/nfllib_static.dir/build.make CMakeFiles/nfllib_static.dir/depend cd /Users/xietiany/NFLlib-master/_build && /usr/local/Cellar/cmake/3.12.4/bin/cmake -E cmake_depends "Unix Makefiles" /Users/xietiany/NFLlib-master /Users/xietiany/NFLlib-master /Users/xietiany/NFLlib-master/_build /Users/xietiany/NFLlib-master/_build /Users/xietiany/NFLlib-master/_build/CMakeFiles/nfllib_static.dir/DependInfo.cmake --color= /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/nfllib_static.dir/build.make CMakeFiles/nfllib_static.dir/build [ 11%] Building CXX object CMakeFiles/nfllib_static.dir/lib/params/params.cpp.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DNFL_OPTIMIZED -DNTT_AVX2 -I/Users/xietiany/NFLlib-master/include -I/Users/xietiany/NFLlib-master/include/nfl -I/Users/xietiany/NFLlib-master/include/nfl/arch -I/Users/xietiany/NFLlib-master/include/nfl/opt -I/Users/xietiany/NFLlib-master/include/nfl/opt/arch -I/Users/xietiany/NFLlib-master/include/nfl/prng -march=native -std=c++11 -DNDEBUG -O3 -march=native -mtune=native -funroll-loops -Wa,-q -o CMakeFiles/nfllib_static.dir/lib/params/params.cpp.o -c /Users/xietiany/NFLlib-master/lib/params/params.cpp 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

Kirija commented 5 years ago

I think you are supposed to use gcc as the compiler, clang is used for linking AVX assembly and -Wa,-q is the option to tell gcc to link using clang.

Le 16 nov. 2018 à 09:58, Terrence Xie notifications@github.com a écrit :

verbosed make shows as follows

tianyuandeMacBook-Air:_build xietiany$ make VERBOSE=1 /usr/local/Cellar/cmake/3.12.4/bin/cmake -H/Users/xietiany/NFLlib-master -B/Users/xietiany/NFLlib-master/_build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/local/Cellar/cmake/3.12.4/bin/cmake -E cmake_progress_start /Users/xietiany/NFLlib-master/_build/CMakeFiles /Users/xietiany/NFLlib-master/_build/CMakeFiles/progress.marks /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/nfllib_static.dir/build.make CMakeFiles/nfllib_static.dir/depend cd /Users/xietiany/NFLlib-master/_build && /usr/local/Cellar/cmake/3.12.4/bin/cmake -E cmake_depends "Unix Makefiles" /Users/xietiany/NFLlib-master /Users/xietiany/NFLlib-master /Users/xietiany/NFLlib-master/_build /Users/xietiany/NFLlib-master/_build /Users/xietiany/NFLlib-master/_build/CMakeFiles/nfllib_static.dir/DependInfo.cmake --color= /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/nfllib_static.dir/build.make CMakeFiles/nfllib_static.dir/build [ 11%] Building CXX object CMakeFiles/nfllib_static.dir/lib/params/params.cpp.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DNFL_OPTIMIZED -DNTT_AVX2 -I/Users/xietiany/NFLlib-master/include -I/Users/xietiany/NFLlib-master/include/nfl -I/Users/xietiany/NFLlib-master/include/nfl/arch -I/Users/xietiany/NFLlib-master/include/nfl/opt -I/Users/xietiany/NFLlib-master/include/nfl/opt/arch -I/Users/xietiany/NFLlib-master/include/nfl/prng -march=native -std=c++11 -DNDEBUG -O3 -march=native -mtune=native -funroll-loops -Wa,-q -o CMakeFiles/nfllib_static.dir/lib/params/params.cpp.o -c /Users/xietiany/NFLlib-master/lib/params/params.cpp 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 are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

ifeelok92 commented 5 years ago

where should i change my compiler from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ to g++, i DON'T know how to change compiler parameter in your makefile, it is different from usual one as u use cmake.

Kirija commented 5 years ago

if you installed gcc (in this example its gcc 4.9) from macport then you can select it by

sudo port select --set gcc mp-gcc49

And you need to take care of some environment variables such as described in https://stackoverflow.com/questions/27807046/set-cc-to-gcc-instead-of-clang-on-osx-yosemite

Le 16 nov. 2018 à 11:16, Terrence Xie notifications@github.com a écrit :

where should i change my compiler from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ to g++, i DON'T know how to change compiler parameter in your makefile, it is different from usual one as u use cmake.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

ifeelok92 commented 5 years ago

i fix this issue by modifying the 31st line of CMakeCompilers.txt as if(APPLE) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") endif()

carlosaguilarmelchor commented 5 years ago

Cool marking it as solved then :)