yihui/xfun

Unable to load xcrun when installing

rtw30606 opened this issue · 1 comments

R 4.1.2 on Monterey
RStudio 2021.09.0 Build 351

Input
library(remotes)
remotes::install_github("yihui/xfun")

output
Installing package into ‘/Users/rickwatson/Dropbox/R/DataManagement/renv/library/R-4.1/aarch64-apple-darwin20’
(as ‘lib’ is unspecified)

  • installing source package ‘xfun’ ...
    ** using staged installation
    ** libs
    xcrun: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): tried: '/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libxcrun.dylib' (no such file)).
    ERROR: compilation failed for package ‘xfun’
  • removing ‘/Users/rickwatson/Dropbox/R/DataManagement/renv/library/R-4.1/aarch64-apple-darwin20/xfun’
    Warning messages:
    1: In missing_devel_warning(pkgdir) :
    Package xfun has compiled code, but no suitable compiler(s) were found. Installation will likely fail.
    Install XCode and make sure it works.
    2: In i.p(...) :
    installation of package ‘/var/folders/m3/0wz4s80d4l595_111vshn2r40000gp/T//Rtmp23Fg5r/file3ed782c33ee/xfun_0.28.1.tar.gz’ had non-zero exit status
yihui commented

You need to install Xcode via the command: xcode-select --install, but why do you need to install the Github version of xfun in the first place? Currently the Github version has nothing new compared to the CRAN version.