RStan installation problems

Hello, I’ve been trying unsuccessfully to install RStan.

Operating System: macOS 10.13.4
R version: 4.0.2

  1. I followed the instructions here Configuring C Toolchain for Mac · stan-dev/rstan Wiki · GitHub to download and run the macOS R toolchain installer.

  2. I have then installed rstan using the instructions given here: RStan Getting Started · stan-dev/rstan Wiki · GitHub
    When verifying the installation using the code:
    example(stan_model, package = "rstan", run.dontrun = TRUE)

I get the following error

Compilation ERROR, function(s)/method(s) not created!
Error in compileCode(f, code, language = language, verbose = verbose) :
/usr/include/pthread.h:349:45: note: previous declaration is hereint pthread_getschedparam(pthread_t , int * _Nullable __restrict, ^fatal error: too many errors emitted, stopping now [-ferror-limit=]20 errors generated.make: *** [file224c1a65e530.o] Error 1
In addition: Warning messages:
1: In system2(CXX, args = ARGS) : error in running command
2: In file.remove(c(unprocessed, processed)) :
cannot remove file ‘/var/folders/b7/55yc0_lx7sl505fqg3mb9h4m0000gn/T//RtmpVeTsJE/file224c3c55a392.stan’, reason ‘No such file or directory’

1 Like

Maybe @andrjohns has time to look into this? You can also try using cmdstanr instead, which is sometimes easier to install. Can’t help beyond that, I am not a Mac user