Rstan Compilation Hangs

Maybe R-SIG-MAC, but I wouldn’t be surprised if they tell you that only XCode is supported.

I really appreciate the help.
At this point I am at the – l just need a drink – phase of this endeavor. Posted here:

Will try again tomorrow.

Finally got it working. To anyone else with this problem – you are not going to like my solution. Delete all of /usr/local/. Reinstall all developer software again from scratch. The slash and burn solution…

Still really pissed about no openMP support. Going to switch to linux soon. Any advice on good linux distro for R development? Anything particularly stable?

Almost all of the Linux distributions have a “stable” release, but the version of R in the repositories is usually behind the version of R on CRAN. That is not so much of a problem because R and R package development is usually done with the subversion version of R.

Hi, I have problem to run Stan on mac by RStan.
I install rstan by structure for mac Catalina but I still can not run after installing R-4.0.2 on macOS Catalina.
R go to hang after us a test function as
fit <- stan(file = ‘schools.stan’, data = schools_dat)
please help me.

when I run “Rcpp::sourceCpp(’/Users/arman-artin/helloworld.cpp’)” , I see the following result:

        SEXP data = Parent::get__();

1 warning generated.

Hello World!

I have long runtime and see my pages on mac as:


example(stan_model, package = "rstan", run.dontrun = TRUE)

and tell us what are the lines right before it hangs.

I run the command: ```
example(stan_model, package = “rstan”, run.dontrun = TRUE)
but I have problem, R go to hangs long time! without any result and the result is as follows:

when I install RStan package I see many warning, but it is done. Is it the problem?

please help me about this.

You can install inline from CRAN now, but I still don’t know why there seems to be hanging. There is another thread about it at

Thanks, can you guide me about the Makevar file? I must define it before installing RStan package?

With R 4.x, you shouldn’t need a Makevars file but then again, it should not be hanging.

I am having the same problem. Compile commands always leave me hanging. I tried removing R completely and re-installing from brew. I installed rstan in many from source and from binary file. Nothing seems to work.

Has there been any progress on this since @sjilve24 recommended delete all of /usr/local/ and reinstall all developer software again from scratch?

Thank you

Deleting all of /usr/local seems extreme, but it is necessary with R 4.x to make sure the compiler is not using anything from /usr/local/clang* .

Thanks. I have two questions: 1) what else can I expect to be affected by the deletion of the /usr/local/ content? Does it usually have content that goes beyond our use of R and development tools? 2) By ‘reinstall all developer software’ is it meant to remove and re-install the MacOS Xcode?

But, here is no clang* inside my /usr/local directory.
I only see a clang directory inside
Users/Shared/Previouly Relocated Items/Security/Developer/usr/lib/

Hi, When you write ‘reinstall all developer software again from scratch’ do you mean all of Xcode as well?

Well, it did not work. I can’t believe it. I deleted all the content of /user/local, uninstalled xcode and R (using the AppClener for R). Then I restarted the machine, re-installed xcode, R (from the CRAN site) and followed all the instructions in to the letter.

And yet, again, I was left hanging on compilation.

This is rather unsettling. I am thinking about formatting my HD and really starting from scratch.

Does anyone know where one can appeal for help with this problem?