Beware of StanHeaders (2.26.28) from CRAN if you run rstan 2.26.22 from the Stan repository

I am running R 4.3.1 on an Ubuntu/Linux system with rstan 2.26.22 installed from the Stan repositories but StanHeaders 2.26.27 from CRAN.
Today I was offered to upgrade the StanHeader package to 2.26.28 and I agreed. After the upgrade, library(rstan) did not work anymore. Rather, I received the error message:

> library(rstan)
Loading required package: StanHeaders
Error: package or namespace load failed for ‘rstan’:
 .onLoad failed in loadNamespace() for 'rstan', details:
  call: NULL
  error: SyntaxError: Illegal break statement

I thought it might be fixed by re-installing rstan from the Stan repository but that installation also failed with final message:

Error: package or namespace load failed for ‘rstan’:
 .onLoad failed in loadNamespace() for 'rstan', details:
  call: NULL
  error: SyntaxError: Illegal break statement
Error: loading failed
Execution halted

In the end I downgraded StanHeaders back to 2.26.27 and had a working system again.

I thought I post this hear to warn others that an upgrade of StanHeaders might invite trouble. Presumably the 2.26.28 version works with the rstan version on CRAN, otherwise CRAN would (should?) have not accepted the new version of StanHeaders, but perhaps they have just not realised the problem yet. :-)

I wonder whether this is a clever ploy to finally get rstan 2.26.x onto CRAN. Any news on when that is supposed to happen?

Cheers,
Berwin

Looks like rstan 2.26 is finally send to CRAN … at least you can see in the CRAN incoming web-site that rstan has been uploaded to the CRAN team is currently awaiting its next processing state. Let’s hope that the submission works our smoothly.

3 Likes

Yep, it is on CRAN.
Now I am just wondering why version 2.26.23 is on CRAN, but this morning when I re-installed rstan from the Stan repositories version 2.26.22 was installed. :-)

And just for the record StanHeaders 2.26.28 and rstan 2.26.23 from CRAN install without problems on my machine and play together nicely.
Looks as if I just had a timing problem this morning that one package had been updated on CRAN but not the other.

1 Like

Glad it’s working now. Yeah, you may have happened to try installing right between the StanHeaders and RStan submissions/acceptances by CRAN.

1 Like