RStan error (Mac running Catalina): Error: vector memory exhausted (limit reached?)

I’m on a Mac that I just upgraded (or at least re-graded) to Catalina. I’m actually not 100% sure I had run Stan or RStan on this machine before the upgrade. I had some problems that seem like the same things others have had, which I dealt with by following the instructions on this forum in the thread ‘Dealing with Catalina II’.

I then fit some R models, seemingly without more problems although they ran slower than I expected. But then I made a few minor changes in the model, ran it, and got an error “Error: vector memory exhausted (limit reached?)”. I thought maybe my changes had broken it somehow, but I went back to an earlier, simpler version of the model that had run quickly previously, and it gave me the same error.

I’m pretty much blocked until I can fix this. Any help would be greatly appreciated.

Here’s my MakeVars:

CFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
CPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include
SHLIB_CXXLDFLAGS+=-Wl,-rpath,/Library/Frameworks/R.framework/Resources/lib /Library/Frameworks/R.framework/Resources/lib/libc++abi.1.dylib
SHLIB_CXX11LDFLAGS+=-Wl,-rpath,/Library/Frameworks/R.framework/Resources/lib /Library/Frameworks/R.framework/Resources/lib/libc++abi.1.dylib
SHLIB_CXX14LDFLAGS+=-Wl,-rpath,/Library/Frameworks/R.framework/Resources/lib /Library/Frameworks/R.framework/Resources/lib/libc++abi.1.dylib
CXX14 = /usr/local/clang7/bin/clang++ -stdlib=libc++ -nostdinc++ -I/usr/local/clang7/include/c++/v1
SHLIB_CXX14LD = /usr/local/clang7/bin/clang++ -L/usr/local/clang7/lib/

R version?

$platform
[1] “x86_64-apple-darwin15.6.0”

$arch
[1] “x86_64”

$os
[1] “darwin15.6.0”

$system
[1] “x86_64, darwin15.6.0”

$status
[1] “”

$major
[1] “3”

$minor
[1] “6.1”

$year
[1] “2019”

$month
[1] “07”

$day
[1] “05”

$svn rev
[1] “76782”

$language
[1] “R”

$version.string
[1] “R version 3.6.1 (2019-07-05)”

$nickname
[1] “Action of the Toes”

Running in RStudio
Version 1.2.1335

OK. Try installing Rcpp, RcppEigen, and rstan from source with those same settings via

install.packages(c("Rcpp", "RcppEigen", "rstan"), type = "source")

@mitzimorris solved the upgrade for me.