0

我之前在 Windows 7 上成功安装了 Rcpp。现在我换了一台新电脑,下面的命令神秘地失败了。我四处搜寻,发现其他人的错误通常与目录名称中的空格有关。所以我将 R 安装到没有空格的目录中。但同样的错误仍然存​​在。我注意到错误从“mkdir -p ../inst/lib/i386”行开始,并带有“命令的语法不正确”的消息。这看起来不像 mkdir 在类 unix 系统中显示的消息。我在 Windows 7 PC 上安装了 VirtualBox 和 Windows 7 XP Mode。猜测可能是 mkdir 命令以某种方式被其他一些 windows mkdir 命令遮蔽,因此出现了奇怪的错误。有人可以帮助解决这个问题,以便我可以从 PC 上的源代码安装 Rcpp 吗?

> install.packages("Rcpp", type = "source")
Installing package into ‘D:/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://stat.ethz.ch/CRAN/src/contrib/Rcpp_0.10.6.tar.gz'
Content type 'application/x-gzip' length 1985569 bytes (1.9 Mb)
opened URL
downloaded 1.9 Mb

* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** libs

*** arch - i386
cygwin warning:
  MS-DOS style path detected: C:/R/R-30~1.1/etc/i386/Makeconf
  Preferred POSIX equivalent is: /cygdrive/c/R/R-30~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
g++ -m32 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Date.cpp -o Date.o
g++ -m32 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Module.cpp -o Module.o
gcc -m32 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c Rcpp_init.c -o Rcpp_init.o
g++ -m32 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Timer.cpp -o Timer.o
g++ -m32 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c api.cpp -o api.o
g++ -m32 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c attributes.cpp -o attributes.o
g++ -m32 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c barrier.cpp -o barrier.o
g++ -m32 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c exceptions.cpp -o exceptions.o
ar crs libRcpp.a Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o
mkdir -p ../inst/lib/i386
The syntax of the command is incorrect.
make: [userlib] Error 1 (ignored)
mv libRcpp.a ../inst/lib/i386/libRcpp.a 
mv: cannot move `libRcpp.a' to `../inst/lib/i386/libRcpp.a': No such file or directory
make: [userlib] Error 1 (ignored)
"zDate.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o" was unexpected at this time.
make: *** [Rcpp.dll] Error 1
ERROR: compilation failed for package 'Rcpp'
* removing 'D:/Documents/R/win-library/3.0/Rcpp'

The downloaded source packages are in
        ‘C:\Users\User Name\AppData\Local\Temp\RtmpcVfKZv\downloaded_packages’
Warning messages:
1: running command '"C:/R/R-3.0.1/bin/x64/R" CMD INSTALL -l "D:\Documents\R\win-library\3.0" C:\Users\USERNA~1\AppData\Local\Temp\RtmpcVfKZv/downloaded_packages/Rcpp_0.10.6.tar.gz' had status 1 
2: In install.packages("Rcpp", type = "source") :
  installation of package ‘Rcpp’ had non-zero exit status
4

1 回答 1

2

我怀疑这几乎肯定是一个$PATH问题。

确保 Rtools 二进制文件排在其他位置之前。您似乎正在make从其他地方击中二进制文件。

于 2013-12-29T15:29:48.900 回答