Dealing with Catalina

Does this mean we will have another break when R3.7 moves to clang 8?

Wouldn’t surprise me but my guess is that when clang8 is introduced, @coatless will update the Mac installer to use it and it will set SHLIB_CXXFLAGS to link against whatever libc++.1.dylib comes with R, which one would expect CRAN to have compiled with clang8.

I’m actually more worried about Windows for R 3.7.

Thanks so much!

Next version of R will be 4.0.0 to account for the compile toolchain switch, c.f. Daily News: R-devel/NEWS

Correct.

Have you begun testing with RTools 4.0? Jeroen Ooms made it available:

Yes, I have been encouraging people to test rstan on it

for a while, but AFAIK I am the only one who has. It works (except LTO) for me, but it is a huge change.

I just tried this (after uninstalling RStan and using @coatless new installer) and got:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun ERROR: compilation failed for package ā€˜rstan’

So it appears that I am unable to actually compile Stan. Have you seen this error anywhere else since the Catalina roll out?

Try first doing xcode-select --install from the Terminal app or the Terminal tab of RStudio.

So, the installer attempts to install the Xcode CLI tools for you. In the process, we trigger:

sudo xcode-select --reset

And then

sudo xcode-select --install

The reset should fix the xcrun error, From there, the installation should be fine.

What macOS are you on? Mojave or Catalina?

I’m running Catalina (unfortunately). running xcode-select --install seems to have fixed the xcrun error (at least it did for installing cmdstanr which failed with a similar error initially). Unfortunately, I’m still waiting for that to finish compiling and haven’t been able to try install.packages(ā€œrstanā€, type = ā€œsourceā€) yet. As soon as cmdstanr is finished, I’ll give that a shot and post an update.
Thanks

@mattwilliamson13 if CmdStanR still gives you trouble maybe @ssp3nc3r can help. I know he (and others) have been able to get it running on Catalina.

Thanks @Jonah. Do you have any sense for how long CmdStanR should take to compile during the install on a 2015 MacBook Pro with moderate specs? Are we talking minutes? Hours? To clarify, I mean the install_cmdstan() install and compile of Stan

I can’t really tell if I’m making progress

Minute

So 2 hours of compiler messages in Studio during the install_cmdstan() call is a bad sign then?

It is possible the compiler warnings may have overtaxed RStudio’s buffer. In which case, I would start over after squashing them

https://mc-stan.org/misc/warnings.html#compiler-warnings

Just to make sure I understand - I should squash these warnings during the install (not just during compilation of the model?

Both

I’m not getting any messages with square brackets so am not sure what to add to the Makevars file. Example output is clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.69.0 -I stan/lib/stan_math/lib/sundials_4.1.0/include -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/indexes_grammar_inst.o -MT stan/src/stan/lang/grammars/indexes_grammar_inst.d -MM -E -MG -MP -MF stan/src/stan/lang/grammars/indexes_grammar_inst.d stan/src/stan/lang/grammars/indexes_grammar_inst.cpp

This worked to allow me to get RStan installed and 8 schools ran 3x without throwing the exception, so that seems to be working now. I’m not sure what’s happened with CmdStanR, but this seems to have fixed my problem with RStan and the original exception issues.

Yeah should take minutes. This sounds similar to what @ssp3nc3r saw initially but then he had to remove an Renviron file or something. @ssp3nc3r can you remind us?

Actually found it:

@bgoodri do you think this .Renviron problem means that the same setup won’t work for both rstan and cmdstanr if using @coatless’s installer?

1 Like