Skip to content
Prev 40773 / 63421 Next

R CMD check --force-multiarch does not install all the archs for testing

Hi Uwe,
On 11-06-29 10:50 AM, Uwe Ligges wrote:
If the package doesn't contain any native code, then trying to compile
the native code for the other arch shouldn't result in a big overhead.
What's the overhead of an if statement like:

   ## add DLL for x64
   if (file.exists("installation_folder/pkgname/libs") &&
       !file.exists("installation_folder/pkgname/libs/x64")) {
       ...
       ## compile and install DLL for x64
       ...
   }
   ## test if installed package can be loaded for x64
   ...

Note that the "add DLL for x64" step is currently doing something
*very* useful, which is to make sure that the package can be loaded for
this arch:

D:\biocbld\bbs-2.9-bioc\meat>..\R\bin\R CMD INSTALL --merge-multiarch 
BSgenome_1.21.3.tar.gz

install for i386

* installing to library 'D:/biocbld/bbs-2.9-bioc/R/library'
* installing *source* package 'BSgenome' ...
** R
** inst
** preparing package for lazy loading

Attaching package: 'IRanges'

The following object(s) are masked from 'package:base':

     Map, cbind, eval, intersect, mapply, order, paste, pmax, pmax.int,
     pmin, pmin.int, rbind, rep.int, setdiff, table, union

** help
*** installing help indices
** building package indices ...
*** tangling vignette sources ...
    'BSgenomeForge.Rnw'
    'GenomeSearching.Rnw'
** testing if installed package can be loaded

add DLL for x64

* installing to library 'D:/biocbld/bbs-2.9-bioc/R/library'
* installing *source* package 'BSgenome' ...
** testing if installed package can be loaded

* DONE (BSgenome)

It's useful even for packages without compiled code since they can
depend on packages that do have compiled code but have been installed
only for 1 arch.

Unfortunately this is something that --force-biarch doesn't do
(it returns success even if compilation for x64 failed).
I want to be able to use the same command for any package.
'R CMD check' looses *a lot* of value if people need to know what's
in a package in order to choose the right command for doing a
multiarch check. I'm not talking about special configuration options
that some packages with compiled code need. I'm talking about the
situation where everything is setup properly so the 2 separate
checks work:

   R --arch i386 CMD check pkg_x.y.z.tar.gz
   R --arch x64 CMD check pkg_x.y.z.tar.gz

but 'R CMD check --force-multi-arch pkg_x.y.z.tar.gz' doesn't because
it fails to install for x64.

So if installing with --merge-multiarch is "almost" the right thing
to do (even though it works for only 100% of the BioC packages and
99.8% of the CRAN packages -- note that this percentage would drop
without using --merge-multiarch), then I do want to use it because
this is the closest I can get to *the* command that works for any
package.

Another reason I want to use it for any package that includes
compiled code, even for packages with a configure.win file, is
because "R automatic bi-arch installation" feature will report
success even if compilation for x64 failed.
For our BioC builds, we are lucky that --merge-multiarch works for all
our software packages. Unfortunately we cannot just use

   R CMD check --install-args="--merge-multiarch"

because 'R CMD check' calls 'R CMD INSTALL --merge-multiarch' on the
*extracted* tarball but --merge-multiarch only works on a *source*
tarball. So we use this long and ugly command (that is basically the
2-step command that you provided earlier in this thread, thanks!):

 
http://bioconductor.org/checkResults/2.9/bioc-LATEST/Biobase/moscato1-checksrc.html

Anyway I still think anybody should be able to run a multiarch check.
Not only the CRAN, or R-forge, or BioC build systems. It should be
easy (1 step command). It should not need any "add-on".

Thanks,
H.