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

Install issue - splitting "Application Support" path to RcppParallel #579

Open
daeh opened this issue Nov 16, 2022 · 3 comments
Open

Install issue - splitting "Application Support" path to RcppParallel #579

daeh opened this issue Nov 16, 2022 · 3 comments
Labels

Comments

@daeh
Copy link

daeh commented Nov 16, 2022

Summary:

clang error when installing rstanarm. Path to RcppParallel is not being shell escaped and is being split at space in "Application Support".

Description:

I'm trying to install rstanarm on an arm64 Mac and am getting the error,

clang: error: no such file or directory: 'Support/renv/cache/v5/R-4.2/aarch64-apple-darwin21.6.0/RcppParallel/5.1.5/f3e94e34ff656a7c8336ce01207bc2b8/RcppParallel/include''
make: *** [stan_files/bernoulli.o] Error 1
rm stan_files/bernoulli.cc
ERROR: compilation failed for package ‘rstanarm’

The path should be ~/Library/Application Support/renv/cache/v5/R-4.2/aarch64-apple-darwin21.6.0/RcppParallel/5.1.5/f3e94e34ff656a7c8336ce01207bc2b8/RcppParallel/include/RcppParallel.h

So something is not escaping the space, which is causing the path to get split. I'm not sure where to start troubleshooting so any pointers would be greatly appreciated. My ~/.R/Makevars was initially

FC      = /opt/homebrew/Cellar/gcc/12.2.0/bin/gfortran
F77     = /opt/homebrew/Cellar/gcc/12.2.0/bin/gfortran
FLIBS   = -L/opt/homebrew/Cellar/gcc/12.2.0/lib

and I've tried adding various things, e.g.

CXX=clang++
CXX_STD = CXX11
PKG_LIBS += $(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")

but nothing seems to change the error. I use homebrew for gcc and clang.

Thanks a ton.

Reproducible Steps:

install.packages("rstanarm")

RStanARM Version:

latest, both from CRAN and from install.packages("rstanarm", type = "source")

R Version:

4.2.2

Operating System:

OS X 12.6.1

@jgabry jgabry added the bug label Nov 16, 2022
@jgabry
Copy link
Member

jgabry commented Nov 16, 2022

@bgoodri Any ideas? These compilation errors are not my area of expertise.

@daeh Are you able to successfully install the binary from CRAN in the meantime? Or are there issues with that too and not just installing from source?

@daeh
Copy link
Author

daeh commented Nov 22, 2022

Thanks a ton for looking into it.

Trying to install from CRAN (i.e. install.packages("rstanarm")) runs into the same Application Support/renv/cache issue, which I guess means that it isn't able to locate an appropriate binary?

Installing a downloaded binary

renv::install(file.path(wdir, "packagesource/rstanarm_2.21.3.tgz"), repos= NULL)

doesn't raise any errors during the install, but then rstanarm can't find libR.dylib:
dlopen(~/.../renv/library/R-4.2/aarch64-apple-darwin21.6.0/rstanarm/libs/rstanarm.so, 0x0006): Library not loaded: '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libR.dylib'

The libR.dylib issue seems like something I can probably resolve. Will report back when I have a chance to look at it.

@mikegilchrist
Copy link

I am having the same issue with the same error line on 22.04. Neither "install.github" nor "install.packages" works. rstan and StanHeaders are installed from github and work.


> sessionInfo()
R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  utils     datasets  grDevices methods   base     

other attached packages:
[1] devtools_2.4.5 usethis_2.1.6 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9        compiler_4.2.2    later_1.3.0       urlchecker_1.0.1 
 [5] prettyunits_1.1.1 profvis_0.3.7     remotes_2.4.2     tools_4.2.2      
 [9] digest_0.6.31     pkgbuild_1.4.0    pkgload_1.3.2     memoise_2.0.1    
[13] lifecycle_1.0.3   rlang_1.0.6       shiny_1.7.4       cli_3.5.0        
[17] curl_4.3.2        fastmap_1.1.0     withr_2.5.0       stringr_1.5.0    
[21] desc_1.4.2        fs_1.5.2          htmlwidgets_1.6.0 rprojroot_2.0.3  
[25] glue_1.6.2        R6_2.5.1          processx_3.8.0    sessioninfo_1.2.2
[29] callr_3.7.3       purrr_0.3.4       magrittr_2.0.3    ps_1.7.2         
[33] promises_1.2.0.1  ellipsis_0.3.2    htmltools_0.5.4   mime_0.12        
[37] xtable_1.8-4      httpuv_1.6.7      stringi_1.7.8     miniUI_0.1.1.1   
[41] cachem_1.0.6      crayon_1.5.2   

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

No branches or pull requests

3 participants