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

Could anyone advise me if it is possible to build Stan from source on a PowerPC Mac (specifically I have G5 Quad running 10.6 PPC) and whether it will function properly?

I have been able after some struggle to build R 4.1.1 from source via MacPorts 2.7.1. I have build from source all dependencies for base R, and it seems to be functional. However CmdStan installation got stuck, since some R package which it wanted failed to compile.

I got gcc4.2 (Apple one) and gcc7 built and running. As of now, no solution has been found to build gcc11. So gcc7 is the best compiler that works.

P. S. I can consider using a cross-compiler on an Intel Mac to build packages for PowerPC, if that way can work.

Try using cmdstanR: Getting started with CmdStanR • cmdstanr instead

That’s what I tried earlier and it failed. I will re-try today to find out what exactly fails and update the post here.

I would assume something required gcc10–11 by default, and I need to find a way to force gcc7 instead. For example, that was the reason RStudio building failed for me so far:

cmake .. -DRSTUDIO_TARGET=Desktop -DRSTUDIO_PACKAGE_BUILD=1
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building RStudio 2021.10.999-dev+999
-- Machine architecture: Power Macintosh
-- CMake build type: Debug
-- Using RStudio tools root: RSTUDIO_TOOLS_ROOT-NOTFOUND
-- Using Homebrew: HOMEBREW_PREFIX-NOTFOUND
-- Configured to build GWT
-- Using ant: /usr/bin/ant
-- Configured to install GWT
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Failed
CMake Error at src/cpp/CMakeLists.txt:64 (message):
The compiler /usr/bin/c++ has no C++11 support. Please use a different C++
compiler.

This did not help:

cmake .. -DRSTUDIO_TARGET=Desktop -DRSTUDIO_PACKAGE_BUILD=1 -DCMAKE_C_COMPILER='gcc-7'

Apparently R has a /Library/Frameworks/R.framework/Resources/etc/Makeconf config file that contains the definitions of macros used to compile R packages. Perhaps that needs to be modified to tell R to use your gcc7 whenever it tries to compile R packages.

https://cran.r-project.org/doc/manuals/r-devel/R-admin.html#C_002b_002b-Support

https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Installation-of-source-packages

Hmm, I have no such folder there at all.

Here is what fails with CmdStanR – data.table package building:

also installing the dependency ‘data.table’

trying URL 'https://cran.ism.ac.jp/src/contrib/data.table_1.14.2.tar.gz'
Content type 'application/x-gzip' length 5301817 bytes (5.1 MB)
==================================================
downloaded 5.1 MB

trying URL 'https://mc-stan.org/r-packages/src/contrib/cmdstanr_0.4.0.tar.gz'
Content type 'application/gzip' length 195914 bytes (191 KB)
==================================================
downloaded 191 KB

* installing *source* package ‘data.table’ ...
** package ‘data.table’ successfully unpacked and MD5 sums checked
** using staged installation
zlib 1.2.11 is available ok
R CMD SHLIB supports OpenMP without any extra hint
** libs
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c assign.c -o assign.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c between.c -o between.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c bmerge.c -o bmerge.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c chmatch.c -o chmatch.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c cj.c -o cj.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c coalesce.c -o coalesce.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c dogroups.c -o dogroups.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fastmean.c -o fastmean.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fcast.c -o fcast.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fifelse.c -o fifelse.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fmelt.c -o fmelt.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c forder.c -o forder.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c frank.c -o frank.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fread.c -o fread.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c freadR.c -o freadR.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c froll.c -o froll.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c frollR.c -o frollR.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c frolladaptive.c -o frolladaptive.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fsort.c -o fsort.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fwrite.c -o fwrite.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c fwriteR.c -o fwriteR.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c gsumm.c -o gsumm.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c ijoin.c -o ijoin.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c init.c -o init.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c inrange.c -o inrange.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c nafill.c -o nafill.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c nqrecreateindices.c -o nqrecreateindices.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c openmp-utils.c -o openmp-utils.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c quickselect.c -o quickselect.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c rbindlist.c -o rbindlist.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c reorder.c -o reorder.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c shift.c -o shift.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c snprintf.c -o snprintf.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c subset.c -o subset.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c transpose.c -o transpose.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c types.c -o types.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c uniqlist.c -o uniqlist.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c utils.c -o utils.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c vecseq.c -o vecseq.o
/opt/local/bin/gcc-mp-7 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/local/include    -fPIC  -pipe -Os -arch ppc  -c wrappers.c -o wrappers.o
/opt/local/bin/gcc-mp-7 -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/lib -Wl,-headerpad_max_install_names -arch ppc -o data.table.so assign.o between.o bmerge.o chmatch.o cj.o coalesce.o dogroups.o fastmean.o fcast.o fifelse.o fmelt.o forder.o frank.o fread.o freadR.o froll.o frollR.o frolladaptive.o fsort.o fwrite.o fwriteR.o gsumm.o ijoin.o init.o inrange.o nafill.o nqrecreateindices.o openmp-utils.o quickselect.o rbindlist.o reorder.o shift.o snprintf.o subset.o transpose.o types.o uniqlist.o utils.o vecseq.o wrappers.o -lz -F/opt/local/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
PKG_CFLAGS =
PKG_LIBS = -lz
if [ "data.table.so" != "datatable.so" ]; then mv data.table.so datatable.so; fi
if [ "" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then install_name_tool -id datatable.so datatable.so; fi
install_name_tool: object: datatable.so malformed object (unknown load command 7)
make: *** [all] Error 1
ERROR: compilation failed for package ‘data.table’
* removing ‘/Users/svacchanda/Library/R/powerpc/4.1/library/data.table’
ERROR: dependency ‘data.table’ is not available for package ‘cmdstanr’
* removing ‘/Users/svacchanda/Library/R/powerpc/4.1/library/cmdstanr’

The downloaded source packages are in
        ‘/private/var/folders/rD/rDeCM6SDHv8daLCecrRmrU+++TI/-Tmp-/RtmpNtlNn9/downloaded_packages’
Warning messages:
1: In install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/",  :
  installation of package ‘data.table’ had non-zero exit status
2: In install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/",  :
  installation of package ‘cmdstanr’ had non-zero exit status

So CmdStanR fails on trying to compile data.table package, and CmdStan itself after I downloaded the source fails with this:

36-197:~ svacchanda$ cd /Users/svacchanda/cmdstan-2.28.0
36-197:cmdstan-2.28.0 svacchanda$ make clean-all
rm -f -r test
rm -f
rm -f
rm -f
rm -f
  removing dependency files
rm -f   
rm -f   
rm -f   
make: *** No rule to make target `clean-libraries', needed by `clean-all'.  Stop.
36-197:cmdstan-2.28.0 svacchanda$ make build
curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/mac-stanc -o bin/stanc --retry 5 --retry-delay 10

curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
make: *** [bin/stanc] Error 35
36-197:cmdstan-2.28.0 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

I have managed to install CmdStanR itself and tried to install CmdStan from there. However it builds with errors and doesn’t work in result.

This is the error log:

> install_cmdstan(
+   dir = NULL,
+   cores = getOption("mc.cores", 4),
+   quiet = FALSE,
+   overwrite = TRUE,
+   timeout = 1200,
+   version = NULL,
+   release_url = NULL,
+   cpp_options = list("CXX" = "/opt/local/bin/g++-mp-7"),
+   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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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
/opt/local/bin/g++-mp-7 -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. ---
/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 stan/src/stan/model/model_header.hpp -o stan/src/stan/model/model_header.hpp.gch
/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/.cmdstanr/cmdstan-2.28.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/svacchanda/.cmdstanr/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 -fvisibility=hidden -o bin/cmdstan/print.o        -Wl,-L,"/Users/svacchanda/.cmdstanr/cmdstan-2.28.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/Users/svacchanda/.cmdstanr/cmdstan-2.28.1/stan/lib/stan_math/lib/tbb"   src/cmdstan/print.cpp
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/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/print.cpp:2:
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/print.o] Error 1
make: *** Waiting for unfinished jobs....
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

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

System info:

R version 4.1.2 (2021-11-01)
Platform: powerpc-apple-darwin10.0.0d2 (32-bit)
Running under: OS X Snow Leopard 10.6

Matrix products: default
BLAS:   /opt/local/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib
LAPACK: /opt/local/Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

I have set GCC as default compiler in Makevars and Makeconf, since Clang is known not to work on PPC.

That error indicates that the re-entrant (thread safe) version of the lgamma function is not implemented in the cmath libraries used by your compiler. Is there a different version that you can use?

Options that work are these:

Apple GCC 4.2.1
LLVM GCC 4.2
MacPorts GCC 6.5
MacPorts GCC 7.5

As of now, I am unable to build GCC8 and up. New Clang is non-functional on PowerPC.

I would guess that both macports compilers are likely to have the same issue.

There are two options you can try here. The MinGW compiler on Windows also does not have a re-entrant lgamma, and so Stan falls back to Boost in that case. You can force this to happen for your instance by adding the compiler flag for the MinGW compiler:

cpp_options = list("CXXFLAGS"="-D__MINGW32__")

Although I’m not sure how that will interact with the other libraries.

Alternatively, you can manually download the cmdstan source and remove the other lgamma definitions from stan/math/prim/fun/lgamma.hpp so that the Boost implementation is always used

P. S. Just in case, here is what I got in Makevars now. Please correct me, if settings are wrong.

CC=/opt/local/bin/gcc-mp-7
CXX=/opt/local/bin/g++-mp-7
FC=/opt/local/bin/gfortran-mp-7
F77=/opt/local/bin/gfortran-mp-7
MAKE = make -j4
FLIBS = -L/opt/local/lib/gcc7 -lgfortran -lquadmath -lm

It is definite that as long as something tries to use Clang or GCC8+, it will fail, at least until solution for newer GCC is found. So I need to force GCC7 to be used (or earlier compilers).

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