Override dependency on V8 or make V8 build on PowerPC Mac? (R 4.1.2)

I am 1 dependency away from building (or trying to at least) rstan on a PowerPC Mac. StanHeaders and others have been finally built, thanks to helpful suggestions here and on Git. The remaining obstacle is V8 dependency, which fails: V8 fails to build on PowerPC Mac with R 4.1.2 · Issue #132 · jeroen/V8 · GitHub

There are no easy solutions, from what I understand.

Does rstan require V8 for some essential reasons or some non-critical functionality? If the second, can it be bypassed? If yes, how to make it technically?

P. S. V8ppc exists but apparently does not support PowerPC Macs: Error: SDK "macosx" cannot be located. Is the OSX not supported? · Issue #114 · ibmruntimes/v8ppc · GitHub

One suggestion was given to me on Git and I am yet to try that: Please make a version for PowerPC Mac · Issue #1 · jeroen/build-v8-static · GitHub
However it is likely to fail, and homebrew as such is likely not to work on my system at all (I have 10.6 developer build, no binaries for it exist).

For 2.21 its not a critical part of rstan, for 2.26+ it will be required and can not be avoided (rstan will compile the Stan model with a Javascript Stan-to-C++ compiler).

Thank you. Could you advise how to compile Rstan without having V8 then? When I try install,packages, it R starts downloading V8 and building it, build fails due to lack of libv8, and Rstan doesn’t proceed.

I have found a patched version of Rstan on Github that does not require libv8, however it still fails to build:

Installing package into ‘/Users/svacchanda/Library/R/powerpc/4.1/library’
(as ‘lib’ is unspecified)
Warning in file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
* installing *source* package ‘rstan’ ...
** using staged installation
** libs
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c Module.cpp -o Module.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [Module.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c chains.cpp -o chains.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [chains.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c init.cpp -o init.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [init.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c misc.cpp -o misc.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [misc.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c pointer-tools.cpp -o pointer-tools.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [pointer-tools.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c sparse_extractors.cpp -o sparse_extractors.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [sparse_extractors.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan_fit_base.cpp -o stan_fit_base.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan_fit_base.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan_fit_rccp.cpp -o stan_fit_rccp.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan_fit_rccp.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stanc.cpp -o stanc.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stanc.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/ast_def.cpp -o stan/lang/ast_def.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/ast_def.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/bare_type_grammar_inst.cpp -o stan/lang/grammars/bare_type_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/bare_type_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/block_var_decls_grammar_inst.cpp -o stan/lang/grammars/block_var_decls_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/block_var_decls_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/expression07_grammar_inst.cpp -o stan/lang/grammars/expression07_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/expression07_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/expression_grammar_inst.cpp -o stan/lang/grammars/expression_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/expression_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/functions_grammar_inst.cpp -o stan/lang/grammars/functions_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/functions_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/indexes_grammar_inst.cpp -o stan/lang/grammars/indexes_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/indexes_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/local_var_decls_grammar_inst.cpp -o stan/lang/grammars/local_var_decls_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/local_var_decls_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/program_grammar_inst.cpp -o stan/lang/grammars/program_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/program_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/semantic_actions_def.cpp -o stan/lang/grammars/semantic_actions_def.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/semantic_actions_def.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/statement_2_grammar_inst.cpp -o stan/lang/grammars/statement_2_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/statement_2_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/statement_grammar_inst.cpp -o stan/lang/grammars/statement_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/statement_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/term_grammar_inst.cpp -o stan/lang/grammars/term_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/term_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/whitespace_grammar_inst.cpp -o stan/lang/grammars/whitespace_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/whitespace_grammar_inst.o] Error 127 (ignored)
-dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/Library/Frameworks/R.framework/Resources/libppc -L/opt/local/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/ -o rstan.so Module.o chains.o init.o misc.o pointer-tools.o sparse_extractors.o stan_fit_base.o stan_fit_rccp.o stanc.o stan/lang/ast_def.o stan/lang/grammars/bare_type_grammar_inst.o stan/lang/grammars/block_var_decls_grammar_inst.o stan/lang/grammars/expression07_grammar_inst.o stan/lang/grammars/expression_grammar_inst.o stan/lang/grammars/functions_grammar_inst.o stan/lang/grammars/indexes_grammar_inst.o stan/lang/grammars/local_var_decls_grammar_inst.o stan/lang/grammars/program_grammar_inst.o stan/lang/grammars/semantic_actions_def.o stan/lang/grammars/statement_2_grammar_inst.o stan/lang/grammars/statement_grammar_inst.o stan/lang/grammars/term_grammar_inst.o stan/lang/grammars/whitespace_grammar_inst.o -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
/bin/sh: -dynamiclib: command not found
make: *** [rstan.so] Error 127
ERROR: compilation failed for package ‘rstan’
* removing ‘/Users/svacchanda/Library/R/powerpc/4.1/library/rstan’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//RtmpjZwabD/file28167d4a38e0/rstan_2.21.2.tar.gz’ had non-zero exit status
>

I’ve made a fork of the rstan 2.21 source and removed the V8 stanc3-check dependency. You can install via:

remotes::install_github("andrjohns/rstan-1@no-v8-221")

I’ve verified that it works for me locally

1 Like

Thank you! I am trying it, and at the moment I get the same weird Error 127:

─  preparing ‘rstan’: (569ms)
✔  checking DESCRIPTION meta-information ...
─  cleaning src
✔  checking vignette meta-information ...
   Warning in file(con, "r") :
     cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories (639ms)
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘rstan_2.21.2.tar.gz’

Installing package into ‘/Users/svacchanda/Library/R/powerpc/4.1/library’
(as ‘lib’ is unspecified)
Warning in file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
* installing *source* package ‘rstan’ ...
** using staged installation
** libs
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c Module.cpp -o Module.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [Module.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c chains.cpp -o chains.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [chains.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c init.cpp -o init.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [init.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c misc.cpp -o misc.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [misc.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c pointer-tools.cpp -o pointer-tools.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [pointer-tools.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c sparse_extractors.cpp -o sparse_extractors.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [sparse_extractors.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan_fit_base.cpp -o stan_fit_base.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan_fit_base.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan_fit_rccp.cpp -o stan_fit_rccp.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan_fit_rccp.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stanc.cpp -o stanc.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stanc.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/ast_def.cpp -o stan/lang/ast_def.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/ast_def.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/bare_type_grammar_inst.cpp -o stan/lang/grammars/bare_type_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/bare_type_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/block_var_decls_grammar_inst.cpp -o stan/lang/grammars/block_var_decls_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/block_var_decls_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/expression07_grammar_inst.cpp -o stan/lang/grammars/expression07_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/expression07_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/expression_grammar_inst.cpp -o stan/lang/grammars/expression_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/expression_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/functions_grammar_inst.cpp -o stan/lang/grammars/functions_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/functions_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/indexes_grammar_inst.cpp -o stan/lang/grammars/indexes_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/indexes_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/local_var_decls_grammar_inst.cpp -o stan/lang/grammars/local_var_decls_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/local_var_decls_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/program_grammar_inst.cpp -o stan/lang/grammars/program_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/program_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/semantic_actions_def.cpp -o stan/lang/grammars/semantic_actions_def.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/semantic_actions_def.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/statement_2_grammar_inst.cpp -o stan/lang/grammars/statement_2_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/statement_2_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/statement_grammar_inst.cpp -o stan/lang/grammars/statement_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/statement_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/term_grammar_inst.cpp -o stan/lang/grammars/term_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/term_grammar_inst.o] Error 127 (ignored)
I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"." -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS   -I'/Users/svacchanda/Library/R/powerpc/4.1/library/Rcpp/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppEigen/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/BH/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/StanHeaders/include' -I'/Users/svacchanda/Library/R/powerpc/4.1/library/RcppParallel/include' -I/opt/local/include -I/opt/local/Library/Frameworks/R.framework/Resources/include     -pipe -Os -arch ppc -m32  -c stan/lang/grammars/whitespace_grammar_inst.cpp -o stan/lang/grammars/whitespace_grammar_inst.o
/bin/sh: I/opt/local/Library/Frameworks/R.framework/Resources/include: No such file or directory
make: [stan/lang/grammars/whitespace_grammar_inst.o] Error 127 (ignored)
-dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/Library/Frameworks/R.framework/Resources/lib -L/opt/local/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/ -o rstan.so Module.o chains.o init.o misc.o pointer-tools.o sparse_extractors.o stan_fit_base.o stan_fit_rccp.o stanc.o stan/lang/ast_def.o stan/lang/grammars/bare_type_grammar_inst.o stan/lang/grammars/block_var_decls_grammar_inst.o stan/lang/grammars/expression07_grammar_inst.o stan/lang/grammars/expression_grammar_inst.o stan/lang/grammars/functions_grammar_inst.o stan/lang/grammars/indexes_grammar_inst.o stan/lang/grammars/local_var_decls_grammar_inst.o stan/lang/grammars/program_grammar_inst.o stan/lang/grammars/semantic_actions_def.o stan/lang/grammars/statement_2_grammar_inst.o stan/lang/grammars/statement_grammar_inst.o stan/lang/grammars/term_grammar_inst.o stan/lang/grammars/whitespace_grammar_inst.o -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
/bin/sh: -dynamiclib: command not found
make: *** [rstan.so] Error 127
ERROR: compilation failed for package ‘rstan’
* removing ‘/Users/svacchanda/Library/R/powerpc/4.1/library/rstan’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//Rtmp7uY7Rj/fileb08410b6d70e/rstan_2.21.2.tar.gz’ had non-zero exit status

I don’t understand why it cannot find include folder, since it exists with that path. Maybe the issue is that it uses I instead of -I, I am yet to find a setting to change to correct that.

I will update you once I solve this path issue.

@andrjohns I have solved the problem with error 127 and this time compilation went almost to completion, but failed on this:

ar -rs ../inst/lib//libStanServices.a stan_fit.o stan_fit_base.o
ar: creating archive ../inst/lib//libStanServices.a
installing to /Users/svacchanda/Library/R/powerpc/4.1/library/00LOCK-rstan/00new/rstan/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Warning message:
In file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Warning in file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
Error: package or namespace load failed for ‘rstan’:
 .onLoad failed in loadNamespace() for 'rstan', details:
  call: dyn.load(tbbmalloc_proxy, local = FALSE, now = TRUE)
  error: unable to load shared object '/private/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-/RtmpIprbyl/R.INSTALLb6525da2c990/rstan/':
  dlopen(/private/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-/RtmpIprbyl/R.INSTALLb6525da2c990/rstan/, 10): no suitable image found.  Did find:
        /private/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-/RtmpIprbyl/R.INSTALLb6525da2c990/rstan/: not a file
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/svacchanda/Library/R/powerpc/4.1/library/rstan’
Warning messages:
1: In readLines(old_path) :
  incomplete final line found on '/Users/svacchanda/.R/Makevars'
2: In readLines(old_path) :
  incomplete final line found on '/Users/svacchanda/.R/Makevars'
3: In i.p(...) :
  installation of package ‘/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//Rtmps7IJqv/fileb60972a9c379/rstan_2.21.2.tar.gz’ had non-zero exit status
>

Please advise me what to try. Thanks to your help it almost succeeded.

P. S. A very similar error with Rstan building reported here for MacOS 11.4 arm64: M1 mac, cannot install binary, c++ exception (unknown reason) when using source install · Issue #947 · stan-dev/rstan · GitHub

@andrjohns A piece of somewhat good news: Rstan compiled through completion and installed. I downloaded your source to my machine, removed a call to unload tbbmalloc in zzz.R file that led to the error above, and that sorted installation.

However, when I tried to compile a simple test model, I got libtbb.dylib error:

[R.app GUI 1.72 (7847) powerpc-apple-darwin10.0.0d2]

[History restored from /Users/svacchanda/.Rapp.history]

> library(rstan)
Loading required package: StanHeaders
Loading required package: ggplot2
Need help getting started? Try the R Graphics Cookbook: https://r-graphics.org
rstan (Version 2.21.2, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
options(mc.cores = parallel::detectCores()).
To avoid recompilation of unchanged Stan programs, we recommend calling
rstan_options(auto_write = TRUE)
Warning message:
In file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
> scode <- "
+ parameters {
+   real y[2];
+ }
+ model {
+   y[1] ~ normal(0, 1);
+   y[2] ~ double_exponential(0, 2);
+ }
+ "
> fit1 <- stan(model_code = scode, iter = 10, verbose = FALSE)
Error in dyn.load(libLFile) :
  unable to load shared object '/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//RtmpnOlqOR/filed69511e8933e.so':
  dlopen(/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//RtmpnOlqOR/filed69511e8933e.so, 6): Library not loaded: @rpath/libtbb.dylib
  Referenced from: /var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-//RtmpnOlqOR/filed69511e8933e.so
  Reason: image not found
Error in sink(type = "output") : invalid connection
>

Is there a way to resolve this?