0

I have downloaded the latest versions of R (R-3.5.1) and Rtools (Rtools35) but I cannot get them to sync. I have tried several ways (most of the suggestions from online chats) but still cannot get them to align. I get the below, any ideas?

> system("g++")
G__~1.EXE: fatal error: no input files compilation terminated.
> system("gcc")
gcc.exe: fatal error: no input files compilation terminated.
> system("g++ -v")
Using built-in specs.
COLLECT_GCC=C:\Rtools\mingw_64\bin\G__~1.EXE
COLLECT_LTO_WRAPPER=C:/Rtools/mingw_64/bin/../libexec/gcc/x86_64-w64 mingw32/4.9.3/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-4.9.3/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-    sysroot=/home/Jeroen/mingw-gcc-4.9.3/x86_64-493-posix-seh-rt_v3-s/mingw64 --with-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-static --disable-shared --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --with-mpc=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --with-isl=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --with-cloog=/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='x86_64-posix-seh, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/home/Jeroen/mingw-gcc-4.9.3/x86_64-493-posix-seh-rt_v3-s/mingw64/opt/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-zlib-static/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/home/Jeroen/mingw-gcc-4.9.3/x86_64-493-posix-seh-rt_v3-s/mingw64/opt/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-zlib-static/include -I/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/home/Jeroen/mingw-gcc-4.9.3/x86_64-493-posix-seh-rt_v3-s/mingw64/opt/lib -L/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-zlib-static/lib -L/home/Jeroen/mingw-gcc-4.9.3/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 4.9.3 (x86_64-posix-seh, Built by MinGW-W64 project)

Sys.getenv('PATH')
PATH                                            C:\Rtools\bin\;C:\Rtools\perl\bin;C:\Rtools\mingw_64\bin\;C:\R\R-3.5.1\bin\x64\;C:\Program
                                          Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program
                                          Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files (x86)\Common
                                          Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program
                                          Files (x86)\Sennheiser\SoftphoneSDK\;C:\Program Files (x86)\WebEx\Productivity
                                          Tools;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common
                                          Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine
                                          Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program
                                          Files\MiKTeX
                                          2.9\miktex\bin\x64\;
 PATHEXT                                       .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

> R.version
           _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          5.1                         
year           2018                        
month          07                          
day            02                          
svn rev        74947                       
language       R                           
version.string R version 3.5.1 (2018-07-02)
nickname       Feather Spray               
dm4509
  • 1
  • 2
    What do you mean, get them to sync? What are you trying to do? – Hong Ooi Oct 19 '18 at 20:22
  • Yeah can you be a little bit more clear on what the issue is exactly? – Dason Oct 19 '18 at 20:26
  • 1
    I have Rtools installed and fully functional, and `Sys.which("g++")` is also empty for me. That's because Rtools (even when in your system `PATH`) does not put the compilers directly in the path, they are nested down in there. R knows how to get to them. One check to see if it is in your path is `Sys.which("make")`, which should be something like `"c:\\Rtools\\bin\\make.exe"`. (There are tutorials that suggest using `system("g++ -v")` as an indicator, but they might be out-of-date or are suggesting you include `...\\rtools\\mingw_64\\bin` in your path, something I do not think is necessary.) – r2evans Oct 19 '18 at 20:32
  • Really, the best indicator that it is or is not working is trying to install a package from source when it requires compiling. A quick example might be using `Rcpp` with `Rcpp.package.skeleton("quux")` (it defaults to including some cpp code), and compiling it. Whether you use `R CMD ...` or `devtools::build(...)` is up to you. – r2evans Oct 19 '18 at 20:38
  • @r2evans thanks for the direction...however, when doing `Rcpp::sourceCpp("test2.cpp")` I get the following message `Error 1 occurred building shared library.` but according to the read out from `Sys.which('make')` and `system("g++ -v")` the file should compile correctly. Any thoughts? – dm4509 Oct 20 '18 at 19:34
  • That error message is not enough to know anything about the process other than that it did not work. This sounds like a new question, though, and I suggest you include all console output (errors, warnings, etc). – r2evans Oct 20 '18 at 20:46

0 Answers0