[R] Microsoft fighting against cxxfunction() and winning

Rainer K. SACHS rainersachs at berkeley.edu
Fri Oct 17 20:57:00 CEST 2014


Running Windows 7, 64 bit (but also including, I think, 32 bit R files)
RStudio 0.98.501
win-library 3.1

Getting error messages, probably related to add_path, for the
following example script; I did look within RStudio and on the
internet but can't understand the errors, let alone fix them, so any
hints would be appreciated.

library(inline)
library(Rcpp)
library(devtools)
f2 <- cxxfunction( signature(x = "integer", y = "numeric" ) , '
      return wrap( as<int>(x) * as<double>(y) ) ;
    ', plugin = "Rcpp" )
fx( 2L, 5 )
# add_path("Rtools\\bin",after=0)
# add_path("Rtools\\gcc-4.6.3\\bin",after=1)
# get_path()

1) If I run as is, the error message is:
Error in compileCode(f, code, language = language, verbose = verbose) :
  Compilation ERROR, function(s)/method(s) not created! Warning message:
running command 'make -f "C:/PROGRA~1/R/R-31~1.1/etc/x64/Makeconf" -f
"C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk"
SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'
SHLIB="file1a2c862738.dll" WIN=64 TCLBIN=64
OBJECTS="file1a2c862738.o"' had status 127
In addition: Warning message:
running command 'C:/PROGRA~1/R/R-31~1.1/bin/x64/R CMD SHLIB
file1a2c862738.cpp 2> file1a2c862738.cpp.err.txt' had status 1

2) If I uncomment the commented lines I get a longer, more
interesting, even less comprehensible error message:
Error in compileCode(f, code, language = language, verbose = verbose) :
  Compilation ERROR, function(s)/method(s) not created! cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-31~1.1/etc/x64/Makeconf
  Preferred POSIX equivalent is:
/cygdrive/c/PROGRA~1/R/R-31~1.1/etc/x64/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
Syntax error: EOF in backquote substitution
make: *** [file20681e531a0b.o] Error 2
Warning message:
running command 'make -f "C:/PROGRA~1/R/R-31~1.1/etc/x64/Makeconf" -f
"C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk"
SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'
SHLIB="file20681e531a0b.dll" WIN=64 TCLBIN=64
OBJECTS="file20681e531a0b.o"' had status 2
In addition: Warning message:
running command 'C:/PROGRA~1/R/R-31~1.1/bin/x64/R CMD SHLIB
file20681e531a0b.cpp 2> file20681e531a0b.cpp.err.txt' had status 1
>

3) If I try to read cygwin-ug-net/using.html they don't seem to
address 64 bit Windows.

Any suggestions? Thank you, Ray Sachs



More information about the R-help mailing list