I was just saying there might be problems with the clang included in Xcode for *older* version of Mac.
A while ago, I tried to use clang build rstan on a Snow Leopard with Xcode 3.2.6 but failed. I did not pay attention then. I tried again today and heere is the part of error message: (file math__matrix.cpp in rstan is math/matrix.cpp in Stan). The version of clang is
I tried to compile the math/matrix.cpp in Stan using this clang, which seems to work if -DNDEBUG is not specified, but would have the same problem if it is specified.
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c math__matrix.cpp -o math__matrix.o
0 clang 0x0000000100de1252 PrintStackTrace(void*) + 34
1 clang 0x0000000100de1729 SignalHandler(int) + 633
2 libSystem.B.dylib 0x00007fff84d891ba _sigtramp + 26
3 libSystem.B.dylib 0x00007fff5fbfa8d8 _sigtramp
+ 3672577848
4 clang 0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
5 clang 0x00000001003ec19f llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 287
6 clang 0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
7 clang 0x00000001003ec15d llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 221
8 clang 0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
9 clang 0x00000001003ec15d llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 221
10 clang 0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
11 clang 0x00000001003e42af llvm::ScalarEvolution::getAddExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::SCEV::NoWrapFlags) + 6175
12 clang 0x00000001003e2a4c llvm::ScalarEvolution::getAddExpr(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags) + 108
13 clang 0x00000001003dcddc llvm::ScalarEvolution::createSCEV(llvm::Value*) + 6204
14 clang 0x00000001003db2de llvm::ScalarEvolution::getSCEV(llvm::Value*) + 382
15 clang 0x00000001003dade2 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 274
16 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
17 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
18 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
19 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
20 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
21 clang 0x00000001003dacbb llvm::IVUsers::runOnLoop(llvm::Loop*, llvm::LPPassManager&) + 347
22 clang 0x00000001001fa244 llvm::LPPassManager::runOnFunction(llvm::Function&) + 996
23 clang 0x0000000100132855 llvm::FPPassManager::runOnFunction(llvm::Function&) + 325
24 clang 0x000000010013739b llvm::FPPassManager::runOnModule(llvm::Module&) + 139
25 clang 0x0000000100132fd4 llvm::MPPassManager::runOnModule(llvm::Module&) + 276
26 clang 0x0000000100132b58 llvm::PassManagerImpl::run(llvm::Module&) + 280
27 clang 0x0000000100132a3d llvm::PassManager::run(llvm::Module&) + 13
28 clang 0x000000010060196d clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 4381
29 clang 0x000000010011a3f6 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 246
30 clang 0x0000000100042276 clang::ParseAST(clang::Sema&, bool) + 422
31 clang 0x0000000100040caf clang::CodeGenAction::ExecuteAction() + 671
32 clang 0x000000010002ca9b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 875
33 clang 0x000000010002ab18 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2696
34 clang 0x000000010001f315 cc1_main(char const**, char const**, char const*, void*) + 5333
35 clang 0x000000010000247b main + 667
36 clang 0x00000001000021d4 start + 52
37 clang 0x000000000000003d start + 4294958749
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.6.8 -emit-obj -disable-free -disable-llvm-verifier -main-file-name math__matrix.cpp -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -coverage-file math__matrix.o -resource-dir /usr/bin/../lib/clang/3.0 -D NDEBUG -I /Library/Frameworks/R.framework/Resources/include -I /Library/Frameworks/R.framework/Resources/include/x86_64 -I ../inst/include/stansrc -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported -I ../inst/include/stanlib/boost_1.51.0 -I ../inst/include -I /usr/local/include -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include -O3 -fdeprecated-macro -ferror-limit 19 -fmessage-length 135 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o math__matrix.o -x c++ math__matrix.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'math__matrix.cpp'.
4. Running pass 'Loop Pass Manager' on function '@_ZN5Eigen22SelfAdjointEigenSolverINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE7computeERKS2_i'
5. Running pass 'Induction Variable Users' on basic block '%253'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
make: *** [math__matrix.o] Error 254
P.S. Full error message:
mmac:Desktop jq2$ R --arch x86_64 CMD INSTALL rstan_1.0.2.tar.gz
* installing to library '/Library/Frameworks/R.framework/Versions/2.15/Resources/library'
* installing *source* package 'rstan' ...
** package 'rstan' successfully unpacked and MD5 sums checked
** libs
** arch - x86_64
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c stanc.cpp -o stanc.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c gm__grammars__whitespace_grammar_inst.cpp -o gm__grammars__whitespace_grammar_inst.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c gm__grammars__program_grammar_inst.cpp -o gm__grammars__program_grammar_inst.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c gm__grammars__statement_grammar_inst.cpp -o gm__grammars__statement_grammar_inst.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c gm__ast_def.cpp -o gm__ast_def.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c gm__grammars__var_deccls_grammar_inst.cpp -o gm__grammars__var_deccls_grammar_inst.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c gm__grammars__expression_grammar_inst.cpp -o gm__grammars__expression_grammar_inst.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c chains.cpp -o chains.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c misc.cpp -o misc.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c agrad__agrad.cpp -o agrad__agrad.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c agrad__matrix.cpp -o agrad__matrix.o
clang++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -I"../inst/include/stansrc" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include" -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported" -I"../inst/include/stanlib/boost_1.51.0" -I"../inst/include" -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -O3 -c math__matrix.cpp -o math__matrix.o
0 clang 0x0000000100de1252 PrintStackTrace(void*) + 34
1 clang 0x0000000100de1729 SignalHandler(int) + 633
2 libSystem.B.dylib 0x00007fff84d891ba _sigtramp + 26
3 libSystem.B.dylib 0x00007fff5fbfa8d8 _sigtramp
+ 3672577848
4 clang 0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
5 clang 0x00000001003ec19f llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 287
6 clang 0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
7 clang 0x00000001003ec15d llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 221
8 clang 0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
9 clang 0x00000001003ec15d llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 221
10 clang 0x00000001003ebfef llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) + 95
11 clang 0x00000001003e42af llvm::ScalarEvolution::getAddExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::SCEV::NoWrapFlags) + 6175
12 clang 0x00000001003e2a4c llvm::ScalarEvolution::getAddExpr(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags) + 108
13 clang 0x00000001003dcddc llvm::ScalarEvolution::createSCEV(llvm::Value*) + 6204
14 clang 0x00000001003db2de llvm::ScalarEvolution::getSCEV(llvm::Value*) + 382
15 clang 0x00000001003dade2 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 274
16 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
17 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
18 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
19 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
20 clang 0x00000001003daf80 llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*) + 688
21 clang 0x00000001003dacbb llvm::IVUsers::runOnLoop(llvm::Loop*, llvm::LPPassManager&) + 347
22 clang 0x00000001001fa244 llvm::LPPassManager::runOnFunction(llvm::Function&) + 996
23 clang 0x0000000100132855 llvm::FPPassManager::runOnFunction(llvm::Function&) + 325
24 clang 0x000000010013739b llvm::FPPassManager::runOnModule(llvm::Module&) + 139
25 clang 0x0000000100132fd4 llvm::MPPassManager::runOnModule(llvm::Module&) + 276
26 clang 0x0000000100132b58 llvm::PassManagerImpl::run(llvm::Module&) + 280
27 clang 0x0000000100132a3d llvm::PassManager::run(llvm::Module&) + 13
28 clang 0x000000010060196d clang::EmitBackendOutput(clang::Diagnostic&, clang::CodeGenOptions const&, clang::TargetOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 4381
29 clang 0x000000010011a3f6 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 246
30 clang 0x0000000100042276 clang::ParseAST(clang::Sema&, bool) + 422
31 clang 0x0000000100040caf clang::CodeGenAction::ExecuteAction() + 671
32 clang 0x000000010002ca9b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 875
33 clang 0x000000010002ab18 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2696
34 clang 0x000000010001f315 cc1_main(char const**, char const**, char const*, void*) + 5333
35 clang 0x000000010000247b main + 667
36 clang 0x00000001000021d4 start + 52
37 clang 0x000000000000003d start + 4294958749
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.6.8 -emit-obj -disable-free -disable-llvm-verifier -main-file-name math__matrix.cpp -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -coverage-file math__matrix.o -resource-dir /usr/bin/../lib/clang/3.0 -D NDEBUG -I /Library/Frameworks/R.framework/Resources/include -I /Library/Frameworks/R.framework/Resources/include/x86_64 -I ../inst/include/stansrc -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/RcppEigen/include/unsupported -I ../inst/include/stanlib/boost_1.51.0 -I ../inst/include -I /usr/local/include -I /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include -O3 -fdeprecated-macro -ferror-limit 19 -fmessage-length 135 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o math__matrix.o -x c++ math__matrix.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'math__matrix.cpp'.
4. Running pass 'Loop Pass Manager' on function '@_ZN5Eigen22SelfAdjointEigenSolverINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE7computeERKS2_i'
5. Running pass 'Induction Variable Users' on basic block '%253'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
make: *** [math__matrix.o] Error 254
ERROR: compilation failed for package 'rstan'
* removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/rstan'