1

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 solution.

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 here.

Does anyone know how I can solve this cygwin warning, or Error: compilation failed problem/installation had non-zero exit status?

I really appreciate it, thank you very much!

> 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

Session Info and Library Path information

> 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 

> .libPaths()
[1] "C:/Program Files/R/R-3.1.1/library"
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
user36454
  • 11
  • 1
  • 1
  • 3
  • Hard to tell (since it succeeded with no errors on my Mac), but I would have tried putting the source file in your working directory which I am guessing was not the "Desktop",... at least it should not be. You should post the output from `sessionInfo()` and `.libPaths()` and describe what version of RTools you are using. – IRTFM Oct 03 '14 at 00:23
  • @BondedDust thank you for your assistance! I moved the tar.gz file to the working directory and tried installing it from there (without path specification using the source function), but I still had the same problem. Can you please describe the details of your setup? Mac/OS, R version, method of package install/code? Thank you! – user36454 Oct 03 '14 at 15:51
  • I'm using the binary SL-build of R 3.1.1 on OSX 10.7.5 with the appropriate toolchain (aka RTools for the Windows user) and "command line tools" (which I think is part of RTools in Win_x). I only install packages to a single version-specific library location in the R.Frameworks directory. I installed from the GUI console with: `install.packages("~/cusp_2.2.tar.gz",type="source",repos=NULL, dependencies=TRUE)`. It did not appear to have any compiled code so you might be able to get the functions just by untarring the source package. – IRTFM Oct 03 '14 at 16:14
  • Thanks @BondedDust. I'm still having a problem installing the package. I've now properly set R to recognize RTools, and I've been given a new error message with the cygwin warning. That was keen of you to observe that I might get at the functions directly. This proved fruitful. As a workaround to installing the package, I sourced the .R scripts. Unfortunately, the function didn't work even with the sample data sets and sample script. Due to this, I'm set on trying to properly install the package, and perhaps the function will work then. Does anything else come to mind I should try? Thanks! – user36454 Oct 04 '14 at 01:49
  • You need to deal with `gcc: not found`. Your `$PATH` is incorrect. See the 'R Inst + Admin' manual. – Dirk Eddelbuettel Oct 04 '14 at 01:56
  • Cygwin is not a natural foundation for compiling R packages. You need avoid it if you are not exceptionally facile with Windows facilities. On the other hand there did not appear to be any C code in that package. – IRTFM Oct 04 '14 at 03:50
  • @BondedDust and Dirk Eddelbuettel thank you. I have resolved the problem. I used the devtools build function to convert the directory in the cusp_2.2.tar.gz file into a .zip file. I could then successfully install it using the install.packages function. Once installed, the cusp function worked properly! Thank you both for your efforts! – user36454 Oct 04 '14 at 04:27
  • How did you do the above? I have a similar problem with ROracle package – Oli Oct 05 '16 at 13:00
  • Please add your solution as an answer instead of updating the question – Bhargav Rao Jul 24 '18 at 02:40

0 Answers0