【发布时间】:2015-03-24 19:33:01
【问题描述】:
我正在尝试在 Mac OS Yosemite(从 Snow Lion 升级)上安装 MeTA 以进行文本检索。
我无法制作该项目。显然,使用的是旧版本的 Clang (3.2)。 我更新了 Xcode 和命令行工具,但没有使用新的 Apple 版本的 clang 来制作项目。
在安装 MeTA 时,我使用了以下命令:
git clone https://github.com/meta-toolkit/meta.git
cd meta/
git reset --hard v1.3.2
# set up submodules
git submodule update --init --recursive
# set up a build directory
mkdir build
cd build
cp ../config.toml .
# configure and build the project
CXX=clang++ cmake ../ -DCMAKE_BUILD_TYPE=Release -DICU_ROOT=/usr/local/opt/icu4c
make
Clang version
clang -v and it displays:
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
在make 之后出现以下错误:
[ 0%] Building CXX object src/util/CMakeFiles/meta-util.dir/progress.cpp.o
Assertion failed: (getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."), function PushDeclContext, file SemaDecl.cpp, line 915.
0 libLLVM-3.2svn.dylib 0x0000000105595e52 PrintStackTrace(void*) + 34
1 libLLVM-3.2svn.dylib 0x0000000105596379 SignalHandler(int) + 713
2 libsystem_platform.dylib 0x00007fff9b31df1a _sigtramp + 26
3 libLLVM-3.2svn.dylib 0x0000000105d16cea (anonymous namespace)::StripSymbols::ID + 237935
4 libLLVM-3.2svn.dylib 0x0000000105596096 abort + 22
5 libLLVM-3.2svn.dylib 0x0000000105596055 __assert_rtn + 53
6 clang 0x0000000103ab9c2f clang::Sema::PushDeclContext(clang::Scope*, clang::DeclContext*) + 95
7 clang 0x0000000103c12753 clang::Sema::ActOnStartOfLambdaDefinition(clang::LambdaIntroducer&, clang::Declarator&, clang::Scope*) + 1267
8 clang 0x00000001039dd947 clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) + 3207
9 clang 0x00000001039dc757 clang::Parser::ParseLambdaExpression() + 359
10 clang 0x00000001039d0fd5 clang::Parser::ParseCastExpression(bool, bool, bool&, clang::Parser::TypeCastState) + 5797
11 clang 0x00000001039cd127 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 135
12 clang 0x00000001039a6a8e clang::Parser::ParseLexedMethodDeclaration(clang::Parser::LateParsedMethodDeclaration&) + 702
13 clang 0x00000001039a6405 clang::Parser::ParseLexedMethodDeclarations(clang::Parser::ParsingClass&) + 165
14 clang 0x00000001039a6405 clang::Parser::ParseLexedMethodDeclarations(clang::Parser::ParsingClass&) + 165
15 clang 0x00000001039c6ae8 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int, clang::Decl*) + 4136
16 clang 0x00000001039c519e clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext) + 6734
17 clang 0x00000001039aedfa clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 1722
18 clang 0x0000000103a0c709 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 73
19 clang 0x0000000103a0c3a7 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 359
20 clang 0x0000000103a0b9de clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 2558
21 clang 0x00000001039bfac9 clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*, std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 521
22 clang 0x00000001039bf092 clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&, clang::SourceLocation) + 4338
23 clang 0x00000001039ae2b0 clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 416
24 clang 0x0000000103a0b4eb clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 1291
25 clang 0x00000001039bfac9 clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*, std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) + 521
26 clang 0x00000001039bf092 clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&, clang::SourceLocation) + 4338
27 clang 0x00000001039ae2b0 clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 416
28 clang 0x0000000103a0b4eb clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 1291
29 clang 0x0000000103a0af57 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 311
30 clang 0x00000001039a4d96 clang::ParseAST(clang::Sema&, bool, bool) + 422
31 clang 0x0000000103961b0d clang::CodeGenAction::ExecuteAction() + 173
32 clang 0x00000001037286c9 clang::FrontendAction::Execute() + 105
33 clang 0x000000010370736d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973
34 clang 0x00000001036cbf2a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3322
35 clang 0x00000001036c3b58 cc1_main(char const**, char const**, char const*, void*) + 808
36 clang 0x00000001036c8678 main + 3352
37 libdyld.dylib 0x00007fff9175f5c9 start + 1
Stack dump:
0. Program arguments: /opt/local/libexec/llvm-3.2/bin/clang -cc1 -triple x86_64-apple-macosx10.10.0 -emit-obj -disable-free -main-file-name progress.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -coverage-file /Users/gadebski/meta/build/src/util/CMakeFiles/meta-util.dir/progress.cpp.o -resource-dir /opt/local/libexec/llvm-3.2/bin/../lib/clang/3.2 -isystem /usr/local/opt/icu4c/include -D CPPTOML_HAS_STD_PUT_TIME=1 -D CPPTOML_HAS_STD_REGEX=1 -D META_HAS_CXX14=1 -D META_HAS_STD_SHARED_PTR_ATOMICS=1 -D META_HAS_STREAM_MOVE=1 -D META_HAS_ZLIB -D META_IS_DARWIN=1 -D _DARWIN_USE_64_BIT_INODE=1 -D NDEBUG -I /Users/gadebski/meta/include -I /Users/gadebski/meta/deps/cpptoml/include -fmodule-cache-path /var/folders/09/2hnh3rds4wj2swg38_j37k600000gn/T/clang-module-cache -stdlib=libc++ -stdlib=libc++ -O3 -Wall -Wextra -pedantic -std=c++1y -fdeprecated-macro -fdebug-compilation-dir /Users/gadebski/meta/build/src/util -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.10.0 -fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o CMakeFiles/meta-util.dir/progress.cpp.o -x c++ /Users/gadebski/meta/src/util/progress.cpp
1. /Users/gadebski/meta/include/logging/logger.h:243:33: current parser token '{'
2. /Users/gadebski/meta/include/logging/logger.h:21:1: parsing namespace 'meta'
3. /Users/gadebski/meta/include/logging/logger.h:27:1: parsing namespace 'logging'
4. /Users/gadebski/meta/include/logging/logger.h:34:1: parsing struct/union/class body 'logger'
5. /Users/gadebski/meta/include/logging/logger.h:243:13: lambda expression parsing
clang: error: unable to execute command: Illegal instruction: 4
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/09/2hnh3rds4wj2swg38_j37k600000gn/T/progress-grMRZd.cpp
clang: note: diagnostic msg: /var/folders/09/2hnh3rds4wj2swg38_j37k600000gn/T/progress-grMRZd.sh
clang: note: diagnostic msg:
********************
make[2]: *** [src/util/CMakeFiles/meta-util.dir/progress.cpp.o] Error 254
make[1]: *** [src/util/CMakeFiles/meta-util.dir/all] Error 2
make: *** [all] Error 2
【问题讨论】:
-
which clang报告什么?这看起来不像是 Apple 的 clang 版本号 ... -
感谢您的回复。我之前为了另一个目的安装了 clang 3.2。现在我通过手动卸载 clang 3.2 解决了我的问题,这使系统能够识别苹果版本的 clang。
标签: c++ clang osx-yosemite