Failing to load libtbbmalloc.2.dylib
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.1k
- Forks
- 266
- Avg merge
- 2h 56m
- Merged PRs (30d)
- 1
Description
Summary:
In a fresh installation of rstan, linking the libtbbmalloc.2.dylib fails when running the example code.
Description:
A couple of months ago I had a project involving Rstan running smoothly. Returning now, I come across the error stated below. I have uninstalled Rstan, made sure that all dependencies and tool chains are properly installed, and reinstalled Rstan. The problem persists: when using the test code from the Getting Started guide
example(stan_model, package = "rstan", run.dontrun = TRUE)
I receive the error:
Error in dyn.load(libLFile) :
unable to load shared object '/var/folders/86/8s8l46dj1h12jrx1m71jkxtn0s352c/T//Rtmpz0AKh0/file6556344933ec.so':
dlopen(/var/folders/86/8s8l46dj1h12jrx1m71jkxtn0s352c/T//Rtmpz0AKh0/file6556344933ec.so, 6): Library not loaded: @rpath/libtbbmalloc.2.dylib
Referenced from: /usr/local/opt/tbb/lib/libtbbmalloc_proxy.2.dylib
Reason: image not found
Package RcppParallel is installed (see session info below).
Reproducible Steps:
remove.packages('rstan')
# Restart R session
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
example(stan_model, package = "rstan", run.dontrun = TRUE)
Current Output:
Error in dyn.load(libLFile) :
unable to load shared object '/var/folders/86/8s8l46dj1h12jrx1m71jkxtn0s352c/T//Rtmpz0AKh0/file6556344933ec.so':
dlopen(/var/folders/86/8s8l46dj1h12jrx1m71jkxtn0s352c/T//Rtmpz0AKh0/file6556344933ec.so, 6): Library not loaded: @rpath/libtbbmalloc.2.dylib
Referenced from: /usr/local/opt/tbb/lib/libtbbmalloc_proxy.2.dylib
Reason: image not found
Expected Output:
A successfully sampled example model.
sessionInfo()
Includes package versions and operating system.
> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.4
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rstan_2.21.2 ggplot2_3.3.3 StanHeaders_2.21.0-7
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 pillar_1.6.0 compiler_4.0.5 prettyunits_1.1.1 tools_4.0.5 pkgbuild_1.2.0 jsonlite_1.7.2
[8] lifecycle_1.0.0 tibble_3.1.1 gtable_0.3.0 pkgconfig_2.0.3 rlang_0.4.11 DBI_1.1.1 cli_2.5.0
[15] parallel_4.0.5 curl_4.3.1 loo_2.4.1 gridExtra_2.3 withr_2.4.2 dplyr_1.0.5 generics_0.1.0
[22] vctrs_0.3.8 stats4_4.0.5 grid_4.0.5 tidyselect_1.1.1 glue_1.4.2 inline_0.3.17 R6_2.5.0
[29] processx_3.5.1 fansi_0.4.2 purrr_0.3.4 callr_3.6.0 magrittr_2.0.1 codetools_0.2-18 matrixStats_0.58.0
[36] scales_1.1.1 ps_1.6.0 ellipsis_0.3.2 assertthat_0.2.1 colorspace_2.0-0 V8_3.4.0 utf8_1.2.1
[43] RcppParallel_5.1.4 munsell_0.5.0 crayon_1.4.1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the documented rstan example and the supplied reinstall steps on macOS Big Sur, then inspect the RcppParallel/TBB dynamic-library linkage shown in the error and session information. Done means the example loads its shared object and successfully samples the example model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, r
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100