Dealing with Catalina II

Here is my steps to solve the problem:

  1. Update Xcode to the newest version.
  2. In terminal: xcode-select —install (install the Xcode CLI)
  3. Install the r-macos-rtools by @coatless
  4. In Finder: Go → Go to Folders… → ~/.R/Makevars and modify the Makevars file as @wds15’s suggestion :

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

  1. (Maybe optional)In R: upgrade to R 3.6.1, remove rstan and StanHeaders (maybe optional) and reinstall rstan:

remove.packages(“rstan”)
remove.packages(“StanHeaders”)
file.remove(“.RData”)

restart R

install.packages(“rstan”, dependencies = TRUE)

1 Like