Search code examples
rrcpprtools

Can I use the Rcpp code in R without installing Rtools?


The Window HPC server in my lab does not have Rtools, so I've got this message when I sourced the Rcpp code.

Warning message:
running command 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_1.dll" WIN=64 TCLBIN=64 OBJECTS="MultiBayes.v1.o"' had status 127 
Error in sourceCpp("./rcode/MultiBayes.v1.cpp") : 
  Error 1 occurred building shared library.

WARNING: The tools required to build C++ code for R were not found.

Please download and install the appropriate version of Rtools:

http://cran.r-project.org/bin/windows/Rtools/

Execution halted

Since the administrative staff says it might take long time to install Rtools in the server, I'm wondering if there is another way to escape this problem and run the Rcpp code without installing Rtools.

As far as I know, building a package would not be helpful since it also uses Rtools when installing it. Please correct me if wrong.

Can I detour this to run the code?

Thanks for any comments and ideas.


Solution

  • Briefly:

    1. The narrow answer is that "yes, in theory you get by without Rtools" if you happened to install binary-identical version (including patches) of gcc et al. In practice, you cannot (on Windows).

    2. An easy way around is to compile a package of your code outside of the HPC server and deploy the binary build of that package on it. Easy. And no Rtools needed for binaries!

    3. If you do HPC you may also want to look into Linux.