[Bioc-devel] Suppressing messages from Rprofile

Henrik Bengtsson henr|k@bengt@@on @end|ng |rom gm@||@com
Wed Apr 7 22:20:14 CEST 2021


Can you go via a temporary file instead, i.e. output what you want to
grab to a temporary file and pull the info from that instead?

Side tracking ...

> I thought about using --vanilla but I use .Rprofile to set my library path,
> so ignoring that file completely defeats the point in my setup.

I'm a proponent of customizing the library path via .Renviron instead
of via .Rprofile.  In your case, you can have a line in ~/.Renviron
with:

  R_USER_LIBS=~/R/%p-library/%v-bioc_3.12

Alternatively, you can set it elsewhere, e.g. ~/.bashrc, in a Linux
environment module that is loaded, and so on.

BTW, using Rscript --no-init-file ... would skip .Rprofile while still
parsing .Renviron.

/Henrik

On Wed, Apr 7, 2021 at 8:16 AM Mike Smith <grimbough using gmail.com> wrote:
>
> I have the following line in the configure.ac for rhdf5filters, which
> returns the location of the HDF5 headers distributed with Rhdf5lib:
>
> RHDF5_INCLUDE=`"${R_HOME}/bin${R_ARCH_BIN}/Rscript" -e
> 'cat(system.file("include", package="Rhdf5lib"))'`
>
> For me the output is a path like
>  /mnt/data/R-lib/4.0.3-bioc_3.12/Rhdf5lib/include, which gets inserted into
> the package Makevars file, and the package compilation works.
>
> However I've had multiple reports (
> https://github.com/grimbough/rhdf5filters/issues/11) where this doesn't
> work, all of which seem to relate to messages printed when an Rprofile is
> loaded.  They have well intentioned messages like below, which don't work
> so well when passed as compiler flags
>
> [1] "[BMRC] You have sourced the BMRC Rprofile provided at
> /apps/misc/R/bmrc-r-user-tools/Rprofile"
> [1] "[BMRC] Messages coming from this file (like this one) will be
> prefixed with [BMRC]"
> [1] "[BMRC] You are running R on host <rescomp3.hpc.in.bmrc.ox.ac.uk>
> with CPU <Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz>"
> [1] "[BMRC] While running on this host, local R packages will be
> sourced from and installed to
> /well/combat/users/ifl143/R/4.0/ivybridge"
> /gpfs3/well/combat/users/ifl143/R/4.0/ivybridge/Rhdf5lib/include
>
> I thought about using --vanilla but I use .Rprofile to set my library path,
> so ignoring that file completely defeats the point in my setup.  Is anyone
> aware of either a more reliable way of getting the information I want
> (maybe suppressing messages, different mechanism entirely, etc)?
> Alternatively, is there anything definitive in WRE or the like that
> suggests printing messages Rprofile is a bad idea that I can pass on to the
> users?
>
> Cheers,
> Mike
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list