Stan in R on PowerPC G5 (10.6 PPC): Help needed

Using MinGW compiler flag resulted in the following:

> library(cmdstanr)
This is cmdstanr version 0.4.0
- Online documentation and vignettes at mc-stan.org/cmdstanr
- CmdStan path set to: /Users/svacchanda/.cmdstanr/cmdstan-2.28.1
- Use set_cmdstan_path() to change the path
>  install_cmdstan(
+   dir = NULL,
+   cores = getOption("mc.cores", 4),
+   quiet = FALSE,
+   overwrite = TRUE,
+   timeout = 1200,
+   version = NULL,
+   release_url = NULL,
+   cpp_options = list("CXX"="gcc","CXXFLAGS"="-D__MINGW32__"),
+   check_toolchain = TRUE
+ )
The C++ toolchain required for CmdStan is setup properly!
* Latest CmdStan release is v2.28.1
* Installing CmdStan v2.28.1 in /Users/svacchanda/.cmdstanr/cmdstan-2.28.1
* Downloading cmdstan-2.28.1.tar.gz from GitHub...
* Removing the existing installation of CmdStan...
* Download complete
* Unpacking archive...
* Building CmdStan binaries...
cp bin/mac-stanc bin/stanc
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/nvector/serial/nvector_serial.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/nvector/serial/nvector_serial.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodea.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodea.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_math.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_math.o
chmod +x bin/stanc
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodea_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodea_io.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_bandpre.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_bandpre.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_bbdpre.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_bbdpre.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_diag.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_diag.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_direct.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_direct.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_io.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_ls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_ls.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_sim.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_sim.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_stg.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_stg.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_stg1.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_stg1.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_spils.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_spils.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_band.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_band.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_dense.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_dense.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_direct.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_direct.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_futils.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_futils.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_linearsolver.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_linearsolver.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_iterative.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_iterative.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_matrix.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_matrix.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_memory.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_memory.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nonlinearsolver.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nonlinearsolver.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector_senswrapper.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector_senswrapper.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_version.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_version.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/band/sunmatrix_band.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/band/sunmatrix_band.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/dense/sunmatrix_dense.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/dense/sunmatrix_dense.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/band/sunlinsol_band.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/band/sunlinsol_band.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/dense/sunlinsol_dense.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/dense/sunlinsol_dense.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/newton/sunnonlinsol_newton.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/newton/sunnonlinsol_newton.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idaa.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idaa.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idaa_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idaa_io.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_bbdpre.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_bbdpre.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_direct.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_direct.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_ic.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_ic.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_io.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_ls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_ls.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls_sim.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls_sim.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls_stg.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls_stg.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_spils.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_spils.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_bbdpre.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_bbdpre.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_direct.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_direct.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_io.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_ls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_ls.o
gcc -pipe   -D_REENTRANT  -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT     -O3  -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_spils.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_spils.o
touch stan/lib/stan_math/lib/tbb/tbb-make-check

--- Compiling the main object file. This might take up to a minute. ---
gcc -D__MINGW32__ -std=c++1y -D_REENTRANT -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include    -DBOOST_DISABLE_ASSERTS          -c -o src/cmdstan/main.o src/cmdstan/main.cpp
cc1plus: error: unrecognized command line option "-Wno-ignored-attributes"
--- Compiling pre-compiled header. This might take a few seconds. ---
gcc -D__MINGW32__ -std=c++1y -D_REENTRANT -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include    -DBOOST_DISABLE_ASSERTS          -c stan/src/stan/model/model_header.hpp -o stan/src/stan/model/model_header.hpp.gch

cc1plus: error: unrecognized command line option "-std=c++1y"
make: *** [src/cmdstan/main.o] Error 1
make: *** Waiting for unfinished jobs....
powerpc-apple-darwin10-gcc-4.2.1: stan/src/stan/model/model_header.hpp: linker input file unused because linking not done

Warning message:
There was a problem during installation. See the error message(s) above.
>

That error occurred because you’re now using GCC 4.2.1 , which does not have the c++14 extensions enabled.

I’ve opened a PR to allow manually specifying the use of Boost’s lgamma: Allow forcing use of Boost lgamma on Unix by andrjohns · Pull Request #2618 · stan-dev/math · GitHub

Once that’s merged you should be able to build against the development branch of cmdstan

1 Like

Yes, I have changed compiler to g+±mp-7, and I am back to the lgamma error.

P. S. Meanwhile the complete Rstan fails on these dependencies:
RcppParallel fails: Fails to buils on PowerPC Mac (MacOS 10.6, R 4.1.2) due to using Clang · Issue #176 · RcppCore/RcppParallel · GitHub
Which prevents StanHeaders from trying to compile.
And V8 also fails.

In that case you will have to unfortunately wait until that PR is reviewed and merged or patch the files locally yourself.

Also, you’re likely to run into issues with stanc3. We only build stanc3 for x86 macOS, so when you install and the binary is downloaded it is likely not going to run. You’ll have to install opam/ocaml and build stanc3 locally unfortunately

I have tried to compile from source directly, but this way fails much earlier. There are three attempts. First it tried to use Clang. Then I modified Makefile to remove dependency on Clang, and used g++ and finally full path to MacPorts compiler:

36-82:cmdstan-2.28.1 svacchanda$ cd /Users/svacchanda/Documents/cmdstan-2.28.1
36-82:cmdstan-2.28.1 svacchanda$ make build -j4
make: *** No rule to make target `build'.  Stop.
36-82:cmdstan-2.28.1 svacchanda$ cd /Users/svacchanda/Documents/cmdstan-2.28.1/cmdstan-2.28.1
36-82:cmdstan-2.28.1 svacchanda$ make build -j4
make: *** No rule to make target `stan/src/stan/model/model_header.hpp', needed by `stan/src/stan/model/model_header.hpp.gch'.  Stop.
make: *** Waiting for unfinished jobs....
curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/mac-stanc -o bin/stanc --retry 5 --retry-delay 10

--- Compiling the main object file. This might take up to a minute. ---
clang++    -c -o src/cmdstan/main.o src/cmdstan/main.cpp
make: posix_spawn: clang++: No such file or directory

curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
make: *** [bin/stanc] Error 35
36-82:cmdstan-2.28.1 svacchanda$ make build -j4
make: *** No rule to make target `stan/src/stan/model/model_header.hpp', needed by `stan/src/stan/model/model_header.hpp.gch'.  Stop.
make: *** Waiting for unfinished jobs....

curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/mac-stanc -o bin/stanc --retry 5 --retry-delay 10
--- Compiling the main object file. This might take up to a minute. ---
g++    -c -o src/cmdstan/main.o src/cmdstan/main.cpp
src/cmdstan/main.cpp:1:31: error: cmdstan/command.hpp: No such file or directory
src/cmdstan/main.cpp:2:41: error: stan/services/error_codes.hpp: No such file or directory
src/cmdstan/main.cpp: In function ‘int main(int, const char**)’:
src/cmdstan/main.cpp:6: error: ‘cmdstan’ has not been declared
src/cmdstan/main.cpp:8: error: ‘cmdstan’ has not been declared
src/cmdstan/main.cpp:10: error: ‘cmdstan’ has not been declared
src/cmdstan/main.cpp:11: error: expected unqualified-id before ‘&’ token
src/cmdstan/main.cpp:11: error: expected `)' before ‘&’ token
src/cmdstan/main.cpp:11: error: expected `{' before ‘&’ token
src/cmdstan/main.cpp:11: error: ‘e’ was not declared in this scope
src/cmdstan/main.cpp:11: error: expected `;' before ‘)’ token
make: *** [src/cmdstan/main.o] Error 1

curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
make: *** [bin/stanc] Error 35
36-82:cmdstan-2.28.1 svacchanda$ make build -j4
make: *** No rule to make target `stan/src/stan/model/model_header.hpp', needed by `stan/src/stan/model/model_header.hpp.gch'.  Stop.
make: *** Waiting for unfinished jobs....
curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/mac-stanc -o bin/stanc --retry 5 --retry-delay 10

--- Compiling the main object file. This might take up to a minute. ---
/opt/local/bin/g++-mp-7    -c -o src/cmdstan/main.o src/cmdstan/main.cpp
src/cmdstan/main.cpp:1:10: fatal error: cmdstan/command.hpp: No such file or directory
 #include <cmdstan/command.hpp>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [src/cmdstan/main.o] Error 1

curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
make: *** [bin/stanc] Error 35
36-82:cmdstan-2.28.1 svacchanda$

P. S. The curl problem is due to system curl being outdated. Macports version of curl works normally, but it has to be enforced to be used outside of Macports somehow.

When you build from source you need to either git clone the repository recursively or download the source tarball from the releases page. Otherwise the submodules for Stan and Math aren’t included

1 Like

In fact I already tried installing opam/ocaml since they are available on MacPorts, and that failed. Ocalm fails due to dependency on Clang. I may be able to get over that or may not. Easy fixing port file didn’t solve the problem.

Sundials and Mpich-gcc7 also fail due to Clang dependencies.

Out of required libraries for math two have built as of now: Boost and Eigen.

P. S. Everything has to be done from scratch, unfortunately. It took me few weeks to build modern R from sources and make a functional version of R GUI from sources via Xcode (port failed to install, developers of R GUI on Github were less than helpful, even certain sources are nowhere readily available, and provided information is incorrect). Supposedly the last R working on PPC is 2.x with GUI 1.5. I have R 4.1.2 with GUI 1.70 now. Unfortunately, I was unable to find old sources of RStudio, and binaries are Intel-only.

I wonder if it would be worth trying a linux distro instead? Either running off a live usb or another hard drive. Debian 8 was the last official release which supported 32bit powerpc, but that should be recent enough to have a decent number of packages available and compatible: Debian -- PowerPC Port

Thank you, I was clicking on a wrong source code indeed. Downloaded complete version, and this is what I get:

36-82:cmdstan-2.28.1 svacchanda$ make build -j4
ar -rs stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_5.7.0/src/nvector/serial/nvector_serial.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_math.o
ar: creating archive stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_nvecserial.a
ar -rs stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodea.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodea_io.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_bandpre.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_bbdpre.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_diag.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_direct.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_io.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_ls.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_sim.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_stg.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_stg1.o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_spils.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_direct.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_futils.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_iterative.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_linearsolver.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_math.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_matrix.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_memory.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nonlinearsolver.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector_senswrapper.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_version.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/band/sunmatrix_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/dense/sunmatrix_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/band/sunlinsol_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/dense/sunlinsol_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/newton/sunnonlinsol_newton.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.o
ar -rs stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_idas.a stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idaa.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idaa_io.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_bbdpre.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_direct.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_ic.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_io.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_ls.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls_sim.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls_stg.o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_spils.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_direct.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_futils.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_iterative.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_linearsolver.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_math.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_matrix.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_memory.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nonlinearsolver.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector_senswrapper.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_version.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/band/sunmatrix_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/dense/sunmatrix_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/band/sunlinsol_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/dense/sunlinsol_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/newton/sunnonlinsol_newton.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.o
ar: creating archive stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_cvodes.a
ar -rs stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_kinsol.a stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol.o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_bbdpre.o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_direct.o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_io.o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_ls.o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_spils.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_direct.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_futils.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_iterative.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_linearsolver.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_math.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_matrix.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_memory.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nonlinearsolver.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector_senswrapper.o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_version.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/band/sunmatrix_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/dense/sunmatrix_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/band/sunlinsol_band.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/dense/sunlinsol_dense.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/newton/sunnonlinsol_newton.o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.o
ar: creating archive stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_idas.a
ar: creating archive stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_kinsol.a
tbb_root="../tbb_2020.3" CXX="/opt/local/bin/g++-mp-7" CC="/opt/local/bin/gcc-mp-7" LDFLAGS='-Wl,-L,"/Users/svacchanda/Documents/cmdstan-2.28.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/svacchanda/Documents/cmdstan-2.28.1/stan/lib/stan_math/lib/tbb"  ' 'make' -C "stan/lib/stan_math/lib/tbb" -r -f "/Users/svacchanda/Documents/cmdstan-2.28.1/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbbmalloc" compiler=gcc cfg=release stdver=c++1y malloc CXXFLAGS="-Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation  "

--- Compiling the main object file. This might take up to a minute. ---

/opt/local/bin/g++-mp-7 -std=c++1y -D_REENTRANT -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include    -DBOOST_DISABLE_ASSERTS          -c -o src/cmdstan/main.o src/cmdstan/main.cpp
--- Compiling pre-compiled header. This might take a few seconds. ---
/opt/local/bin/g++-mp-7 -std=c++1y -D_REENTRANT -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include    -DBOOST_DISABLE_ASSERTS          -c -fvisibility=hidden -o bin/cmdstan/stansummary.o        -Wl,-L,"/Users/svacchanda/Documents/cmdstan-2.28.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/svacchanda/Documents/cmdstan-2.28.1/stan/lib/stan_math/lib/tbb"   src/cmdstan/stansummary.cpp
/opt/local/bin/g++-mp-7 -std=c++1y -D_REENTRANT -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include    -DBOOST_DISABLE_ASSERTS          -c stan/src/stan/model/model_header.hpp -o stan/src/stan/model/model_header.hpp.gch
/bin/sh: clang: command not found
/opt/local/bin/g++-mp-7 -c -MMD -O2 -DUSE_PTHREAD  -arch ppc64   -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-non-virtual-dtor -fPIC -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/backend.cpp
/opt/local/bin/g++-mp-7 -c -MMD -O2 -DUSE_PTHREAD  -arch ppc64   -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-non-virtual-dtor -fPIC -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/large_objects.cpp
/opt/local/bin/g++-mp-7 -c -MMD -O2 -DUSE_PTHREAD  -arch ppc64   -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-non-virtual-dtor -fPIC -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/backref.cpp
/opt/local/bin/g++-mp-7 -c -MMD -O2 -DUSE_PTHREAD  -arch ppc64   -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-non-virtual-dtor -fPIC -flifetime-dse=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/tbbmalloc.cpp
/opt/local/bin/g++-mp-7 -c -MMD -O2 -DUSE_PTHREAD  -arch ppc64   -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-non-virtual-dtor -fPIC -flifetime-dse=1 -o itt_notify_malloc.o -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/itt_notify.cpp
sh ../tbb_2020.3/build/version_info_macos.sh /opt/local/bin/g++-mp-7 -O2 -DUSE_PTHREAD  -arch ppc64  -Wall -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1  -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include >version_string.ver
../tbb_2020.3/build/version_info_macos.sh: line 22: clang: command not found
/opt/local/bin/g++-mp-7 -E -x c++ ../tbb_2020.3/src/tbbmalloc/mac64-tbbmalloc-export.def -O2 -DUSE_PTHREAD  -arch ppc64  -Wall -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1  -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1  -Wno-non-virtual-dtor -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include > tbbmalloc.def
/opt/local/bin/g++-mp-7 -c -MMD -O2 -DUSE_PTHREAD  -arch ppc64  -Wall -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1  -Wno-non-virtual-dtor -fPIC -flifetime-dse=1 -D__TBBMALLOC_BUILD=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I../tbb_2020.3/src/tbbmalloc -I../tbb_2020.3/src/tbbmalloc ../tbb_2020.3/src/tbbmalloc/proxy.cpp
In file included from /usr/include/mach/mach_interface.h:50:0,
                 from /usr/include/mach/mach.h:67,
                 from ../tbb_2020.3/src/tbbmalloc/proxy_overload_osx.h:49,
                 from ../tbb_2020.3/src/tbbmalloc/proxy.cpp:163:
/usr/include/mach/task.h:35:10: fatal error: mach/ppc64/task.h: No such file or directory
 #include <mach/ppc64/task.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [proxy.o] Error 1
make: *** [stan/lib/stan_math/lib/tbb/tbbmalloc.def] Error 2
make: *** Waiting for unfinished jobs....
In file included from stan/lib/stan_math/stan/math/prim/fun/beta.hpp:6:0,
                 from stan/lib/stan_math/stan/math/prim/fun.hpp:30,
                 from stan/lib/stan_math/stan/math/prim.hpp:14,
                 from stan/src/stan/io/stan_csv_reader.hpp:5,
                 from stan/src/stan/mcmc/chains.hpp:4,
                 from src/cmdstan/stansummary_helper.hpp:4,
                 from src/cmdstan/stansummary.cpp:1:
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp: In function 'double stan::math::lgamma(double)':
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:66:12: error: '::lgamma_r' has not been declared
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:66:12: note: suggested alternative: 'lgamma'
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
            lgamma
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp: In function 'double stan::math::lgamma(int)':
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:85:12: error: '::lgamma_r' has not been declared
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:85:12: note: suggested alternative: 'lgamma'
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
            lgamma
In file included from stan/lib/stan_math/stan/math/prim/fun/beta.hpp:6:0,
                 from stan/lib/stan_math/stan/math/rev/fun/beta.hpp:6,
                 from stan/lib/stan_math/stan/math/rev/fun.hpp:26,
                 from stan/lib/stan_math/stan/math/rev.hpp:10,
                 from stan/lib/stan_math/stan/math.hpp:19,
                 from stan/src/stan/model/model_header.hpp:4:
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp: In function 'double stan::math::lgamma(double)':
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:66:12: error: '::lgamma_r' has not been declared
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:66:12: note: suggested alternative: 'lgamma'
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
            lgamma
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp: In function 'double stan::math::lgamma(int)':
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:85:12: error: '::lgamma_r' has not been declared
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:85:12: note: suggested alternative: 'lgamma'
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
            lgamma
In file included from stan/lib/stan_math/stan/math/prim/fun/beta.hpp:6:0,
                 from stan/lib/stan_math/stan/math/prim/fun.hpp:30,
                 from stan/lib/stan_math/stan/math/prim.hpp:14,
                 from stan/src/stan/io/dump.hpp:7,
                 from src/cmdstan/command.hpp:30,
                 from src/cmdstan/main.cpp:1:
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp: In function 'double stan::math::lgamma(double)':
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:66:12: error: '::lgamma_r' has not been declared
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:66:12: note: suggested alternative: 'lgamma'
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
            lgamma
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp: In function 'double stan::math::lgamma(int)':
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:85:12: error: '::lgamma_r' has not been declared
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
stan/lib/stan_math/stan/math/prim/fun/lgamma.hpp:85:12: note: suggested alternative: 'lgamma'
   return ::lgamma_r(x, &sign);
            ^~~~~~~~
            lgamma
make: *** [bin/cmdstan/stansummary.o] Error 1
make: *** [src/cmdstan/main.o] Error 1
make: *** [stan/src/stan/model/model_header.hpp.gch] Error 1

I would be okay with 64 bit (PowerPC G5), but Linux or rather BSD is a step I can take if everything fails on MacOS.
For one thing, it will be inconvenient for practical reasons (rebooting into other OS just for the sake of running R). From another side, making it work on MacOS will probably benefit someone else who faces a similar issue. It is sad that many developers give up on PowerPC, since G5 ones are pretty capable even nowadays.

(I have a backup route with Julia instead of R, but perhaps all the same issues with Stan will arise in that case too.)

Yes, Julia will have all the same issues as it just calls cmdstan.

The errors above are due to TBB, both because it’s looking for clang and because it’s assuming that you’re using 64bit powerpc. You can use Stan to force the choice of c compiler with the TBB by creating a make/local file and adding: TBB_CC = /opt/local/bin/gcc-mp-7

However there’s no easy resolution for the error:

/usr/include/mach/task.h:35:10: fatal error: mach/ppc64/task.h: No such file or directory
 #include <mach/ppc64/task.h>
          ^~~~~~~~~~~~~~~~~~~

As that is caused by some part of the TBB’s build/config process that Stan doesn’t interact with.

I have some success in proceeding toward building rstan, though V8 failed at the moment: Override dependency on V8 or make V8 build on PowerPC Mac? (R 4.1.2)

If that is sorted and I am ready to build rstan itself, all the same issues as with CmdStan will arise, right? I am thinking how to minimize “dependency hell”, since fixing every failing component is usually a non-trivial task in its own right.

If you have an option to work with a more recent CPU & operating system than powerpc G5 & Mac OS X 10.6 , I suspect things will become much easier. It looks like many open source tools and libraries no longer maintain support for that platform, so it might be simpler to switch to a different platform that is supported.

@andrjohns I have made through building all required libraries with Macports:

36-9:~ svacchanda$ port installed tbb
The following ports are currently installed:
  tbb @2020.3_0 (active)
36-9:~ svacchanda$ port installed eigen
The following ports are currently installed:
  eigen @2.0.17_0 (active)
36-9:~ svacchanda$ port installed boost
The following ports are currently installed:
  boost @1.76_0 (active)
36-9:~ svacchanda$ port installed sundials
The following ports are currently installed:
  sundials @5.7.0_0+accelerate+gcc7+mpich (active)

How do I use these for CmdStan in place of its own attached libs?

There are make variables you should be able to set to point cmdstan to them, but they’re sadly not that documented anywhere. @rok_cesnovar has been able to help me with some in the past, I know for TBB you need to set TBB_INC and TBB_LIB to point to the path with the headers and library respectively, and I suspect there are the same for other libraries

It looks like the macports Eigen is very out of date (we’re currently on 3.3.9), and won’t be compatible with Stan. If the TBB is the only library you can’t build locally, then you should use the TBB_INC and TBB_LIB flags that @WardBrian mentioned. There’s some more guidance on those in this section of the Github readme.

Unfortunately we don’t have equivalent functionality for the other libraries, only the TBB

1 Like

I have finally built gcc10 and gcc11 natively on PowerPC, however CmdStan still fails with the same lgamma error when I tried to build using gcc10. This looks like a problem on CmdStan side.

For the Boost lgamma fix to work, you need to use the github version of cmdstan (the changes aren’t in a release yet).

Then, in your make/local file, add:

CXXFLAGS += -D_BOOST_LGAMMA
1 Like

Thank you! I will try and update you.

I wanna rebuild R using gcc11 outside of Macports also. At the moment there is some issue with building 64-bit on 10.5.8, but 32-bit works both on 10.5.8 and 10.6 PPC.

Wow! According to Wikipedia, those are from 2003 to 2006! It’s amazing anything still runs on those, because Apple’s not exactly Microsoft in terms of its commitment to backwards compatibility.