[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Rhdf5 issue

Hi Dirk,

thanks for this hint.

On Fri, Apr 26, 2019 at 11:29:41AM -0500, Dirk Eddelbuettel wrote:
> | $ echo 'Rhdf5lib::pkgconfig("PKG_CXX_LIBS")'| R --vanilla --slave
> | Error in system.file("lib", package = "Rhdf5lib", mustWork = TRUE) : 
> |   no file found
> | Calls: <Anonymous> -> Sys.getenv -> system.file
> | Execution halted
> Something is not right. From
>   https://github.com/grimbough/Rhdf5lib/blob/master/R/zzz.R#L15-L18
> we have
>   pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS")) {
>       path <- Sys.getenv(
>           x = "RHDF5LIB_RPATH",
>           unset = system.file("lib", package="Rhdf5lib", mustWork=TRUE)
>       )
>       #... more stuff omitted ...
> So if the env.var is missing (as in your case) it assumes it has
> a "lib" directory installed in the package.  > I read this as the
> package maintainer/author assuming the package would always
> install with a lib dir.  Does it?  I see no `inst/dir` in the
> sources.

I suspect there might be some tricks upstream of Rhdf5lib is doing since
the original tarball contains hdf5small_cxx_1.10.3.tar.gz which is
unpackaged, build and installed in configure.  This was replaced by
the Debian packaged libhdf5 and thus the hdf5 library might reside in
some "unexpected" path.
> You could bypass the issue for now, it seems, by setting the
> variable it wants to use: RHDF5LIB_RPATH.

Since I'm not fully sure to what value setting RHDF5LIB_RPATH I
tried a different approach in src/Makevars:

HDF5_LIB="/usr/lib/`dpkg-architecture -qDEB_BUILD_GNU_TYPE`/hdf5/serial/"
PKG_LIBS=-L/usr/lib/R/site-library/Rhdf5lib/libs -lRhdf5lib -L$(HDF5_LIB) -lhdf5

(see https://salsa.debian.org/r-pkg-team/r-bioc-rhdf5/commit/49dea77def56c8222e3b1bd3913aa4a5e850e93f)

Strangely enough the build is ending in

g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-z,relro -o rhdf5.so H5.o H5A.o H5D.o H5E.o H5F.o H5G.o H5I.o H5L.o H5O.o H5P.o H5S.o H5T.o H5constants.o HandleList.o HandleListWrap.o h5dump.o h5ls.o h5testLock.o h5writeDataFrame.o printdatatype.o wrap.o -L/usr/lib/R/site-library/Rhdf5lib/libs -lRhdf5lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ -lhdf5 -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lRhdf5lib
collect2: error: ld returned 1 exit status

However, when I check inside the pbuilder environment:

root:/# ldd /usr/lib/R/site-library/Rhdf5lib/libs/Rhdf5lib.so 
        linux-vdso.so.1 (0x00007ffe93b80000)
        /usr/lib/cowdancer/libcowdancer.so (0x00007f9bd426f000)
        libhdf5_serial.so.103 => /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.103 (0x00007f9bd3ee3000)
        libsz.so.2 => /usr/lib/x86_64-linux-gnu/libsz.so.2 (0x00007f9bd3ce0000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9bd3ac2000)
        libR.so => /usr/lib/libR.so (0x00007f9bd3636000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9bd3475000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9bd346e000)
        libncurses.so.6 => /lib/x86_64-linux-gnu/libncurses.so.6 (0x00007f9bd3445000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f9bd3417000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9bd33f6000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9bd3273000)
        libaec.so.0 => /usr/lib/x86_64-linux-gnu/libaec.so.0 (0x00007f9bd306b000)
        libblas.so.3 => /usr/lib/x86_64-linux-gnu/libblas.so.3 (0x00007f9bd2ffc000)
        libgfortran.so.5 => /usr/lib/x86_64-linux-gnu/libgfortran.so.5 (0x00007f9bd2d8e000)
        libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f9bd2d4c000)
        libreadline.so.7 => /lib/x86_64-linux-gnu/libreadline.so.7 (0x00007f9bd2aff000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9bd2a8b000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f9bd2a63000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f9bd2a4e000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9bd2a44000)
        libicuuc.so.63 => /usr/lib/x86_64-linux-gnu/libicuuc.so.63 (0x00007f9bd2875000)
        libicui18n.so.63 => /usr/lib/x86_64-linux-gnu/libicui18n.so.63 (0x00007f9bd259a000)
        libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f9bd2569000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9bd427f000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9bd254d000)
        libicudata.so.63 => /usr/lib/x86_64-linux-gnu/libicudata.so.63 (0x00007f9bd0b5d000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9bd09d9000)

the library obviously exists and seems to be pretty functional.  So
why am I getting "cannot find -lRhdf5lib"?

Kind regards



Reply to: