Error installing htmltools from GitHub

I can't install htmltools from GitHub.

#> Using github PAT from envvar GITHUB_PAT
#> Downloading GitHub repo rstudio/htmltools@HEAD
#>      checking for file ‘/private/var/folders/mk/lh99bg295msg8myvcf5yczkc0000gn/T/RtmpvBkWlO/remotes16ed207d1c1b/rstudio-htmltools-636b95e/DESCRIPTION’ ...  ✓  checking for file ‘/private/var/folders/mk/lh99bg295msg8myvcf5yczkc0000gn/T/RtmpvBkWlO/remotes16ed207d1c1b/rstudio-htmltools-636b95e/DESCRIPTION’
#>   ─  preparing ‘htmltools’:
#>      checking DESCRIPTION meta-information ...  ✓  checking DESCRIPTION meta-information
#>   ─  cleaning src
#>   ─  checking for LF line-endings in source and make files and shell scripts
#>   ─  checking for empty or unneeded directories
#>   ─  building ‘htmltools_0.5.0.9003.tar.gz’
#> Error: Failed to install 'htmltools' from GitHub:
#>   (converted from warning) installation of package '/var/folders/mk/lh99bg295msg8myvcf5yczkc0000gn/T//RtmpvBkWlO/file16edf6c0ea3/htmltools_0.5.0.9003.tar.gz' had non-zero exit status

Created on 2020-11-28 by the reprex package (v0.3.0)

The reprex does not capture what I see on my screen, which is:

I do not think this error is htmltools specific. It appears that I don't have various files like stdlib.h where I should have them. I deleted all my R installations and re-installed, but that did not fix things. For me, the mentioned directory looks like:

I get similar errors when I try to compile other packages.

Any help much appreciated.

#> R version 4.0.3 (2020-10-10)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Catalina 10.15.7
#> 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] 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] compiler_4.0.3  magrittr_2.0.1  tools_4.0.3     htmltools_0.5.0
#>  [5] yaml_2.2.1      stringi_1.5.3   rmarkdown_2.5   highr_0.8      
#>  [9] knitr_1.30      stringr_1.4.0   xfun_0.19       digest_0.6.27  
#> [13] rlang_0.4.9     evaluate_0.14

Created on 2020-11-28 by the reprex package (v0.3.0)

UPDATE: Problem was that I was using clang4 instead of a current version. This was caused by settings in my Makevars file. Solution:


More information here:

It seems you don't have the c compiler properly installed or you have the wrong version for your OS version.

Check the recommended development tools for macOS systems.

Thanks! That page seems relevant (mostly) for those who want to build R, whereas I just want to build a package.

Also, I believe that I have the latest versions installed, e.g.,

Xcode: 12.2

See below for details.

Davids-MacBook-Pro-10:scripts davidkane$ brew config
HEAD: ca5eac845dc11e991d7d8f8c85aebb82dd454f37
Last commit: 7 months ago
Core tap ORIGIN:
Core tap HEAD: f00ba2b3173f5ca2ad59f6d69ed832d1c038f240
Core tap last commit: 6 months ago
HOMEBREW_DISPLAY: /private/tmp/
CPU: quad-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 12.0 build 1200
Git: 2.20.1 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 10.0.1
macOS: 10.15.7-x86_64
Xcode: 12.2
XQuartz: 2.7.11 => /opt/X11
Davids-MacBook-Pro-10:scripts davidkane$ 

Those tools are required for building packages from source

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.