Dealing with Catalina IV

Not sure exactly what happened but I just updated to R4.0.2 and everything installed smoothly after that. Thanks for the quick response!

1 Like

Hello,

I’m running Catalina 10.15.6 and R 3.6.1 and have manually installed the toolchain (Xcode CLI, clang7, gfortran6.1) following @coatless instructions. I have also installed rstan , stanheaders and rstanarm from source following @bgoodri advice in previous posts . The install appears fine, the ā€œhelloworld.cppā€ test runs fine, RStan examples run fine (from e.g. here), everything seems fine - works perfect.

But I’m getting the following random error when trying to run a brm model - has anybody seen it or similar?

>  m<-brm(log_fecundity~log_WL+(1+log_WL|Ref_unique_species), data=dat, chains=3, iter=10000, warmup=5000,
+          prior=prior, control=list(adapt_delta=0.99, max_treedepth=17), thin=5,
+          file='aeAlbFec_ref')
Compiling Stan program...
/var/folders/kh/lyr1fly54gb6m19c19pbm4jh_2gv05/T//RtmpnzLw2K/file9c252f58ef5.stan:42:45: warning: missing terminating ' character [-Winvalid-pp-token]
  r_1 = (diag_pre_multiply(sd_1, L_1) * z_1)';
                                            ^
1 warning generated.

It’s random, as if I shutdown/restart either RStudio or the whole laptop, and try running it again, it will sometimes compile and run (fast - <1 second), without warning.
Sometimes the warning will appear but it will still run through all chains, although take a long, long time to complete (> 10 mins). Other times the warning will appear, the chains will not run and the fan in the laptop starts getting loud, and it appears as though the system has hung.

I’ve tried uninstall/reinstall everything - but each time it appears to install fine, and my models will run without error, but then I’ll start another model, or re-run the same one, and the error starts to appear.

Any ideas? I tried searching for /var/folders… info and ā€œmissing terminating ’ characterā€ info but couldn’t find anything. Not too sure what this all means either…

Cheers
Jon

You can ignore that.

Hi,
I have been trying to download Rcpp and Rstan and encountered some of the same errors as davidh.

When downloading Rcpp from drat, I get the following warning in the first few lines:

Warning in install.packages :
  unable to access index for repository https://rcppcore.github.io/drat/bin/macosx/contrib/4.0:
  cannot open URL 'https://rcppcore.github.io/drat/bin/macosx/contrib/4.0/PACKAGES'

Other warning will also pop up throughout the download including a warning about the clang (attached). I’m a little confused about this one as well. I’m on Catalina (10.15), but it says I don’t meet the 10.13+.

1 warning generated. 
clan++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/  -I/usr/local/include-fPIC -Wall -g -02 attributes.cpp -o attributes.o
In file included from attributes.cpp:39: 

When I download Rstan, several sets of warnings are generated as well. One of which looks like the section below:

30 warnings generated.
ar -rs ../inst/lib//libStanServices.a stan_fit.o stan_fit_base.o
ar: creating archive ../inst/lib//libStanServices.a
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-rstan/00new/rstan/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rstan

Has anyone come across some different solutions that can help with these issues?

For context, I’m running on Catalina 10.15.6 and R 4.0.2. So, I’m not able to use the same solution as davidh.

With R 4.x, you should be able to install all the binaries from CRAN with no ~/.R/Makevars . On Macs, you might need to eliminate the PATH line from the ~/.Renviron file if you have that from an older version of the C++ toolchain.

Thank you so much for the response! At the time of the first post, I had the latest macOS R toolchain installed, and the ~/.Renviron file was not linked to older versions of clang.

Should I be looking in locations other than the ~/.Renviron file for an out of place PATH line?

Not that I know of. What is

Sys.getenv("PATH")

?

I get this output with Sys.getenv(ā€œPATHā€)

"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/RStudio.app/Contents/MacOS/postback"

Then it should be fine.

Would you have any suggestions about remedying some of the warnings that were listed in the previous post? They seem to be causing some massive issues. When Rstan is successfully installed, similar warnings about clang are still issued, and the output for seeded analysis seems to be very off. Others running the same analyses are getting different output.

Thank you so much for the help and the replies by the way!

The drat thing I can’t help with, except to say install the binary Rcpp from CRAN. The compiler warnings when you install rstan from source are to be expected.