Error installing and starting rcpp

I'm new to R, so I apologize for the stupid question. I am trying to run rcpp, but I am stuck in an infinite R loop asking me to reinstall RTools.

In general, I followed the code in this blog post , although the first time I installed everything manually, and I subsequently installed everything several times again. I am running Windows 7, R version 3.1.2, R Studio version 0.98.1091 (not that it should matter) and RTools 3.1.

The changed highlight of what my console looks like is as follows:

> library(installr) Welcome to installr version 0.15.3... > install.Rtools() Loading required package: devtools No need to install Rtools - You've got the relevant version of Rtools installed > find_rtools() [1] TRUE > library(Rcpp) > evalCpp("1+1") Error in sourceCpp(code = code, env = env, rebuild = rebuild, showOutput = showOutput, : Error 65535 occurred building shared library. 

At this point, a dialog box appears that says:

Install assembly tools Compilation of C / C ++ code for R requires installation of additional assembly tools. Do you want to install additional tools now?

And then I get directed to download and reinstall RTools 3.1 from cran again.

I saw that this might be a problem with the PATH variable, but I tried various things, including:

  • Nothing (optional) in the PATH variable
  • Including both references to R (C: \ Program Files \ R \ R-3.1.2 \ bin \ x64) and RTools (C: \ RBuildTools \ 3.1 \ bin; C: \ RBuildTools \ 3.1 \ gcc-4.6. 3 \ bin ;) in PATH. Once with RTools first, once with R first
  • Including only a link to RTools in PATH, since I was made the original installation file.

Any ideas on what to try will be greatly appreciated!

EDIT

After Dirk's comment, it looks like I might have a problem installing RTools. I followed the instructions from several blogs / guides to installing RTools; all to no avail (bye!)

This GitHub page contains some instructions on how to install and check if the installation works. I followed all the checks (see below for a copy of the console), and it looks like I have a working installation of RTools, but when I try to run evalCPP() again, I get the same error as before, directing me to install RTools .

 > Sys.getenv('PATH') [1] "C:\\Program Files\\R\\R-3.1.2\\bin\\x64;C:\\RTools\\bin;C:\\RTools\\gcc-4.6.3\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Enterprise Vault\\EVClient\\;C:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\VSShell\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;C:\\Program Files (x86)\\Microsoft SQL Server\\100\\DTS\\Binn\\;C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE\\PrivateAssemblies\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files\\Microsoft\\Web Platform Installer\\;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\" Warning message: printing of extremely long output is truncated > system('g++ -v') Using built-in specs. COLLECT_GCC=C:\RTools\GCC-46~1.3\bin\G__~1.EXE COLLECT_LTO_WRAPPER=c:/rtools/gcc-46~1.3/bin/../libexec/gcc/i686-w64-mingw32/4.6.3/lto-wrapper.exe Target: i686-w64-mingw32 Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --prefix=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --with-gmp=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpfr=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpc=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --disable-shared --enable-static --enable-targets=all --enable-languages=c,c++,fortran --enable-libgomp --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-nls --disable-werror --enable-checking=release --disable-win32-registry --disable-rpath --disable-werror CFLAGS='-O2 -mtune=core2 -fomit-frame-pointer' LDFLAGS= Thread model: win32 gcc version 4.6.3 20111208 (prerelease) (GCC) > system('where make') C:\Rtools\bin\make.exe 

I also looked at Appendix D of R Installation and Admin . I don’t see anything here, I have not tried it yet, except for section D.4 , from which it follows that I may need to rebuild rcpp from the source code using my installed RTools. I don’t have time to do it right away, but we’ll try it if people don’t say that this route is not worth my time.

EDIT v2

So I tried to create rcpp from the source ... and that didn't work either. I downloaded both the package sources and the Windows binaries from the CRAN Rcpp package page . In the R console, now I get:

 > install.packages(pkgs = "C:/Rcpp_0.11.4.tar.gz", repos = NULL, contriburl = NULL, type = "source", verbose = TRUE) Installing package into 'C:/Users/james.macadie/Documents/R/win-library/3.1' (as 'lib' is unspecified) system (cmd0): C:/PROGRA~1/R/R-31~1.2/bin/x64/R CMD INSTALL Warning in install.packages : package 'C:/Rcpp_0.11.4.tar.gz' is not available (for R version 3.1.2) 

I think my active questions now boil down to the following:

  • Reading the entire post above can someone tell me how to fix things so that it just works? Or, not getting it ...
  • What tests can I check to install Rtools correctly? Everything I found on the Internet suggests what I am doing: system('where make') , etc. However, evidence of the impossibility of running evalCpp or other rccp functions suggests that I do not.
  • What am I doing wrong when creating from source? Should I try the command line option?

EDIT v3

Running evalCpp with showOutput= TRUE and verbose = TRUE I think the error in returning the R CMD SHLIB not work. I followed this blog post which showed how to work directly with the R command line. However, when I get to the R CMD SHLIB sequence_examples.c line of R CMD SHLIB sequence_examples.c , execution simply goes straight to the next command line without any action, generating any files in catalog or throwing any errors. I tried running the --help options on the command line, but getting the same error:

 C:\Users\james.macadie> R --help Or: R CMD command args where 'command' is one of: INSTALL Install add-on packages REMOVE Remove add-on packages SHLIB Make a DLL for use with dynload BATCH Run R in batch mode build Build add-on packages check Check add-on packages Rprof Post process R profiling files Rdconv Convert Rd format to various other formats Rdiff difference R output files Rd2pdf Convert Rd format to PDF Rd2txt Convert Rd format to pretty text Stangle Extract S/R code from vignette Sweave Process vignette documentation config Obtain configuration information about R open Open a file via Windows file associations texify Process a latex file Use R CMD command --help for usage information for each command. C:\Users\james.macadie> R CMD SHLIB --help C:\Users\james.macadie> 

NB For people reading earlier code samples above this post, I changed a few things from those snapshots of code:

  • I installed R directly in C: \ R. This used to be in C: \ Program Files \ R \, but as expected, file paths with spaces can cause problems.
  • I refer to Rtools in C: \ Rtools \, and not to C: \ RBuildTools \

Thanks for any suggestions, as always.

+7
r rcpp
source share
3 answers

In the end, it was a bit of a left margin. Inspired by the following post , I looked at the ComSpec environment variable. Not quite sure how, but I have it installed on "cmd.exe" .

Removing double quotes, so he said cmd.exe , and then reloading all fixed ones.

Thanks to everyone who tried to help.

0
source share

When trying to install Twitter BreakoutDetection (which is also written in cpp) had the same endless loop problem

fixed by doing the following

 Sys.setenv(PATH="%PATH%;C:/Rtools/gcc-4.6.3/bin;c:/Rtools/bin") 

and then saying no when the following prompt is displayed:

"Installing build tools Compiling C / C ++ code for R requires installing additional build tools. Do you want to install additional tools now?"

I haven’t tried these actions myself, so I’m not sure if they themselves fixed the problem

+6
source share

I found that ensuring that all of this was in my way fixed this. I did it with RStudio closed; I did not reboot after.

 C:\Program Files\R\R-3.1.3\bin\x64 C:\Program Files\R\R-3.1.3\bin C:\RBuildTools\3.2\bin C:\RBuildTools\3.2\gcc-4.6.3\bin64 C:\RBuildTools\3.2\gcc-4.6.3\bin C:\RBuildTools\3.2\gcc-4.6.3\i686-w64-mingw32\bin 

This is on my Win7-64bit computer. YMMV, and I basically post this so others see it if they have the same problem.

0
source share

All Articles