我正在尝试在我的计算机中创建R开发环境。在过去的一小时里 我可以成功安装RTools和RCpp。但是当我尝试最后一个元素RInside包时,我得到以下错误。我可以看到原因是因为g ++或make无法识别包含空格的路径(Program Files - > Files)但是如何更改make文件或batter问题是...编译后生成make文件的位置在哪里?
> install.packages(c("RInside"),type="source")
trying URL 'http://cran.revolutionanalytics.com/src/contrib/RInside_0.2.8.tar.gz'
Content type 'application/x-gzip' length 61012 bytes (59 Kb)
opened URL
downloaded 59 Kb
* installing *source* package 'RInside' ...
** package 'RInside' successfully unpacked and MD5 sums checked
** libs
cygwin warning:
MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.1/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-215~1.1/etc/i386/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
C:/PROGRA~1/R/R-215~1.1/bin/i386/Rscript.exe tools/RInsideAutoloads.r > RInsideAutoloads.h
C:/PROGRA~1/R/R-215~1.1/bin/i386/Rscript.exe tools/RInsideEnvVars.r > RInsideEnvVars.h
g++ -I"C:/PROGRA~1/R/R-215~1.1/include" -DNDEBUG -I../inst/include/ -I"C:/Program Files/R/R-2.15.1/library/Rcpp/include" -O2 -Wall -mtune=core2 -c MemBuf.cpp -o MemBuf.o
g++ -I"C:/PROGRA~1/R/R-215~1.1/include" -DNDEBUG -I../inst/include/ -I"C:/Program Files/R/R-2.15.1/library/Rcpp/include" -O2 -Wall -mtune=core2 -c RInside.cpp -o RInside.o
g++ -shared -s -static-libgcc -o RInside.dll tmp.def MemBuf.o RInside.o C:/Program Files/R/R-2.15.1/library/Rcpp/lib/i386/libRcpp.a -LC:/PROGRA~1/R/R-215~1.1/bin/i386 -lR
g++.exe: error: Files/R/R-2.15.1/library/Rcpp/lib/i386/libRcpp.a: No such file or directory
ar qc libRInside.a MemBuf.o RInside.o
cp libRInside.a ../inst/lib/i386
g++ -Wl,--export-all-symbols -shared -o libRInside.dll MemBuf.o RInside.o C:/Program Files/R/R-2.15.1/library/Rcpp/lib/i386/libRcpp.a -L"C:/PROGRA~1/R/R-215~1.1/bin/i386" -lR -lws2_32
g++.exe: error: Files/R/R-2.15.1/library/Rcpp/lib/i386/libRcpp.a: No such file or directory
make: *** [libRInside.dll] Error 1
ERROR: compilation failed for package 'RInside'
* removing 'C:/Program Files/R/R-2.15.1/library/RInside'
The downloaded source packages are in
‘C:\Users\Administrator\AppData\Local\Temp\Rtmp6lSKly\downloaded_packages’
Warning messages:
1: running command 'C:/PROGRA~1/R/R-215~1.1/bin/i386/R CMD INSTALL -l "C:/Program Files/R/R-2.15.1/library" C:\Users\ADMINI~1\AppData\Local\Temp\Rtmp6lSKly/downloaded_packages/RInside_0.2.8.tar.gz' had status 1
2: In install.packages(c("RInside"), type = "source") :
installation of package ‘RInside’ had non-zero exit status
>
答案 0 :(得分:2)
安装在不包含空格的路径中 - 我喜欢我的R包的C:/opt/R/R-library/
。
由于空格原因,最终链接命令失败。
此问题已在此处和rcpp-devel列表中多次询问和回答。
答案 1 :(得分:0)
看起来这个页面有一个指向二进制版本的RInside for Windows的链接。我下载了它,它似乎也包括源。
http://cran.r-project.org/web/packages/RInside/index.html
Windows二进制文件:RInside_0.2.8.zip
http://cran.r-project.org/bin/windows/contrib/r-release/RInside_0.2.8.zip