rstudio / htmltools

Tools for HTML generation and output
https://rstudio.github.io/htmltools/
214 stars 67 forks source link

cannot install htmltools #173

Open gabriben opened 4 years ago

gabriben commented 4 years ago

When I run install.packages("htmltools"), I get the following error:

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
* installing *source* package 'htmltools' ...
** using staged installation
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/"  -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/"  -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/unsupported"  -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/BH/include" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/src/"  -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/"  -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/include" -DEIGEN_NO_DEBUG  -D_REENTRANT  -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -include stan/math/prim/mat/fun/Eigen.hpp   -I/usr/local/include   -fPIC  -Wall -g -O2  -c base64.c -o base64.o
In file included from <built-in>:1:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/Eigen/Dense:1:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/Eigen/Core:88:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/Eigen/src/Core/util/Macros.h:613:1: error: 
      unknown type name 'namespace'
namespace Eigen {
^
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/Eigen/src/Core/util/Macros.h:613:16: error: 
      expected ';' after top level declarator
namespace Eigen {
               ^
               ;
In file included from <built-in>:1:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/Eigen/Dense:1:
/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/Eigen/Core:96:10: fatal error: 
      'complex' file not found
#include <complex>
         ^~~~~~~~~
3 errors generated.
make: *** [base64.o] Error 1
ERROR: compilation failed for package 'htmltools'
* removing '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/htmltools'

The downloaded source packages are in
    '/private/var/folders/1w/7cb_xp654jnbtcn_y5nmr_q00000gn/T/Rtmpl8Mvxe/downloaded_packages'
Warning message:
In install.packages("htmltools", repos = "http://R-Forge.R-project.org") :
  installation of package 'htmltools' had non-zero exit status

SessionInfo

> sessionInfo()
R version 4.0.1 (2020-06-06)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.3

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] C

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

other attached packages:
[1] brms_2.13.0          devtools_2.3.0       usethis_1.6.1       
[4] Rcpp_1.0.4.6         data.table_1.12.8    vroom_1.2.1         
[7] rstan_2.19.3         ggplot2_3.3.1        StanHeaders_2.21.0-5

loaded via a namespace (and not attached):
 [1] nlme_3.1-148         matrixStats_0.56.0   fs_1.4.1            
 [4] xts_0.12-0           bit64_0.9-7          threejs_0.3.3       
 [7] rprojroot_1.3-2      tools_4.0.1          backports_1.1.8     
[10] DT_0.13              R6_2.4.1             colorspace_1.4-1    
[13] withr_2.2.0          tidyselect_1.1.0     gridExtra_2.3       
[16] prettyunits_1.1.1    processx_3.4.2       Brobdingnag_1.2-6   
[19] bit_1.1-15.2         curl_4.3             compiler_4.0.1      
[22] cli_2.0.2            shinyjs_1.1          desc_1.2.0          
[25] colourpicker_1.0     labeling_0.3         scales_1.1.1        
[28] dygraphs_1.1.1.6     mvtnorm_1.1-1        ggridges_0.5.2      
[31] callr_3.4.3          stringr_1.4.0        digest_0.6.25       
[34] base64enc_0.1-3      pkgconfig_2.0.3      htmltools_0.4.0     
[37] sessioninfo_1.1.1    fastmap_1.0.1        htmlwidgets_1.5.1   
[40] rlang_0.4.6          shiny_1.4.0.2        farver_2.0.3        
[43] generics_0.0.2       zoo_1.8-8            gtools_3.8.2        
[46] crosstalk_1.1.0.1    dplyr_1.0.0          inline_0.3.15       
[49] magrittr_1.5         loo_2.2.0            bayesplot_1.7.2     
[52] Matrix_1.2-18        munsell_0.5.0        fansi_0.4.1         
[55] abind_1.4-5          lifecycle_0.2.0      stringi_1.4.6       
[58] pkgbuild_1.0.8       plyr_1.8.6           grid_4.0.1          
[61] parallel_4.0.1       promises_1.1.1       crayon_1.3.4        
[64] miniUI_0.1.1.1       lattice_0.20-41      ps_1.3.3            
[67] pillar_1.4.4         igraph_1.2.5         markdown_1.1        
[70] shinystan_2.5.0      codetools_0.2-16     reshape2_1.4.4      
[73] stats4_4.0.1         pkgload_1.1.0        rstantools_2.1.0    
[76] glue_1.4.1           remotes_2.1.1        RcppParallel_5.0.1  
[79] vctrs_0.3.1          httpuv_1.5.4         testthat_2.3.2      
[82] gtable_0.3.0         purrr_0.3.4          assertthat_0.2.1    
[85] mime_0.9             xtable_1.8-4         coda_0.19-3         
[88] later_1.1.0.1        rsconnect_0.8.16     tibble_3.0.1        
[91] shinythemes_1.1.2    memoise_1.1.0        ellipsis_0.3.1      
[94] bridgesampling_1.0-0

my fix (installing v. 0.4.0):

install.packages("https://cran.r-project.org/bin/macosx/contrib/4.0/htmltools_0.4.0.tgz", repos = NULL, type="source")
wch commented 4 years ago

It looks like your system is including C++ headers when compiling C code.

You have this in the compilation command, and I believe that's causing a C++ header to be included when compiling the C code.

-include stan/math/prim/mat/fun/Eigen.hpp  

That is likely due to some misconfiguration on your system.