[R-SIG-Mac] Installing packages from source for all installed sub-architectures

Hervé Pagès hpages at fhcrc.org
Tue Mar 6 07:11:25 CET 2012

Hi Simon, Dan,

On 03/05/2012 05:24 PM, Simon Urbanek wrote:
> Dan,
> On Mar 5, 2012, at 7:09 PM, Dan Tenenbaum wrote:
>> Hello,
>> Are there plans to modify install.packages() on Mac so that if
>> type="source", the package is installed for all installed
>> sub-architectures?
>> This works for Windows.
>> Currently,
>> install.packages("mypkg", type="source")
>> **may** do the right thing, depending on what type of native code the
>> package has, whether if has a configure script., etc, but there's no
>> guarantee.
> The same is true for Windows - to my best knowledge the rules are the same on all platforms -- Makefile or configure prevent a package from being built for more than one architecture, because they may modify the sources in-place and thus the package can only be built once. The only difference I'm aware of is that some Windows packages use configure.win for things other than configuration, so binary maintainers may choose to ignore those but that is not the default AFAIK.

But OTOH, section 5.4 of the "R for Mac OS X FAQ" says:

   Once all tools are in place it is considerably easy to build an
   universal binary. If the package does not contain a configure script
   then a regular package installation using either install.packages or
   R CMD INSTALL automatically creates an universal binary. If the
   package contains a configure script then it cannot be compiled
   in-place for multiple platforms, and the following process should be
   used. Assuming that you have a source package called foo_1.0.tar.gz
   that uses a configure script, it can be installed universally using
   the following three-step process:

      # full 32-bitIntel install
      R --arch=i386 CMD INSTALL foo_1.0.tar.gz
      # 64-bit Intel library
      R --arch=x86_64 CMD INSTALL --libs-only foo_1.0.tar.gz
      # 32-bit PowerPC library (will require Rosetta to build)
      R --arch=ppc CMD INSTALL --libs-only foo_1.0.tar.gz

So the question is: why can't R CMD INSTALL just do this? I can deal
with the 3 above steps for a single package (assuming I have access
to the shell). But in general I like to be able to install packages
from R because typically the package I install requires a lot of
dependencies and install.packages() will solve the dependency problem
for me. Unfortunately, using the above trick in that context is a

Couldn't R CMD INSTALL --merge-multiarch be supported on Mac and do
something like the 3 steps above? That would be a first step towards
a little bit more convenience as I would be able to do

   install.packages("foo", INSTALL_opts="--merge-multiarch")


> Cheers,
> Simon
>> I might add that even installing a binary is not guaranteed to give
>> you .so files for all sub-architectures. CRAN and Bioconductor create
>> multi-arch binaries, but other package distributors may not do this,
>> in fact, they likely won't, since the procedure for generating such
>> binaries is not part of R and is therefore not documented as such.
>> There are of course ways to work around this. But it would be nice not
>> to have to work around it, and it would be very nice if a single
>> command could install a package (and, importantly, all its
>> dependencies) from source for all available architectures.
>> Thanks!
>> Dan
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319

More information about the R-SIG-Mac mailing list