[Bioc-devel] Please, minimize your package dependencies (Was: Re: [BioC] Running R without X11?)

Martin Maechler maechler at stat.math.ethz.ch
Sat Sep 6 10:47:49 CEST 2008


>>>>> "HenrikB" == Henrik Bengtsson <hb at stat.berkeley.edu>
>>>>>     on Fri, 5 Sep 2008 17:22:53 -0700 writes:

    HenrikB> Hi,
    HenrikB> the PDPU ("Package Dependency Police Unit") here:

    HenrikB> On Fri, Sep 5, 2008 at 2:37 PM, Amy Johnson <a7johnson at gmail.com> wrote:
    >> Hi, I'm trying to run batch R scripts that is triggered online with PHP code:
    >> 
    >> exec(R --no-save -q < myscript.r > output.txt 2>&1);
    >> 
    >> However, as there are some R libraries, e.g. qvalue, webbioc needs X11
    >> (tcltk) loaded, I got the following errors:
    >> 
    >> Loading Tcl/Tk interface ... Error in dyn.load(file, DLLpath = DLLpath, ...)
    >> :
    >> unable to load shared library
    >> '/usr/local/lib/R/library/tcltk/libs/tcltk.so':
    >> /usr/lib/libXft.so.2: undefined symbol: FT_GlyphSlot_Embolden
    >> Error : .onLoad failed in 'loadNamespace' for 'tcltk'
    >> Error: package/namespace load failed for 'tcltk'
    >> Execution halted
    >> 
    >> I have no problem to run the script on the shell when X11 is lauched. How do
    >> I launch X11 before running R scripts in batch from the web? Is there a way
    >> to avoid loading tcltk when loading R libraries like qvalue and webbioc? As
    >> far as I remember, the old versions of qvalue and webbioc do not require
    >> tcltk.

    HenrikB> First, 'webbioc' does not load 'tcltk' itself, but via 'qvalue'.

    HenrikB> The qvalue package loads tcltk because it is declared in the
    HenrikB> 'Depends:' field of qvalue's DESCRIPTION.  However, looking at what
    HenrikB> qvalue provides, it does not look as if tcltk is a major component,
    HenrikB> but only used in qvalue.gui().  I would recommend the maintainer of
    HenrikB> qvalue (BCC:ed) to move 'tcltk' from the Depends: field to the
    HenrikB> Suggests: field of DESCRIPTION and add:

    HenrikB> require("tcltk") || stop("Package not loaded: tcltk");

    HenrikB> to the top of qvalue.gui().  That way, tcltk will only be loaded if
    HenrikB> really needed.

    HenrikB> The same approach should be used for package dependencies that are
    HenrikB> rarely used.  It also lower the number of packages a user has to
    HenrikB> download and installed.

I very much agree with you, Henrik, about the general principle
(and the Subject line you've chosen).

However, 'tcltk' is a *standard*  R package that never needs to
be installed in a "valid" installation of R,
so I don't see any harm to depend on it.  It's like depending on
'grid', i.e. not a problem.

Martin



More information about the Bioc-devel mailing list