install package on windows ERROR: compilation failed for package 'cldr'

孤街醉人 提交于 2020-01-23 12:33:48

问题


url <- "http://cran.us.r-project.org/src/contrib/Archive/cldr/cldr_1.1.0.tar.gz"
pkgFile<-"cldr_1.1.0.tar.gz"
download.file(url = url, destfile = pkgFile)

Console

>trying URL 'http://cran.us.r-project.org/src/contrib/Archive/cldr/cldr_1.1.0.tar.gz'
Content type 'application/x-gzip' length 2296083 bytes (2.2 MB)
==============================
  downloaded 2.2 MB

install.packages(pkgs = pkgFile, type = "source", repos = NULL)

> Installing package into ‘C: / Users / v - xuawan / Documents / R / win -
  library / 3.2’
(as ‘lib’ is unspecified)
* installing * source * package 'cldr' ...
** package 'cldr' successfully unpacked and MD5 sums checked
** libs

>  **  * arch - i386
Warning:running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-32~1.0/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-32~1.0/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="cldr.dll" ' had status 127
ERROR:compilation failed for package 'cldr'
* removing 'C:/Users/v-xuawan/Documents/R/win-library/3.2/cldr'
Warning in install.packages:running command '"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\v-xuawan\Documents\R\win-library\3.2" "cldr_1.1.0.tar.gz"' had status 1
Warning in install.packages:installation of package ‘cldr_1.1.0.tar.gz’ had non -
  zero exit status

I tried to install package cldr on windows. I am wondering if any of you know how to solve above error message


回答1:


Have you installed RTools? Choose the right version, which belongs to your R version (it seems you use R 3.2)

From the 127 return code, it looks like you don't have a C++ compiler installed on your path. Have you installed the latest Rtools for Windows? It will give you the C++ toolchain you need.




回答2:


The same functions can be found in other packages now available on CRAN. They can be installed with the usual install.packages("cld2") and install.packages("cld3"):

  • cld2 - https://github.com/ropensci/cld2
  • cld3 - https://github.com/ropensci/cld3

For a quick comparison based on tweets, see this other answer: https://stackoverflow.com/a/46663823/4124601




回答3:


Try this: install.packages("cldr", type="binary"). I was getting same error message for 'backports' package installation.




回答4:


I was having the same issue on R Cloud for 'raster' package, it's fixed when I've switched to Desktop R Studio. I've seen Desktop R studio downloads other required packages too before installing the one you wanted. I'm not sure if this's the exact case for you, but worth to try!



来源:https://stackoverflow.com/questions/37131083/install-package-on-windows-error-compilation-failed-for-package-cldr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!