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

Issue with using rstan::sampling() on the fly ob CRAN's Fedora machine #1153

Open
gowerc opened this issue Feb 3, 2025 · 1 comment
Open

Comments

@gowerc
Copy link

gowerc commented Feb 3, 2025

Hi,

Apologies in advance we still aren't 100% sure what the root cause of this issue is but our best guess at the moment is that it's coming from rstan so was hoping someone here might be able to help us.

In short our package rbmi bundles a small stan model. The Stan part of our package is supplementary and not really used by most users so to save the installation burden (particularly for windows) we have put rstan in our suggests. To use the model we thus compile and sample from it on the fly caching the model in the users current R temp directory.

Apparently CRAN recently updated their Fedora OS and after doing so our unit tests now fail with the following error when trying to sample from the model:

Error in fit_mcmc(designmat = model_df_scaled[, -1, drop = FALSE], outcome = model_df_scaled[, 1, drop = TRUE], group = data2[[vars$group]], visit = data2[[vars$visit]], subjid = data2[[vars$subjid]], method = method, quiet = quiet): unable to load shared object '/tmp/RtmpFEJSwF/working_dir/Rtmpj7B0hT/file20056d5b79796d.so':
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /tmp/RtmpFEJSwF/working_dir/Rtmpj7B0hT/file20056d5b79796d.so)

https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/rbmi-00check.html

(For reference fit_mcmc() is just a wrapper around rstan::sampling().)

We can see from your documentation something that aludes to this error and says the solution is to manually specify the library paths for the loader however I'm not sure if that is viable here as the error is occurring on a CRAN machine and we don't have control over their compiler flags.

Additionally for reference the following is the full message that we got from CRAN when they reported this issue to us:

It is clear that you are trying to load a DSO compiled with g++ into an R build which uses clang/clang++/libc++.
What is not clear to me how you manage that -- one way might be to use 'R' rather than "${R_HOME}"/bin/R as discussed in https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Writing-portable-packages. But I am guessing as you have suppressed the log of building that DSO.
After an OS upgrade, the g++ libraries are no longer on the library search path for the fedora-clang builds (they used to be needed for V8).
Apparently the same error is seen in tern.rbmi.

We have an issue tracking this on our repo here.

Any help / thoughts / guidance that you may be able to provide to help us track down and fix this would be greatly appreciated.

@bob-carpenter
Copy link

Thanks for reporting. Another place to check is on the Stan forums.

@SteveBronder can probably sort this one out.

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

2 participants