简体   繁体   English

奇怪的错误mkdir“命令的语法不正确”在Windows 7,64位上安装Rcpp和RInside时出错

[英]Weird error mkdir “The syntax of the command is incorrect” error when installing Rcpp and RInside on windows 7, 64bit

I previously installed Rcpp successfully on Windows 7. Now I changed to a new PC and the following command fails mysteriously. 我之前在Windows 7上成功安装了Rcpp。现在我改为新PC,以下命令神秘失败。 I searched around and noticed that some other people's errors usually relate to spaces in directory names. 我四处搜索并注意到其他人的错误通常与目录名称中的空格有关。 So I installed R to a directory without spaces instead. 所以我将R安装到没有空格的目录中。 But the same error still persists. 但同样的错误仍然存​​在。 I notice that the error starts from the "mkdir -p ../inst/lib/i386" line with a message of "The syntax of the command is incorrect." 我注意到错误从“mkdir -p ../inst/lib/i386”行开始,并显示“命令的语法不正确”的消息。 which doesn't look like a message shown by mkdir in unix-alike systems. 这看起来不像是mkdir在unix-like系统中显示的消息。 I have VirtualBox and Windows 7 XP Mode installed on the Windows 7 PC. 我在Windows 7 PC上安装了VirtualBox和Windows 7 XP Mode。 A guess will be that somehow the mkdir command is shadowed by some other windows mkdir command thus the weird error. 猜测是某种方式mkdir命令被其他一些windows mkdir命令遮蔽,因此出现了奇怪的错误。 Can someone help fix this so I can install Rcpp from source on the PC? 有人可以帮忙解决这个问题,这样我就可以在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

I suspect that this is almost surely a $PATH issue. 我怀疑这几乎肯定是$PATH问题。

Make sure the Rtools binaries come before anything else. 确保Rtools二进制文件先于其他任何内容。 You seem to be hitting make binary from somewhere else. 你似乎正在从其他地方make二进制文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM