Skip to content

[R-pkg-devel] Is it a wrong assumption that ${R_HOME}/lib always exists?

3 messages · Martin Maechler, Hiroaki Yutani

#
Hi,

My package, string2path, using Rust fails on the CRAN check of MKL [1],
with an error that seems irrelevant to MKL. The error says:
Os { code: 2, kind: NotFound, message: "No such file or directory" }',
/data/gannet/ripley/R/packages/tests-MKL/string2path/src/rust/vendor/libR-sys/build.rs:637
:40

The line 637 of build.rs of libR-sys crate is here [2]:

    r_paths.library.canonicalize().unwrap().display()

Compared to the previous version, which didn't experience such a failure,
.canonicalize() was added, and it seems this is the cause. This method
normalizes the path expression like R's normalizePath(), and it fails
because the path specified didn't exist.

libR-sys assumes the path to R's shared libraries is `${R_HOME}/lib` on
Unix-alike platforms. Is it possible that this path doesn't exist on the
MKL server? Actually, it compiles fine on the other Linux platforms, so I'm
wondering what's different there from the other servers.

Best,
Yutani

[1]: https://cran.r-project.org/web/checks/check_results_string2path.html
[2]: https://github.com/extendr/libR-sys/blob/v0.5.0/build.rs#L637C1-L637C58
#
[...............]

Short answer to your questsion (from the 'Subject') is :    NO !
For an example, see below:

    > libR-sys assumes the path to R's shared libraries is
    > `${R_HOME}/lib` on Unix-alike platforms.

In some configurations, R does not need *any* shared libraries,
and there,  $R_HOME/lib  does *not* exist.

E.g., I have one of my R-devel versions installed (on Fedora
Linux) with

        ../R/configure --with-blas=-lflexiblas 

using the nice, currently Fedora/Redhat-only "flexiblas"
approach, with which I can nicely switch the versions of BLAS
and Lapack libraries that R works with from within R.

As that version of R is not "shared", i.e., no libR.so , *and*
gets both its BLAS and Lapack libraries from "external" (not
from R), there's no need for a ./lib/  and so none is created.

Martin Maechler
ETH Zurich  and  R Core Team


    > Is it possible
    > that this path doesn't exist on the MKL server? 

    > Actually, it compiles fine on the other Linux platforms,
    > so I'm wondering what's different there from the other
    > servers.


    > Best, Yutani
    > 	[[alternative HTML version deleted]]
#
Thanks so much for the quick response. It answered everything!
It was my mistake that I didn't consider these types of installations.
I'll fix my package as soon as I can.

Best,
Yutani

2023?7?10?(?) 17:51 Martin Maechler <maechler at stat.math.ethz.ch>: