Closed sralchemab closed 1 year ago
Here's some code for reproducibility:
docker pull r-base:4.2.3
docker run -ti --rm r-base:4.2.3 bash
apt-get update && apt-get install -y libtbb-dev # OPTIONAL
R -e "install.packages('RcppParallel')"
Yikes. I can reproduce. Using the bundled TBB I get the warning too.
Now, it does load and all seems fine. So I suspect this may just be a warning coming from (changed?) linker behaviour. Just a guess but maybe the LTO options influence it? Also unclear why we haven't seen it elsewhere. Maybe something the TBB configuration turns on?
Hi @eddelbuettel, I'm not the person using the package, so I wouldn't know how to test it. But do you know whether multi-threading is working when using TBB here? I think I read somewhere that package would install but everything would run single-threaded.
As stated by yourself and repeated by me, the package installs fine. It "merely" emits some new noise at the installation step. That is different from not finding TBB and building a fallback. Please do not spread misinformation or 'fear, uncertainty, doubt'. Maybe ask the person using the package to test it? R CMD check nameOfPackage_*.tar.gz
is universal and good.
Hi Dirk. I'm really sorry for the misunderstanding and that you felt that way from my comment. The least I want to do is to spread fear when I rely on the usage of this package.
I'm in charge of creating a container to run a task that makes use of this package, and though the package gets installed, an error is being thrown. I asked the person running the task if they could check whether the package is working properly, but they told me that this package is just a dependency for some other packages so they don't know how to test this particular feature (the TBB one).
Given the fact that you are one of the developers for this package, I was asking if you would be able to check that the functionality related to the error (anything with TBB) was working fine. That's all. I'm also a software developer and I know that installing and working are different things, and if there are no unit tests that check for a feature, then we wouldn't know if it works until somebody runs it.
Now, following your advice, I ran the check on the package (see log below). However, I can't say from looking at it whether the package has been tested using TBB or not, nor whether a task has been tested both single-threaded and multi-threadedly with this feature.
If you do know how to test this, would you be able to do it for me or at least send me a few lines of code to test it on my own?
Alternatively, would you be able to give me some peace of mind that this error would not have any impact downstream on my jobs?
Thank you very much in advance. I really appreciate the help and sorry again for the trouble.
As I understand it, this is an issue either in R or readelf
:
** checking absolute paths in shared objects and dynamic libraries
readelf: Error: /usr/local/lib/R/site-library/00LOCK-RcppParallel/00new/RcppParallel/lib/libtbb.so: Failed to read file header
readelf: Error: /usr/local/lib/R/site-library/00LOCK-RcppParallel/00new/RcppParallel/lib/libtbbmalloc.so: Failed to read file header
readelf: Error: /usr/local/lib/R/site-library/00LOCK-RcppParallel/00new/RcppParallel/lib/libtbbmalloc_proxy.so: Failed to read file header
R uses readelf
here to try and read file headers when looking for absolute paths; e.g. around here:
If the package does install and work without issue, then I would say you can ignore the warning.
It looks like the issue arises because some of the .so
files that get generated seem to be "special", e.g.
root@d5c28552e95e:/usr/local/lib/R/site-library/RcppParallel/lib# cat libtbbmalloc_proxy.so
INPUT (libtbbmalloc_proxy.so.2)
root@d5c28552e95e:/usr/local/lib/R/site-library/RcppParallel/lib# readelf -d libtbbmalloc_proxy.so
readelf: Error: libtbbmalloc_proxy.so: Failed to read file header
root@d5c28552e95e:/usr/local/lib/R/site-library/RcppParallel/lib# readelf -d libtbbmalloc_proxy.so.2
Dynamic section at offset 0xfdb8 contains 27 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libtbbmalloc.so.2]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000e (SONAME) Library soname: [libtbbmalloc_proxy.so.2]
0x000000000000000c (INIT) 0xe00
0x000000000000000d (FINI) 0x1a10
0x0000000000000019 (INIT_ARRAY) 0x1fda8
0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
0x000000000000001a (FINI_ARRAY) 0x1fdb0
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x1f0
0x0000000000000005 (STRTAB) 0x7a0
0x0000000000000006 (SYMTAB) 0x2d8
0x000000000000000a (STRSZ) 794 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000003 (PLTGOT) 0x1ffe8
0x0000000000000002 (PLTRELSZ) 360 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0xc98
0x0000000000000007 (RELA) 0xb90
0x0000000000000008 (RELASZ) 264 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000006ffffffe (VERNEED) 0xb20
0x000000006fffffff (VERNEEDNUM) 2
0x000000006ffffff0 (VERSYM) 0xaba
0x000000006ffffff9 (RELACOUNT) 3
0x0000000000000000 (NULL) 0x0
I'm assuming this "INPUT (libtbbmalloc_proxy.so.2)" is some sort of special thing that the dynamic linker understands, but readelf does not.
I've filed a bug report for R here: https://bugs.r-project.org/show_bug.cgi?id=18496
Nevermind; the issue here is really that the Docker image does not have file
installed. If you run:
apt update
apt install file
R -e "install.packages('RcppParallel')"
the issue will go away.
Thanks Kevin and Dirk! Error has gone now. Really appreciate the help. Cheers!
Hi there.
I'm getting an error during the installation which doesn't stop the package to be built, but I imagine has an impact on it:
I included at the bottom the full install log. I'm running this on the docker container
r-base:4.2.3
, which is based on Debian bookworm (debian:testing, testing-20230227).I tried installing the package before and after installing the
libbtbb12 / libtbb-dev
packages version2021.8.0-1
(apt-get install libtbb-dev). The output produced by the RcppParallel was exactly the same. I wonder whether it is taking advantage of the pre-installed TBB version or if it always tries to install it on its own.I tried this using Docker v20.10.7 and v20.10.14, on an Ubuntu 20.04.2 and a MacOS 12.6.3 hosts, respectively.
Any help would be really appreciated.
Thanks in advance.