[Rcpp-devel] Rcpp and inline, compiler configuration errors, windows 7
Dirk Eddelbuettel
edd at debian.org
Tue Jul 3 13:52:35 CEST 2012
Hi Valentin,
On 3 July 2012 at 08:04, valentin.mansion at laposte.net wrote:
| Hello everyone,
|
| I hope I am doing the right thing in posting my question here. If no, sorry...
Welcome -- You absolutely are!
| 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
Good!
| 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?
Could be Cygwin. "Whatever is different on your system".
The inline package "merely" calls the system() function to execute sequences
of "R CMD ..." commands. So you have to make g++ et al are found. If you
have set you shell to be Cygwin, this could be a problem.
At this point, this is not an Rcpp question. Simply by looking just at
inline and try to compile a simple "hello, world" C example (eg from the
examples() of cfunction()).
If you can, also try on another machine just to maintain your sanity. This
tends to "just work" eg on Linux.
Dirk
| 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 ###
|
|
| ----------------------------------------------------------------------
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
More information about the Rcpp-devel
mailing list