Rcpp can't find Rtools: “Error 1 occurred building shared library”

半城伤御伤魂 提交于 2019-11-30 11:38:42

Looks like neither your R binaries nor Rtools directories are in your system's PATH environment variable. Try this:

> writeLines(strsplit(Sys.getenv("PATH"), ";")[[1L]])
C:\R\Rtools\bin
C:\R\Rtools\gcc-4.6.3\bin
C:\R\R-devel\bin\x64
[... and so on ...]

If your directories C:\R\R-3.0.1\bin\x64\ and C:\R\Rtools\bin\ & C:\R\Rtools\gcc-*.*.*\bin\ (replace \gcc-*-*-*\ with your version of the gcc-binaries) are not listed, the needed components can't be found. To be on the safe side, also create a system variable called CYGWIN with the value nodosfilewarning.

After changing/creating the PATH and CYGWIN variables, reboot. Then it should work and you can place your sources anywhere on your machine and also compile them manually using R CMD SHLIB.

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