[Rcpp-devel] Compilation ERROR
Sedat Sen
sedatsen06 at gmail.com
Fri Mar 8 07:07:47 CET 2013
Dear list,
I am planning to use Stan through R which requires using Rcpp package and
C++ compiler. I am not familiar with C++. I have been trying to install
necessary packages and tools. I followed the steps given at this website:
http://tonybreyal.wordpress.com/2011/12/07/installing-rcpp-on-windows-7-for-r-and-c-integration/
There is an example code on that website. I tried to run it many times. I
failed at each attempts. I have spent hours and googled but could not get
it run. Could you please help me solve this problem based on the code and
error below.
# install packages
install.packages(c("Rcpp", "rbenchmark", "inline", "RUnit"))
# load main two packages
library(Rcpp)
library(inline)
# do something with Rcpp to quickly check that it works
body <- '
NumericVector xx(x);
return wrap( std::accumulate( xx.begin(), xx.end(), 0.0));'
add <- cxxfunction(signature(x = "numeric"), body, plugin = "Rcpp")
*ERROR:*
cygwin warning:
MS-DOS style path detected: C:/R/etc/x64/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/R/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
filee3865715ed2.cpp:1: sorry, unimplemented: 64-bit mode not compiled in
filee3865715ed2.cpp:1: error: bad value (core2) for -mtune= switch
make: *** [filee3865715ed2.o] Error 1
ERROR(s) during compilation: source code errors or compiler configuration
errors!
Program source:
1:
2: // includes from the plugin
3:
4: #include <Rcpp.h>
5:
6:
7: #ifndef BEGIN_RCPP
8: #define BEGIN_RCPP
9: #endif
10:
11: #ifndef END_RCPP
12: #define END_RCPP
13: #endif
14:
15: using namespace Rcpp;
16:
17:
18: // user includes
19:
20:
21: // declarations
22: extern "C" {
23: SEXP filee3865715ed2( SEXP x) ;
24: }
25:
26: // definition
27:
28: SEXP filee3865715ed2( SEXP x ){
29: BEGIN_RCPP
30:
31: NumericVector xx(x);
32: return wrap( std::accumulate( xx.begin(), xx.end(), 0.0));
33: END_RCPP
34: }
35:
36:
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:/R/etc/x64/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/R/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
filee3865715ed2.cpp:1: sorry, unimplemented: 64-bit mode not compiled in
filee3865715ed2.cpp:1: error: bad value (core2) for -mtune= switch
make: *** [filee3865715ed2.o] Error 1
In addition: Warning message:
running command 'C:/R/bin/x64/R CMD SHLIB filee3865715ed2.cpp 2>
filee3865715ed2.cpp.err.txt' had status 1
>
I am using Windows-64 bit. On my previous run, I also got an error
like *"Cygwin1.dll
Not Found". *In order to fix this I reinstalled the Cygwin but it did not
work. Now I am getting the long error listed above.
I am also adding what seems on my PATH
C:\R\batchfiles_0.6-6;C:\R\Rtools\bin;C:\R\Rtools\MinGW\bin;C:\cygwin\bin
Any suggestion?
--
*Sedat
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130308/1aee4ca5/attachment.html>
More information about the Rcpp-devel
mailing list