quanteda / quanteda.textmodels

Text scaling and classification models for quanteda
42 stars 6 forks source link

error when installing - ERROR: compilation failed for package ‘quanteda.textmodels’ #27

Closed jrosen48 closed 4 years ago

jrosen48 commented 4 years ago

Thanks for a great package (and quanteda!). When installing via devtools::install_github("quanteda/quanteda.textmodels"), the following error resulted:

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [quanteda.textmodels.so] Error 1
ERROR: compilation failed for package ‘quanteda.textmodels’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/quanteda.textmodels’
Error: Failed to install 'quanteda.textmodels' from GitHub:
  (converted from warning) installation of package ‘/var/folders/xd/xrgmmrv97355mcjtmjqcr72w0000gp/T//RtmpxVHtSt/file8f29c9e147e/quanteda.textmodels_0.9.1.tar.gz’ had non-zero exit status
jrosen48 commented 4 years ago

Here is my session info, via sessionInfo():

R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.4

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
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     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6      compiler_4.0.0    prettyunits_1.1.1 remotes_2.1.1     tools_4.0.0       testthat_2.3.2    digest_0.6.25    
 [8] packrat_0.5.0     pkgbuild_1.0.8    pkgload_1.0.2     evaluate_0.14     memoise_1.1.0     lattice_0.20-41   rlang_0.4.6      
[15] Matrix_1.2-18     cli_2.0.2         rstudioapi_0.11   curl_4.3          yaml_2.2.1        parallel_4.0.0    xfun_0.14        
[22] withr_2.2.0       knitr_1.28        fs_1.4.1          desc_1.2.0        devtools_2.3.0    rprojroot_1.3-2   grid_4.0.0       
[29] glue_1.4.1        R6_2.4.1          processx_3.4.2    fansi_0.4.1       rmarkdown_2.1     bookdown_0.18     sessioninfo_1.1.1
[36] callr_3.4.3       magrittr_1.5      usethis_1.6.1     backports_1.1.7   ps_1.3.3          ellipsis_0.3.1    htmltools_0.4.0  
[43] assertthat_0.2.1  crayon_1.3.4    
kbenoit commented 4 years ago

You need to install gfortran, please try following these instructions (for R 4.0 - I am using the same): https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/

Then it should work.