Skip to content

[R-pkg-devel] R CMD INSTALL -l /path/lib

5 messages · Gábor Csárdi, Dirk Eddelbuettel, Iñaki Ucar +1 more

#
If a user is using this command to install my package,

R CMD INSTALL -l /path/lib  package_r.tar.gz


How can I get the lib value within the configure file?


--Sameh
#
variables: R_PACKAGE_NAME (the name of the package), R_PACKAGE_SOURCE (the
path to the source directory of the package), R_PACKAGE_DIR (the path of
the target installation directory of the package), R_ARCH (the
arch-dependent part of the path, often empty), SHLIB_EXT (the extension of
shared objects) and WINDOWS (TRUE on Windows, FALSE elsewhere).

This is for `install.libs.R`, but AFAIR it is also true for `configure`. So
you need the `R_PACKAGE_DIR` env var.

Gabor

On Wed, Aug 19, 2020 at 12:03 PM Sameh M. Abdulah <
sameh.abdulah at kaust.edu.sa> wrote:

            

  
  
#
On 19 August 2020 at 13:01, G?bor Cs?rdi wrote:
| >From https://cran.r-project.org/doc/manuals/R-exts.html:
| 
| > The script is run in a separate R environment containing the following
| variables: R_PACKAGE_NAME (the name of the package), R_PACKAGE_SOURCE (the
| path to the source directory of the package), R_PACKAGE_DIR (the path of
| the target installation directory of the package), R_ARCH (the
| arch-dependent part of the path, often empty), SHLIB_EXT (the extension of
| shared objects) and WINDOWS (TRUE on Windows, FALSE elsewhere).
| 
| This is for `install.libs.R`, but AFAIR it is also true for `configure`. So
| you need the `R_PACKAGE_DIR` env var.

Nice. An alternate approach I have used is to call

    $(R_HOME)/bin/Rscript -e 'cat(.libPaths()[1])'

from configure but Gabor's approach saves a process.

Dirk
#
On Wed, 19 Aug 2020 at 14:02, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote:
But R_PACKAGE_DIR contains the temporary path for staged
installations. Instead, I think R_LIBRARY_DIR is the desired path.

  
    
#
Many Thanks Gabor! It works with me.

?Sameh
On Aug 19, 2020, at 6:44 PM, I?aki Ucar <iucar at fedoraproject.org> wrote: