Dealing with Catalina II

I’m way beyond my expertise except for solving this problem three times with the help of everyone who has posted here (when first installing and running glmmTMB, getting a new computer and doing it again for stan models via brms, and again when upgraded to Catalina).

Am I incorrect that R3.5 and 3.6 use different versions of clang? If so using the above installer will not include the clang6 required for 3.5

I have avoided installing most current R because of my terror of messing up the delicately balanced system that currently works (especially after Catalina upgrade created permissions problems that I solved but don’t remember how.)

I am unendingly grateful for the work by coatless and bgoodri and anyone I didn’t mention who has focused on helping solve a problem you didn’t create!

1 Like

That is correct. Due to Catalina, we’re having to rethink a few things.

I’m tracking the feature need here: macOS toolchain per version · Issue #16 · coatless-mac/r-macos-rtools · GitHub

1 Like

Hi guys yes upgrading to R3.6.2 fixed it. Models build happily now. I’m still getting oddles or runtime complier warnings - is there a way to suppress those I cannot recall ?

Thanks for your help. My bad. Recent years of MacOS and iOS updates with …issues… have trained me into not updating anything until absolutely necessary 🙈

First of all, thanks everyone helping with this.

I did read all the info available, and did the following on Catalina 10.15.2:

  • Fresh installation R (v. 3.6.2) and R studio (1.2.5019)
  • Installed latest version of Xcode
  • Installed r-macos-rtools 3.2.1
  • Installed Rstan from source

I am still getting this error when running rstan or brms models:

[1] “Error in sampler$call_sampler(args_list[[i]]) : "
[2] " c++ exception (unknown reason)”
error occurred during calling the sampler; sampling not done

-> My .R Makevars files look like this:

clang: start

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,${R_HOME}/lib ${R_HOME}/lib/libc++abi.1.dylib
SHLIB_CXX14LDFLAGS+=-Wl,-rpath,${R_HOME}/lib ${R_HOME}/lib/libc++abi.1.dylib

clang: end

Any ideas what I could do to fix this?

Try this in 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

Thanks for the suggestion!

I tried… but I’m still getting the same error.

Have you recompiled relevant packages, e.g., rstan?

I did install rstan after modifying the Makevars file. I’m still getting the same error.

I have 2 Makevars files in the .R folder:
Makevars.txt
Makevars.bck

I modified both of them, and tried also single combinations both nothing works.

Neither of those files do anything. The filename needs to be simply called Makevars.

Yes. I’m sorry I did a mistake in writing. txt.
I do have one Makevars file and one Makevars.bck.

I’m getting this error message even when I only modify the Makevars file.

It will probably work if you add

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/

to the end of Makevars, but we don’t know why it itsn’t working for you already.

Thank you very much for the help.

I tried to uninstall and freshly install everything again a few times and tried to change makevars as suggested but I’m still getting the same error…

Just to be clear: You do have Makevars in ~/.R/ where ~ is your home directory, and .R is a directory in your home directory?

Yes I do. The path is /Users/save/.R/Makevars

Sorry @Save, but I’m a bit stumped here. Hopefully @coatless or @bgoodri have more things to try out.

When installing rstan from source I am now getting these errors. Perhaps this could help to identify the problem?

Thanks again.

warning when installing rstan.txt (65.6 KB) other errors.txt (25.1 KB)

It is saying that it cannot install Rcpp and a bunch of other packages, which definitely should not be happening. You should be able to install those as binaries. But then your C++ header files seem to be not found, e.g.,

/usr/local/clang7/include/c++/v1/cmath:313:9: error: no member named ‘signbit’ in the global namespace

I would guess that is because you are using clang++ from Xcode, which would suggest that your PATH is wrong somehow and that you do not have

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/

in your ~/.R/Makevars file.

I’m assuming the problem is more complicated, but because I have made this error my dumb self so I’m putting it out there:

Did you restart your computer and/or Rstudio?

Aaah, the old Windows trick ;) Well, you never know… :)

1 Like

Thanks again for the feedback.

I know tried two freshly install R, Rstudio and r-macos-rtools 3.2.1 with and without having Xcode installed in my Mac.

My Makevars file looked like this (but I also tried without the two last lines):

#clang: start
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,{R_HOME}/lib {R_HOME}/lib/libc++abi.1.dylib
SHLIB_CXX14LDFLAGS+=-Wl,-rpath,{R_HOME}/lib {R_HOME}/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/

#clang: end

-> I am not having rstan installations errors anymore back I’m back to the sampling error… (And of course I’m restarting the mac many times)

I wonder if these problems might be caused by the fact that I installed too many times everything and that some old files are still present and generate conflicts?

Thanks a lot again for this great support guys, I really appreciate and I hope to find a solution soon