Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rstan missing BH from imports / suggests #1140

Open
gowerc opened this issue Oct 16, 2024 · 4 comments
Open

rstan missing BH from imports / suggests #1140

gowerc opened this issue Oct 16, 2024 · 4 comments

Comments

@gowerc
Copy link

gowerc commented Oct 16, 2024

Summary:

It appears that rstan requires the BH to be available at run time when it compiles the Stan models otherwise an error is thrown e.g.

> stan_model <- stan_model(model_code = model)
Error in stan_model(model_code = model) : 
  Boost not found; call install.packages('BH')

However Stan doesn't list BH in it's imports or suggests but instead only in it's LinkingTo field.

From CRAN Writing R Extensions:

Note that ‘LinkingTo’ applies only to installation

This doesn't usually cause an issue as install.packages() includes LinkingTo packages by default however the pak installer takes a more strict view and won't install LinkingTo packages if it is installing binary packages (The logic being they are already compiled so the LinkingTo headers are redundant).

This is currently an issue when trying to use the Rhub pipelines for testing packages as they are dependent on pak for installing dependencies

https://github.com/insightsengineering/rbmi/actions/runs/11362703172/job/31605118630#step:5:1762

I originally raised this with the Rhub developers who suggested that I raise an issue here in order to get the Stan DESCRIPTION file updated to resolve this

r-hub/rhub#642

Reproducible Steps:

  • Install Rstan
  • Remove BH if it was automatically installed
  • Run any Stan model and it will throw an error that BH is missing

Current Output:

NA

Expected Output:

NA

RStan Version:

2.35.0.9000

R Version:

R version 4.4.1 (2024-06-14)

Operating System:

MacOS 14.6.1

@gowerc gowerc changed the title rstan missing BH from imports rstan missing BH from imports / suggests Oct 16, 2024
@bob-carpenter
Copy link

Thanks for reporting. Hopefully this will be an easy fix.

@jgabry
Copy link
Member

jgabry commented Oct 16, 2024

Thanks. I think a long time ago there may have been some issue with including BH in Imports and for that reason custom code was added to check for BH and tell the user to install it if not found. I don't remember exactly why that was necessary and I could be wrong. I think @bgoodri would know. @bgoodri do you remember that? Or should we just go ahead and add BH to Imports?

@falkcarl
Copy link

I believe I am also encountering this issue when checking R packages via rhub. Would there happen to be any updates or workarounds? Thank you all!

@bob-carpenter
Copy link

@bgoodri? Should we just add BH to imports? It seems like we should if that's the strictly correct thing to do accoding to R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants