简体   繁体   中英

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. 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. 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." which doesn't look like a message shown by mkdir in unix-alike systems. I have VirtualBox and Windows 7 XP Mode installed on the Windows 7 PC. A guess will be that somehow the mkdir command is shadowed by some other windows mkdir command thus the weird error. Can someone help fix this so I can install Rcpp from source on the PC?

> 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.

Make sure the Rtools binaries come before anything else. You seem to be hitting make binary from somewhere else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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