Bug in MRO breaking Rcpp RRS feed

  • Question

  • tmp.cpp is

    #include <Rcpp.h>
    using namespace Rcpp;

    // [[Rcpp::export]]
    double meanC(NumericVector x) {
      int n = x.size();
      double total = 0;
      for(int i = 0; i < n; ++i) {
        total += x[i];
      return total / n;

    > Rcpp::sourceCpp('~/Desktop/tmp.cpp')
    C:/Rtools-3.3/mingw_64/bin/g++ -m64 -I"C:/PROGRA~1/MICROS~1/MRO/R-33~1.0/include" -DNDEBUG     -I"C:/Users/kmbel/R/win-library/3.3/Rcpp/include" -I"C:/Users/kmbel/Desktop"  -I"c:/applications/extsoft/include"     -O2 -Wall  -mtune=core2 -c tmp.cpp -o tmp.o
    C:/Rtools-3.3/mingw_64/bin/g++: not found
    make: *** [tmp.o] Error 127
    Warning message:
    running command 'make -f "C:/PROGRA~1/MICROS~1/MRO/R-33~1.0/etc/x64/Makeconf" -f "C:/PROGRA~1/MICROS~1/MRO/R-33~1.0/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_4.dll" WIN=64 TCLBIN=64 OBJECTS="tmp.o"' had status 2 
    > sessionInfo()
    R version 3.3.0 (2016-05-03)
    Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows >= 8 x64 (build 9200)
    [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
    [4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    other attached packages:
    [1] RevoUtilsMath_3.2.5
    loaded via a namespace (and not attached):
     [1] httr_1.1.0                R6_2.1.2                  tools_3.3.0               withr_1.0.1               RcppArmadillo_0.
     [6] curl_0.9.7                memoise_1.0.0             Rcpp_0.12.6.4             git2r_0.15.0              digest_0.6.9             
    [11] devtools_1.12.0  

    I can confirm this works fine in regular R and in regular R in RStudio
    • Edited by Kenny Bell Sunday, August 28, 2016 8:14 PM
    Sunday, August 28, 2016 4:47 AM

All replies

  • Hi, Kenny--

    This was a build artifact of our Microsoft R Open 3.3.0 for Windows build, and has been fixed in Microsoft R Open 3.3.1.

    You can fix it in your 3.3.0 installation by editing the C:\Program Files\Microsoft\MRO\R-3.3.0\etc\x64\Makeconf file and changing the BINPREF line to point to your actual Rtools 3.3 bin directory, typically C:/Rtools/mingw_64/bin.


    Rich Calaway

    Microsoft R Release Manager

    Sunday, August 28, 2016 10:40 PM
  • I would suggest adding the Rcpp test suite (I think it's an important enough package to justify doing so) to your MRO tests to avoid this sort of thing.

    Thanks so much,


    Thursday, September 8, 2016 3:56 PM
  • Thanks for the suggestion. We do try to add regression tests for all reported issues.


    Rich Calaway

    Microsoft R Release Manager

    Thursday, September 8, 2016 8:25 PM