[R] package compilation

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Nov 18 12:09:32 CET 2003


On Tue, 18 Nov 2003, Uwe Ligges wrote:

> 
> 
> On Tue, 18 Nov 2003, Joerg Schaber wrote:
> 
> > I recently wrote a new R package, which I could 'R CMD check' and 'R CMD 
> > build' nicely on my Intel Linux PC. Loading the new library as a normal 
> > user on my PC also works nicely.
> > This packages includes some compiled C-code in a shared library. 
> > However, before submitting the package to CRAN I wanted to install it 
> > also under an other platform in order to check if everything works 
> >  fine. Obviously, in order to install it under another platform I have 
> > to recompile the shared lib. So I added a /src directory in the library 
> > containing the C source code and than run a 'R CMD build'. However, 
> > running 'R CMD INSTALL'  on the resulting tar.gz archive does not 
> > recompile the source code on the new machine. But installing other 
> > packages having a /src directory the source code is recompiled.
> > So what do I have to do that running a 'R CMD install' on my *tar.gz 
> > file recompiles de source code and creates a platform dependend shared lib?
> 
> You have to remove any binaries from that directory, but R CMD build
> should have done it for you. Or does the compilation fails out of other
> reasons? It's hard to guess without any more details.

If you really run R CMD INSTALL foo.tar.gz (note capitals) then foo.tar.gz
is unpacked to a temporary directory and so the .so will be recompiled.

I suspect it find nothing to compile: check carefully what is in the 
foo.tar.gz.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list