-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build error with cmake because of missing c++11/14 features. #2191
Conversation
waterdropw
commented
Dec 22, 2021
•
edited
Loading
edited
CMakeLists.txt
Outdated
@@ -5570,7 +5570,10 @@ ADD_LIBRARY(all_microkernels OBJECT ${ALL_MICROKERNEL_SRCS} ${TABLE_SRCS}) | |||
ADD_LIBRARY(indirection OBJECT src/indirection.c) | |||
ADD_LIBRARY(packing OBJECT src/packing.c) | |||
ADD_LIBRARY(jit OBJECT ${JIT_SRCS}) | |||
|
|||
SET_TARGET_PROPERTIES(jit PROPERTIES | |||
CXX_STANDARD 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is C++11 sufficient to make the build pass? If so, lower to C++11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr is in c++11, but still need c++14 to resolve errors like this:
[1/2] Building CXX object CMakeFiles/jit.dir/src/jit/aarch32-assembler.cc.o
FAILED: CMakeFiles/jit.dir/src/jit/aarch32-assembler.cc.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DPTHREADPOOL_NO_DEPRECATED_API=1 -DXNN_ENABLE_ASSEMBLY=0 -DXNN_ENABLE_MEMOPT=1 -DXNN_ENABLE_SPARSE=1 -DXNN_LOG_LEVEL=0 -I../include -I../src -Iclog-source/deps/clog/include -Ipthreadpool-source/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -std=c++11 -MD -MT CMakeFiles/jit.dir/src/jit/aarch32-assembler.cc.o -MF CMakeFiles/jit.dir/src/jit/aarch32-assembler.cc.o.d -o CMakeFiles/jit.dir/src/jit/aarch32-assembler.cc.o -c ../src/jit/aarch32-assembler.cc
../src/jit/aarch32-assembler.cc:492:23: warning: missing terminating ' character [-Winvalid-pp-token]
return emit32(0xF400'0000 | encode(regs.start, 22, 12) | op.base().code << 16 | type << 8 | size << 6 | rm);
^
../src/jit/aarch32-assembler.cc:492:23: error: expected ')'
../src/jit/aarch32-assembler.cc:492:16: note: to match this '('
return emit32(0xF400'0000 | encode(regs.start, 22, 12) | op.base().code << 16 | type << 8 | size << 6 | rm);
^
../src/jit/aarch32-assembler.cc:507:23: warning: missing terminating ' character [-Winvalid-pp-token]
return emit32(0xF400'0000 | encode(regs.start, 22, 12) | op.base().code << 16 | type << 8 | size << 6 | rm.code);
^
../src/jit/aarch32-assembler.cc:507:23: error: expected ')'
../src/jit/aarch32-assembler.cc:507:16: note: to match this '('
return emit32(0xF400'0000 | encode(regs.start, 22, 12) | op.base().code << 16 | type << 8 | size << 6 | rm.code);
^
../src/jit/aarch32-assembler.cc:518:23: warning: missing terminating ' character [-Winvalid-pp-token]
return emit32(0xF480'0000 | encode(dd, 22, 12) | op.base().code << 16 | size << 10 | dd.lane << shift | rm);
^
../src/jit/aarch32-assembler.cc:518:23: error: expected ')'
../src/jit/aarch32-assembler.cc:518:16: note: to match this '('
return emit32(0xF480'0000 | encode(dd, 22, 12) | op.base().code << 16 | size << 10 | dd.lane << shift | rm);
^
3 warnings and 3 errors generated.
ninja: build stopped: subcommand failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please lower the setting to C++11. The C++14 literals will be converted to C++11 in #2192.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done~