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