Skip to content

Help with installing a .tar.gz package on windows

13 messages · Zsurzsa Laszlo, Berend Hasselman, Brian Ripley +6 more

#
Hi, 
I have a source package that isn't available as a windows zip file. Can
anyone explain to me how I can install this on my windows R platform?
When I use the following code: 
 install.packages("PReMiuM_3.0.21.tar.gz", type = "source") 


I get this error message: 



* installing *source* package 'PReMiuM' ... 
** libs 

*** arch - i386 
ERROR: compilation failed for package 'PReMiuM' 
* removing 'C:/Program Files/R/R-3.0.1/library/PReMiuM' 
Warning messages: 
1: running command '"C:/PROGRA~1/R/R-30~1.1/bin/x64/R" CMD INSTALL -l
"C:\Program Files\R\R-3.0.1\library" "PReMiuM_3.0.21.tar.gz"' had status
1 
2: In install.packages("PReMiuM_3.0.21.tar.gz", type = "source") : 
  installation of package ?PReMiuM_3.0.21.tar.gz? had non-zero exit
status
Thanks for any help anyone can give me, 
Lucy
#
On 08-07-2013, at 02:15, "Lucy Leigh" <Lucy.Leigh at newcastle.edu.au> wrote:

            
Where did you get that version from?
CRAN has version 3.0.20 and that is available as a binary Windows package (.zip).

As for the error message: you have to have Rtools installed to compile source packages.

Berend
#
On 08/07/2013 01:15, Lucy Leigh wrote:
I am surprised that is all you saw, but running

Rcmd INSTALL PReMiuM_3.0.21.tar.gz

at a shell command line should show you more.

Note that version 3.0.20 does install on Windows: see 
http://cran.r-project.org/web/checks/check_results_PReMiuM.html .  But 
it does need BOOSTLIB set to your local boost installation (and I 
suspect you do not have one).  The suggests that using the winbuilder 
service might well work.

Package-specific questions are best addressed to the maintainer.

  
    
#
Great thank you - are there any resources that step through how to use
RTools to compile the
source package and install it in R on (64-bit windows) ?
On 08-07-2013, at 02:15, "Lucy Leigh" <Lucy.Leigh at newcastle.edu.au>
wrote:
Can
platform?
Where did you get that version from?
CRAN has version 3.0.20 and that is available as a binary Windows
package (.zip).

As for the error message: you have to have Rtools installed to compile
source packages.

Berend
-l
status
exit
http://www.R-project.org/posting-guide.html
1 day later
#
Hi,
I have had a look at the manual but it makes no sense to me. I have
downloaded RTools, and the InnoSetup,
but I don't understand how to use these to install my package? Am I
meant to be writing commands
in R itself, or in these other things I've downloaded?
Lucy
Hi Lucy:

Did you look at the R Installation and Administration manuals?  There's
a
good section about installing on Windows via Rtools.



On Mon, Jul 8, 2013 at 10:18 PM, Lucy Leigh
<Lucy.Leigh at newcastle.edu.au>wrote:

            
use
file.
compile

  
    
#
Lucy, you have stepped into something of a mess. Although you just want to install the package to use it, installing from source often (but not always) requires the ability to compile C, C++, or Fortran, and discussions about development really belong on the R-devel mailing list. The steps needed may be extremely simple, or quite complex depending on how that package is constructed. They are automatic on most operating systems, but on Windows you have to learn a bit more than you appear comfortable with to make the conversion to binary.

In short, if you cannot utilize the documentation to build it yourself, you should wait for it to get through the review process at CRAN so you can install a binary version from a repository, or ask the library developer to create a "preview" binary version for you. If you want to pursue the compile it yourself approach further you are going to have to take your questions to R-devel and be prepared to read the documentation more carefully so you can ask specific questions rather than open-ended ones.

Your question about writing commands in R is an example of an open-ended question, since you did not say which commands you are thinking of. You do have to use the operating system command line ("cmd") in several cases, and you have to get the environment variables setup properly before those commands will work (which is operating-system specific and not about R) but the R team cannot reproduce documentation for every operating system so you need to learn that with Google.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
Lucy Leigh <Lucy.Leigh at newcastle.edu.au> wrote:

            
#
On Jul 10, 2013, at 4:37 PM, Lucy Leigh wrote:

            
Since you are clearly out of your league with respect to compiling from source, now is the time to ask (again), why are you not installing the binary package?

At the R command line just type:

install.packages("PReMiuM")  # should default to type="win.binary" and use a CRAN mirror
#
On 11/07/2013 01:22, David Winsemius wrote:
Or as she seems to want to use a later version than on CRAN, to ask 
again why she does not use winbuilder.
#
We are all beginners at something.  Telling Windows users that building packages
from source is beyond them is walling them off from a very productive area.

Here is how I set things up to build R packages from either a source directory
or a tar.gz file on Windows.

(a) Download Rtools for your version of R from Duncan Murdoch's site (or whereever
it is) and install it.  I install it into C:\Rtools\Rtools-i.j.k (where i.j.k is currently 3.0.x).
I select 'no' if the installer asks whether I want to update my global PATH variable
because I need to be able to compile packages for various version and dialects of S (R, S+, TERR).

(b) Make a text file in C:\Rtools\Rtools-3.0.x called SETPATH.bat containing the following
::: start of file 
: You should set the following 2 variables to say where you installed Rtools and R itself
set RTOOLS_HOME=C:\Rtools\Rtools-3.0.x
set R_HOME=C:\Program Files\R\R-3.0.1

: You may have to change gcc-4.6.3 to something else as the version supplied
: in Rtools-x.y.z changes, but the following works now.
set RTOOLS_PATH=%RTOOLS_HOME%\bin;%RTOOLS_HOME%\MinGW\bin;%RTOOLS_HOME%\gcc-4.6.3\bin
set R_PATH=%R_HOME%\bin

set PATH=%RTOOLS_PATH%;%R_PATH%;%PATH%
::: end of file

You only have to do steps (a) and (b) once for a given version of R.

(c) When you want to compile a package, make a new DOS commands window (run cmd.exe)  and type
     C:\Rtools\Rtools-3.0.x\SETPATH.bat
at the DOS prompt to run the bat file that you created in (b).  cd to the directory containing the package source and type (still at the DOS prompt)
    R CMD INSTALL myPackage.tar.gz
or
    R CMD INSTALL myPackage
depending on if you have a tar.gz file or a directory containing the package source.

Test the package by typing
    R
and when you get the R prompt
    library(myPackage)

If you want to use things like MiKTeX or InnovSetup add their bin directories to PATH
in that SETPATH.bat file.

There are other paths to build a package from source, but see if this one works.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
#
On Jul 11, 2013, at 1:37 AM, Rolf Turner wrote:

            
I read that paragraph as saying that if a specific package , i.e. a particular numbered version, is already on CRAN or the BioC server, then do not duplicate effort. Also do not submit if a CRAN compilation resulted in an error. Especially in light of Prof. Ripley's (reiterated) advice, I did not read it as saying that a pre-release update to an existing package should not be submitted (after suitable alterations of the DESCRIPTION file.)