title: How to install tar.gz R package with non-zero exit status
body: <p>I want to install an old 2009 R tar.gz package in Windows 7, and have tried installing it using new and old versions of R (3.1.1 - output shown below, 2.7.0). This may not be pertinent to the solution, but I've set the path temporarily for R to recognize Rtools 31 using the code supplied in this <a href="http://stackoverflow.com/questions/8042136/install-r-package-from-source-without-changing-path-windows">solution</a>. </p>
  
  <p>I've seen this package used in recent journal articles so I know it's functional. If you would like to try installing this package it is available <a href="http://cran.r-project.org/src/contrib/Archive/cusp/" rel="nofollow noreferrer">here</a>.</p>
  
  <p><strong>Does anyone know how I can solve this cygwin warning, or  Error: compilation failed problem/installation had non-zero exit status?</strong></p>
  
  <p>I really appreciate it, thank you very much!  </p>
  
  <pre><code>&gt; install.packages("cusp_2.2.tar.gz",type="source",repos=NULL,dependencies=TRUE)
  * installing *source* package 'cusp' ...
  ** package 'cusp' successfully unpacked and MD5 sums checked
  ** libs
  
  *** arch - i386
  cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf
  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-31~1.1/etc/i386/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
  gcc -m32 -I"C:/PROGRA~1/R/R-31~1.1/include" -DNDEBUG - I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O3 -Wall  -std=gnu99 -mtune=core2 -c cusp.nc.c -o cusp.nc.o
  gcc: not found
  make: *** [cusp.nc.o] Error 127
  Warning: running command 'make -f "C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R- 31~1.1/share/make/winshlib.mk" SHLIB="cusp.dll" OBJECTS="cusp.nc.o"' had status 2
  ERROR: compilation failed for package 'cusp'
  * removing 'C:/Program Files/R/R-3.1.1/library/cusp'
  Warning messages:
  1: running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.1.1\library" "cusp_2.2.tar.gz"' had status 1 
  2: In install.packages("cusp_2.2.tar.gz", type = "source", repos = NULL,  :
  installation of package ‘cusp_2.2.tar.gz’ had non-zero exit status
  </code></pre>
  
  <h3>Session Info and Library Path information</h3>
  
  <pre><code>&gt; sessionInfo()
  R version 3.1.1 (2014-07-10)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  
  locale:
  [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 
  
  &gt; .libPaths()
  [1] "C:/Program Files/R/R-3.1.1/library"
  </code></pre>