Still unable to install rstan and other dependencies for brms package on macOS Big Sur

Short summary of the problem:
I’m trying to install the brms package on R 4.1 on a macOS 11.6 (Big Sur). I can see that R is trying to install some dependent packages including rstan, V8, shinystan, projpred. All of these are returning multiple errors resulting the installations having non-zero exist status. I have been browsing various forums attempting to troubleshoot this issue and unfortunately nothing seems to be working. I have Xcode installed. I’ve tried installing some of these dependencies outside of R. I tried installing the macOS R toolchain installer but the installer did not work.

Does anyone have any suggestions for solutions for this issue? I have pasted the R error output below. Thanks!

install.packages(“brms”)
Installing package into ‘/usr/local/lib/R/4.1/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘V8’, ‘rstan’, ‘shinystan’, ‘projpred’

trying URL ‘https://cran.rstudio.com/src/contrib/V8_3.4.2.tar.gz
Content type ‘application/x-gzip’ length 801493 bytes (782 KB)

downloaded 782 KB

trying URL ‘https://cran.rstudio.com/src/contrib/rstan_2.21.2.tar.gz
Content type ‘application/x-gzip’ length 1152008 bytes (1.1 MB)

downloaded 1.1 MB

trying URL ‘https://cran.rstudio.com/src/contrib/shinystan_2.5.0.tar.gz
Content type ‘application/x-gzip’ length 2400413 bytes (2.3 MB)

downloaded 2.3 MB

trying URL ‘https://cran.rstudio.com/src/contrib/projpred_2.0.2.tar.gz
Content type ‘application/x-gzip’ length 175415 bytes (171 KB)

downloaded 171 KB

trying URL ‘https://cran.rstudio.com/src/contrib/brms_2.16.1.tar.gz
Content type ‘application/x-gzip’ length 4954887 bytes (4.7 MB)

downloaded 4.7 MB

  • installing source package ‘V8’ …
    ** package ‘V8’ successfully unpacked and MD5 sums checked
    ** using staged installation
    Found C++14 compiler: clang++
    Using CXXCPP=clang++ -std=gnu++14 -E
    Using PKG_CFLAGS=-I/private/var/folders/50/y1bky8w15_dbw9knsbgx5h9rm3r5fb/T/RtmpHnKZHA/R.INSTALL1806961aac74/V8/.deps/include
    Using PKG_LIBS=-L/private/var/folders/50/y1bky8w15_dbw9knsbgx5h9rm3r5fb/T/RtmpHnKZHA/R.INSTALL1806961aac74/V8/.deps/lib -lv8
    Running feature test for pointer compression…
    In file included from tools/test.cpp:1:
    In file included from /usr/local/include/libplatform/libplatform.h:11:
    In file included from /usr/local/include/libplatform/v8-tracing.h:11:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_set:366:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__hash_table:18:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named ‘signbit’ in the global namespace
    using ::signbit;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:322:9: error: no member named ‘fpclassify’ in the global namespace
    using ::fpclassify;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?
    using ::isfinite;
    ~~^
    /usr/local/include/math.h:752:12: note: ‘finite’ declared here
    extern int finite(double)
    ^
    In file included from tools/test.cpp:1:
    In file included from /usr/local/include/libplatform/libplatform.h:11:
    In file included from /usr/local/include/libplatform/v8-tracing.h:11:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_set:366:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__hash_table:18:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:9: error: no member named ‘isinf’ in the global namespace
    using ::isinf;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:325:9: error: no member named ‘isnan’ in the global namespace
    using ::isnan;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:326:9: error: no member named ‘isnormal’ in the global namespace
    using ::isnormal;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:327:7: error: no member named ‘isgreater’ in the global namespace; did you mean ‘::std::greater’?
    using ::isgreater;
    ^~
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:738:29: note: ‘::std::greater’ declared here
    struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
    ^
    In file included from tools/test.cpp:1:
    In file included from /usr/local/include/libplatform/libplatform.h:11:
    In file included from /usr/local/include/libplatform/v8-tracing.h:11:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_set:366:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__hash_table:18:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:328:7: error: no member named ‘isgreaterequal’ in the global namespace; did you mean ‘::std::greater_equal’?
    using ::isgreaterequal;
    ^~
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:767:29: note: ‘::std::greater_equal’ declared here
    struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
    ^
    In file included from tools/test.cpp:1:
    In file included from /usr/local/include/libplatform/libplatform.h:11:
    In file included from /usr/local/include/libplatform/v8-tracing.h:11:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/unordered_set:366:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__hash_table:18:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:329:9: error: no member named ‘isless’ in the global namespace
    using ::isless;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:330:9: error: no member named ‘islessequal’ in the global namespace
    using ::islessequal;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:331:9: error: no member named ‘islessgreater’ in the global namespace
    using ::islessgreater;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:332:9: error: no member named ‘isunordered’ in the global namespace
    using ::isunordered;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:333:9: error: no member named ‘isunordered’ in the global namespace
    using ::isunordered;
    ~~^
    13 errors generated.
    Enabling pointer compression
    ** libs
    rm -f V8.so RcppExports.o bindings.o
    clang++ -std=gnu++14 -I"/usr/local/Cellar/r/4.1.1_1/lib/R/include" -DNDEBUG -I/private/var/folders/50/y1bky8w15_dbw9knsbgx5h9rm3r5fb/T/RtmpHnKZHA/R.INSTALL1806961aac74/V8/.deps/include -DV8_COMPRESS_POINTERS -I’/usr/local/lib/R/4.1/site-library/Rcpp/include’ -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include -fPIC -g -O2 -O3 -mtune=native -arch x86_64 -ftemplate-depth-256 -c RcppExports.cpp -o RcppExports.o
    In file included from RcppExports.cpp:4:
    In file included from ./V8_types.h:1:
    In file included from /private/var/folders/50/y1bky8w15_dbw9knsbgx5h9rm3r5fb/T/RtmpHnKZHA/R.INSTALL1806961aac74/V8/.deps/include/v8.h:20:
    In file included from /usr/local/include/stdio.h:64:
    /usr/local/include/_stdio.h:93:16: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    unsigned char *_base;
    ^
    /usr/local/include/_stdio.h:93:16: note: insert ‘_Nullable’ if the pointer may be null
    unsigned char *_base;
    ^
    _Nullable
    /usr/local/include/_stdio.h:93:16: note: insert ‘_Nonnull’ if the pointer should never be null
    unsigned char _base;
    ^
    _Nonnull
    /usr/local/include/_stdio.h:138:32: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    int (
    _Nullable _read) (void *, char , int);
    ^
    /usr/local/include/_stdio.h:138:32: note: insert ‘_Nullable’ if the pointer may be null
    int (
    _Nullable _read) (void *, char , int);
    ^
    _Nullable
    /usr/local/include/_stdio.h:138:32: note: insert ‘_Nonnull’ if the pointer should never be null
    int (
    _Nullable _read) (void *, char , int);
    ^
    _Nonnull
    /usr/local/include/_stdio.h:138:40: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    int (
    _Nullable _read) (void *, char , int);
    ^
    /usr/local/include/_stdio.h:138:40: note: insert ‘_Nullable’ if the pointer may be null
    int (
    _Nullable _read) (void *, char , int);
    ^
    _Nullable
    /usr/local/include/_stdio.h:138:40: note: insert ‘_Nonnull’ if the pointer should never be null
    int (
    _Nullable _read) (void *, char , int);
    ^
    _Nonnull
    /usr/local/include/_stdio.h:139:35: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    fpos_t (
    _Nullable _seek) (void , fpos_t, int);
    ^
    /usr/local/include/_stdio.h:139:35: note: insert ‘_Nullable’ if the pointer may be null
    fpos_t (
    _Nullable _seek) (void , fpos_t, int);
    ^
    _Nullable
    /usr/local/include/_stdio.h:139:35: note: insert ‘_Nonnull’ if the pointer should never be null
    fpos_t (
    _Nullable _seek) (void , fpos_t, int);
    ^
    _Nonnull
    /usr/local/include/_stdio.h:140:32: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    int (
    _Nullable _write)(void *, const char , int);
    ^
    /usr/local/include/_stdio.h:140:32: note: insert ‘_Nullable’ if the pointer may be null
    int (
    _Nullable _write)(void *, const char , int);
    ^
    _Nullable
    /usr/local/include/_stdio.h:140:32: note: insert ‘_Nonnull’ if the pointer should never be null
    int (
    _Nullable _write)(void *, const char , int);
    ^
    _Nonnull
    /usr/local/include/_stdio.h:140:46: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    int (
    _Nullable _write)(void *, const char , int);
    ^
    /usr/local/include/_stdio.h:140:46: note: insert ‘_Nullable’ if the pointer may be null
    int (
    _Nullable _write)(void *, const char , int);
    ^
    _Nullable
    /usr/local/include/_stdio.h:140:46: note: insert ‘_Nonnull’ if the pointer should never be null
    int (
    _Nullable _write)(void *, const char *, int);
    ^
    _Nonnull
    /usr/local/include/_stdio.h:144:18: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    struct __sFILEX _extra; / additions to FILE to not break ABI */
    ^
    /usr/local/include/_stdio.h:144:18: note: insert ‘_Nullable’ if the pointer may be null
    struct __sFILEX _extra; / additions to FILE to not break ABI */
    ^
    _Nullable
    /usr/local/include/_stdio.h:144:18: note: insert ‘_Nonnull’ if the pointer should never be null
    struct __sFILEX _extra; / additions to FILE to not break ABI */
    ^
    Nonnull
    In file included from RcppExports.cpp:4:
    In file included from ./V8_types.h:1:
    In file included from /private/var/folders/50/y1bky8w15_dbw9knsbgx5h9rm3r5fb/T/RtmpHnKZHA/R.INSTALL1806961aac74/V8/.deps/include/v8.h:20:
    /usr/local/include/stdio.h:220:5: warning: ‘TARGET_OS_IPHONE’ is not defined, evaluates to 0 [-Wundef-prefix=TARGET_OS
    ]
    #if TARGET_OS_IPHONE
    ^
    /usr/local/include/stdio.h:67:13: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    extern FILE *__stdinp;
    ^
    /usr/local/include/stdio.h:67:13: note: insert ‘_Nullable’ if the pointer may be null
    extern FILE *__stdinp;
    ^
    _Nullable
    /usr/local/include/stdio.h:67:13: note: insert ‘_Nonnull’ if the pointer should never be null
    extern FILE __stdinp;
    ^
    _Nonnull
    /usr/local/include/stdio.h:386:41: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    int (
    _Nullable)(void *, const char , int),
    ^
    /usr/local/include/stdio.h:386:41: note: insert ‘_Nullable’ if the pointer may be null
    int (
    _Nullable)(void *, const char , int),
    ^
    _Nullable
    /usr/local/include/stdio.h:386:41: note: insert ‘_Nonnull’ if the pointer should never be null
    int (
    _Nullable)(void *, const char , int),
    ^
    _Nonnull
    /usr/local/include/stdio.h:386:55: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    int (
    _Nullable)(void *, const char , int),
    ^
    /usr/local/include/stdio.h:386:55: note: insert ‘_Nullable’ if the pointer may be null
    int (
    _Nullable)(void *, const char , int),
    ^
    _Nullable
    /usr/local/include/stdio.h:386:55: note: insert ‘_Nonnull’ if the pointer should never be null
    int (
    _Nullable)(void *, const char , int),
    ^
    _Nonnull
    /usr/local/include/stdio.h:387:44: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    fpos_t (
    _Nullable)(void , fpos_t, int),
    ^
    /usr/local/include/stdio.h:387:44: note: insert ‘_Nullable’ if the pointer may be null
    fpos_t (
    _Nullable)(void , fpos_t, int),
    ^
    _Nullable
    /usr/local/include/stdio.h:387:44: note: insert ‘_Nonnull’ if the pointer should never be null
    fpos_t (
    _Nullable)(void , fpos_t, int),
    ^
    _Nonnull
    /usr/local/include/stdio.h:388:41: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    int (
    _Nullable)(void ));
    ^
    /usr/local/include/stdio.h:388:41: note: insert ‘_Nullable’ if the pointer may be null
    int (
    _Nullable)(void ));
    ^
    _Nullable
    /usr/local/include/stdio.h:388:41: note: insert ‘_Nonnull’ if the pointer should never be null
    int (
    _Nullable)(void *));
    ^
    _Nonnull
    /usr/local/include/stdio.h:384:6: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    FILE *funopen(const void *,
    ^
    /usr/local/include/stdio.h:384:6: note: insert ‘_Nullable’ if the pointer may be null
    FILE *funopen(const void *,
    ^
    _Nullable
    /usr/local/include/stdio.h:384:6: note: insert ‘_Nonnull’ if the pointer should never be null
    FILE *funopen(const void *,
    ^
    _Nonnull
    In file included from RcppExports.cpp:4:
    In file included from ./V8_types.h:2:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp.h:27:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/RcppCommon.h:30:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/r/headers.h:66:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/platform/compiler.h:100:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named ‘signbit’ in the global namespace
    using ::signbit;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:322:9: error: no member named ‘fpclassify’ in the global namespace
    using ::fpclassify;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?
    using ::isfinite;
    ~~^
    /usr/local/include/math.h:752:12: note: ‘finite’ declared here
    extern int finite(double)
    ^
    In file included from RcppExports.cpp:4:
    In file included from ./V8_types.h:2:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp.h:27:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/RcppCommon.h:30:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/r/headers.h:66:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/platform/compiler.h:100:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:9: error: no member named ‘isinf’ in the global namespace
    using ::isinf;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:325:9: error: no member named ‘isnan’ in the global namespace
    using ::isnan;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:326:9: error: no member named ‘isnormal’ in the global namespace
    using ::isnormal;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:327:7: error: no member named ‘isgreater’ in the global namespace; did you mean ‘::std::greater’?
    using ::isgreater;
    ^~
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:738:29: note: ‘::std::greater’ declared here
    struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
    ^
    In file included from RcppExports.cpp:4:
    In file included from ./V8_types.h:2:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp.h:27:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/RcppCommon.h:30:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/r/headers.h:66:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/platform/compiler.h:100:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:328:7: error: no member named ‘isgreaterequal’ in the global namespace; did you mean ‘::std::greater_equal’?
    using ::isgreaterequal;
    ^~
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:767:29: note: ‘::std::greater_equal’ declared here
    struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
    ^
    In file included from RcppExports.cpp:4:
    In file included from ./V8_types.h:2:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp.h:27:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/RcppCommon.h:30:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/r/headers.h:66:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/platform/compiler.h:100:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:329:9: error: no member named ‘isless’ in the global namespace
    using ::isless;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:330:9: error: no member named ‘islessequal’ in the global namespace
    using ::islessequal;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:331:9: error: no member named ‘islessgreater’ in the global namespace
    using ::islessgreater;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:332:9: error: no member named ‘isunordered’ in the global namespace
    using ::isunordered;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:333:9: error: no member named ‘isunordered’ in the global namespace
    using ::isunordered;
    ~~^
    14 warnings and 13 errors generated.
    make: *** [RcppExports.o] Error 1
    ERROR: compilation failed for package ‘V8’
  • removing ‘/usr/local/lib/R/4.1/site-library/V8’
    Warning in install.packages :
    installation of package ‘V8’ had non-zero exit status
  • installing source package ‘projpred’ …
    ** package ‘projpred’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    clang++ -std=gnu++14 -I"/usr/local/Cellar/r/4.1.1_1/lib/R/include" -DNDEBUG -I’/usr/local/lib/R/4.1/site-library/Rcpp/include’ -I’/usr/local/lib/R/4.1/site-library/RcppArmadillo/include’ -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/xz/include -I/usr/local/include -fPIC -g -O2 -c RcppExports.cpp -o RcppExports.o
    In file included from RcppExports.cpp:4:
    In file included from /usr/local/lib/R/4.1/site-library/RcppArmadillo/include/RcppArmadillo.h:29:
    In file included from /usr/local/lib/R/4.1/site-library/RcppArmadillo/include/RcppArmadilloForward.h:25:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/RcppCommon.h:30:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/r/headers.h:66:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/platform/compiler.h:100:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named ‘signbit’ in the global namespace
    using ::signbit;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:322:9: error: no member named ‘fpclassify’ in the global namespace
    using ::fpclassify;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:9: error: no member named ‘isfinite’ in the global namespace; did you mean ‘finite’?
    using ::isfinite;
    ~~^
    /usr/local/include/math.h:752:12: note: ‘finite’ declared here
    extern int finite(double)
    ^
    In file included from RcppExports.cpp:4:
    In file included from /usr/local/lib/R/4.1/site-library/RcppArmadillo/include/RcppArmadillo.h:29:
    In file included from /usr/local/lib/R/4.1/site-library/RcppArmadillo/include/RcppArmadilloForward.h:25:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/RcppCommon.h:30:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/r/headers.h:66:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/platform/compiler.h:100:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:9: error: no member named ‘isinf’ in the global namespace
    using ::isinf;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:325:9: error: no member named ‘isnan’ in the global namespace
    using ::isnan;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:326:9: error: no member named ‘isnormal’ in the global namespace
    using ::isnormal;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:327:9: error: no member named ‘isgreater’ in the global namespace
    using ::isgreater;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:328:9: error: no member named ‘isgreaterequal’ in the global namespace
    using ::isgreaterequal;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:329:9: error: no member named ‘isless’ in the global namespace
    using ::isless;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:330:9: error: no member named ‘islessequal’ in the global namespace
    using ::islessequal;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:331:9: error: no member named ‘islessgreater’ in the global namespace
    using ::islessgreater;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:332:9: error: no member named ‘isunordered’ in the global namespace
    using ::isunordered;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:333:9: error: no member named ‘isunordered’ in the global namespace
    using ::isunordered;
    ~~^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:339:9: error: no member named ‘abs’ in the global namespace; did you mean ‘fabs’?
    using ::abs;
    ~~^
    /usr/local/include/math.h:417:15: note: ‘fabs’ declared here
    extern double fabs(double);
    ^
    In file included from RcppExports.cpp:4:
    In file included from /usr/local/lib/R/4.1/site-library/RcppArmadillo/include/RcppArmadillo.h:29:
    In file included from /usr/local/lib/R/4.1/site-library/RcppArmadillo/include/RcppArmadilloForward.h:25:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/RcppCommon.h:30:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/r/headers.h:66:
    In file included from /usr/local/lib/R/4.1/site-library/Rcpp/include/Rcpp/platform/compiler.h:100:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:644:26: error: no template named ‘numeric_limits’
    bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
    ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:644:60: error: no template named ‘numeric_limits’
    bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limits<_IntT>::digits),
    ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:645:18: error: no template named ‘numeric_limits’
    int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
    ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:645:50: error: no template named ‘numeric_limits’
    int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)>
    ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:650:17: error: no template named ‘numeric_limits’
    static_assert(numeric_limits<_FloatT>::radix == 2, “FloatT has incorrect radix”);
    ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    make: *** [RcppExports.o] Error 1
    ERROR: compilation failed for package ‘projpred’
  • removing ‘/usr/local/lib/R/4.1/site-library/projpred’
    Warning in install.packages :
    installation of package ‘projpred’ had non-zero exit status
    ERROR: dependency ‘V8’ is not available for package ‘rstan’
  • removing ‘/usr/local/lib/R/4.1/site-library/rstan’
    Warning in install.packages :
    installation of package ‘rstan’ had non-zero exit status
    ERROR: dependency ‘rstan’ is not available for package ‘shinystan’
  • removing ‘/usr/local/lib/R/4.1/site-library/shinystan’
    Warning in install.packages :
    installation of package ‘shinystan’ had non-zero exit status
    ERROR: dependencies ‘rstan’, ‘shinystan’, ‘projpred’ are not available for package ‘brms’
  • removing ‘/usr/local/lib/R/4.1/site-library/brms’
    Warning in install.packages :
    installation of package ‘brms’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/50/y1bky8w15_dbw9knsbgx5h9rm3r5fb/T/RtmpBNvOUm/downloaded_packages’

Wecome! A common trick to help diagnose issues is to read through the output logs and find the very first error message that is mentioned, then search the internet for that error message and see what results you get:

From this error message it looks like the C++ compiler is unable to build cmath, which suggests something is quite broken or misconfigured with your machine’s C++ build environment.

Searching for that error message finds this similar sounding issue a few people have hit trying to install rstan in macOS Big Sur: Install Error - macOS Big Sur · Issue #904 · stan-dev/rstan · GitHub . One of the comments on that issue suggests a fix involving uninstalling XCode and the XCode command line tools and reinstalling XCode: Install Error - macOS Big Sur · Issue #904 · stan-dev/rstan · GitHub

1 Like

Thank you. I had seen that previous post early on in my troubleshooting and had reinstalled XCode to no avail. But I may have failed to re-specify the path to XCode through the command line after installing it that time, or it could be that some other troubleshooting steps worked through got the machine closer to where it needed to be. In any case, I have deleted and re-installed XCode again and this time it seemed to work! Thanks again and I’ll remember the first error message advice; I was getting so many different error messages that it was a little overwhelming to know which to focus on.

1 Like