[Rcpp-devel] Compilation ERROR

Kevin Ushey kevinushey at gmail.com
Fri Mar 8 07:24:50 CET 2013


By default, g++.exe is installed into <Rtools_path>/gcc-<version>/bin; and
you want to make sure that folder is in your path (not just
C:\R\Rtools\bin, so I guess in your case, assuming an up-to-date version of
R/Rtools, you want to make sure C:\R\tools\gcc-4.6.3\bin is also in your
path). Note that this is done by default with the Windows installer (it
sets the system path rather than the user path). Also, ensure that you have
a version of Rtools compatible with the version of R you're using. Finally,
make sure you don't have any other (older?) versions of gcc or g++ hiding
in a path that's included before the Rtools path. If those versions are
getting called rather than the Rtools g++, that could lead to this problem.

-Kevin

On Thu, Mar 7, 2013 at 10:07 PM, Sedat Sen <sedatsen06 at gmail.com> wrote:

> 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
> *
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130307/3aaf6f71/attachment-0001.html>


More information about the Rcpp-devel mailing list