Skip to content

Built on Mac, Installing on Windows - should this work?

8 messages · Bryan Hanson, Brian Ripley, Duncan Murdoch +1 more

#
On 30/11/2009 11:10 AM, Bryan Hanson wrote:
The source tarball (the .tar.gz file) would be fine on Windows, but most 
Windows users don't have the tools to install it.  Since you don't have 
any compiled code it's probably not hard to put together a zip file 
equivalent to what R CMD INSTALL --binary would produce on Windows, but 
it's probably easier to use Uwe Ligge's package building service, 
available at http://129.217.207.166. 

Duncan Murdoch
#
On Nov 30, 2009, at 11:10 , Bryan Hanson wrote:

            
You need the *binary* package for windows. If you're lucky, all you  
have to do is to install the package on your Mac and zip it up (the  
*installed* package, not the source!).

So for example
mkdir /tmp/pkg
R CMD INSTALL -l /tmp/pkg ChemoSpec
cd /tmp/pkg
zip -r ChemoSpec_1.0.zip ChemoSpec

If you get unlucky, you have to use a Windows machine (or more  
conveniently Windows in a VirtualBox ;)) to build the binary package.  
(There are ways to cross-compile, but if you have no native code you  
should not need to go there ...).

Cheers,
Simon
#
On Mon, 30 Nov 2009, Duncan Murdoch wrote:

            
I agree with the conclusion (not least as it checks the package works 
on Windows), but in current R (2.10.0) you actually don't need any 
extra tools to install such a source package on Windows.

It's all in the manuals ....

  
    
#
Hello Folks, thanks for the suggestions.  I did what Simon suggested.  And I
did what Ducan suggested, namely to use Uwe's building service.  I think
both of these produced the same set of files (though I don't know how to
check rigorously).  So I moved these two archives, along with my source
archive, over to the Windows machine.  I tried installing all of them via
the GUI dialog boxes, and when that didn't work, I tried doing it from the
command line. 

I'm pretty certain I'm now no longer in the Mac realm :-( and I'm pretty
certain I'm missing something obvious.  It looks like it can't find the
file, but the paths and names look right to me.  If one unstuffs these
manually they look like they have the files.  Any suggestions would be
appreciated.   The transcript from what I did is immediately below.

Thanks, Bryan
*************
Bryan Hanson
Acting Chair
Professor of Chemistry & Biochemistry
DePauw University, Greencastle IN USA
[1] "C:/Documents and Settings/Chemistry 1/Desktop"
[1] "ChemoSpec_1.31-SU.zip" "ChemoSpec_1.31-UL.zip" "ChemoSpec_1.31.tar.gz"
"outcome.txt"   

# the next few steps are attempts at manual installations:
Error in gzfile(file, "r") : cannot open the connection
In addition: Warning message:
In gzfile(file, "r") :
  cannot open compressed file 'ChemoSpec_1.31-SU/DESCRIPTION', probable
reason 'No such file or directory'
"source")
* installing *source* package 'ChemoSpec' ...
** R
** data
** inst
** preparing package for lazy loading
Warning in library(pkg, character.only = TRUE, logical.return = TRUE,
lib.loc = lib.loc) :
  there is no package called 'chemometrics'
Error : package 'chemometrics' could not be loaded
ERROR: lazy loading failed for package 'ChemoSpec'
* removing 'C:/PROGRA~1/R/R-210~1.0/library/ChemoSpec'
* restoring previous 'C:/PROGRA~1/R/R-210~1.0/library/ChemoSpec'
Warning message:
In install.packages(pkgs = "ChemoSpec_1.31.tar.gz", repos = NULL,  :
  installation of package 'ChemoSpec_1.31.tar.gz' had non-zero exit status

# the next few are the attempts with the GUI dialog boxes
Error in gzfile(file, "r") : cannot open the connection
In addition: Warning message:
In gzfile(file, "r") :
  cannot open compressed file 'ChemoSpec_1.31-SU/DESCRIPTION', probable
reason 'No such file or directory'
Error in gzfile(file, "r") : cannot open the connection
In addition: Warning message:
In gzfile(file, "r") :
  cannot open compressed file 'ChemoSpec_1.31-UL/DESCRIPTION', probable
reason 'No such file or directory'
Error in gzfile(file, "r") : cannot open the connection
In addition: Warning messages:
1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file
2: In gzfile(file, "r") :
  cannot open compressed file 'ChemoSpec_1.31.tar.gz/DESCRIPTION', probable
reason 'No such file or directory'
R version 2.10.0 (2009-10-26)
i386-pc-mingw32 

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.10.0

        
On 11/30/09 11:48 AM, "Prof Brian Ripley" <ripley at stats.ox.ac.uk> wrote:

            
#
On 30/11/2009 2:30 PM, Bryan Hanson wrote:
Looks like your DESCRIPTION file was missing in this try.
Looks as through ChemoSpec depends on chemometrics, and you need to 
install that first.  By default Windows will install dependencies when 
it's getting something from CRAN, but not when you're installing a local 
package with repos=NULL.

So you need to install chemometrics first, then this way should work.  
The first one appears to be failing because the .zip file is badly formed.

Duncan Murdoch
#
Bryan,

there are several issues, but let's start with the most hopeful one:
* installing *source* package 'ChemoSpec' ...
** R
** data
** inst
** preparing package for lazy loading
Warning in library(pkg, character.only = TRUE, logical.return = TRUE,
lib.loc = lib.loc) :
  there is no package called 'chemometrics'
Error : package 'chemometrics' could not be loaded
ERROR: lazy loading failed for package 'ChemoSpec'
* removing 'C:/PROGRA~1/R/R-210~1.0/library/ChemoSpec'
* restoring previous 'C:/PROGRA~1/R/R-210~1.0/library/ChemoSpec'

As Brian pointed out you can now install source packages on Windows --  
the only reason it fails is that you are missing dependent packages -  
"chemometrics" in this case. So install all dependencies first and you  
don't have to worry about binary packages - just use the source and  
all will be well.

Then all the other issues are that you're trying to install the binary  
package the wrong way. In fact the easiest way to install is to simply  
unpack in the  "library" directory. The problems you encountered come  
from the name mismatches - the name of the file does really matter and  
your "SU" / "UL" postfix that you added manually is breaking it.  
Please use the original names!

Cheers,
Simon
On Nov 30, 2009, at 14:30 , Bryan Hanson wrote:

            
#
You guys are great!  I understand the nuances between platforms much better
now (the Mac environment does a lot for you in the background, which I had
not given much thought to). Success came with unpacking the .zip file into
the library folder.  Then I still had to install all the dependencies before
my package would "activate", but I'm in business now.  Thanks a bunch to
each of you!  Bryan
On 11/30/09 2:46 PM, "Simon Urbanek" <simon.urbanek at r-project.org> wrote: