[Rcpp-devel] Rcpp and inline, compiler configuration errors, windows 7
valentin.mansion at laposte.net
valentin.mansion at laposte.net
Tue Jul 3 08:04:52 CEST 2012
Hello everyone,
I hope I am doing the right thing in posting my question here. If no, sorry... I've been through the Rcpp FAQ, the Rcpp-Introduction vignette, the Appendix D The Windows toolset, and quite a lot of googling but I havn't found a solution to my problem.
My final objective is to speed up a script that builds an estimated satellite image from three other images. I have factorized everything I could, tried a bit of parallel processing, but the script is still too slow so I would like to use some C++ inside it to reduce the computing time (using inline() for having C++ made functions instead of R-made functions). At the moment, I am just trying to run examples of inline(), but it doesn't work.
Using the following example, R gives me error messages (one at he beginning of the R-GUI "ouput text", one at the end). Source of the example: http://stackoverflow.com/questions/7852520/how-to-make-inline-c-function-calls-in-r
>From what I understand of the error messages, g++ (the compiler, I think) cannot be found. On this thread, someone had a problem that looks like mine, it was a path problem : http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-March/003597.html
When I type "path" on the Windows Command Prompt, I get this :
PATH=C:\R\Rtools\bin;C:\R\Rtools\MinGW\bin;C:\R\R-2.15.1\bin
No spaces in the directory names, I think it should be fine. However, it doesn't work. Could the problem come from Cygwin? If yes, do you have a clue on how to solve it? If no, could you tell me what I did wrong?
I put sessionInfo() data at the end of my message. My computer runs on windows 7 enterprise, 32 bits.
Thanks,
Valentin Mansion
### example used : ###
library(Rcpp)
library(inline)
xorig <- c(1, -2, 3, -4, 5, -6, 7)
code <- '
Rcpp::NumericVector x(xs);
Rcpp::NumericVector xa = sapply( x, ::fabs );
return(xa);
'
xabs <- cxxfunction(signature(xs="numeric"),
plugin="Rcpp",
body=code)
xabs(xorig)
### end of example ###
### error message at the begining of output text ###
cygwin warning:
MS-DOS style path detected: C:/R/R-215~1.1/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/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
g++: not found
make: *** [file146c5ece3f56.o] Error 127
ERROR(s) during compilation: source code errors or compiler configuration errors!
### end of error message at the beginning of output text ###
### error message at the end of output text###
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!
###cygwin warning deleted to make the text shorter###
g++: not found
make: *** [file146c5ece3f56.o] Error 127
In addition: Warning message:
running command 'C:/R/R-2.15.1/bin/i386/R CMD SHLIB file146c5ece3f56.cpp 2> file146c5ece3f56.cpp.err.txt' had status 1
### end of error message ###
### sessionInfo() ###
R version 2.15.1 (2012-06-22)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=C LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] tools stats graphics grDevices utils datasets methods base
other attached packages:
[1] RcppArmadillo_0.3.2.0 inline_0.3.8 Rcpp_0.9.13
### end of sessionInfo ###
Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120703/e4a0934c/attachment.html>
More information about the Rcpp-devel
mailing list