qs binary package for R 4.3 and RHEL-9 is missing

It module compiles fine under RHEL-9 so it looks like an bug in in the infrastructure of posit.
OS packages needed for build: lz4-devel, libzstd-devel, libatomic.
Testes using R 4.3.3 and qs 0.26.1 on x86_64

The list of necessary system dependencies is interesting, since those are not mentioned in the DESCRIPTION file of qs. Package Manager determines the system requirements for building binaries directly from those requirements. Could you please file an issue with the qs developers to fix their package?

Hi @rstub,
here are the link for the report to the developers.:

Hello, qs does not require zstd or lz4 system libraries. If system libraries do not exist, the configure script compiles zstd and lz4 bundled in the package.

For libatomic, it is part of the C++ standard library: The GNU C++ Library

Therefore, I am under the impression it does not need to be declared as a req (since no package declares the STL as a system req).

However, that is just my understanding and if someone could help me understand I am happy to fix it if necessary.

I have tried to install qs on a Rocky Linux 9 system (Docker image rstudio/r-base:4.3.3-rockylinux9) and that fails like this:

* installing *source* package ā€˜qsā€™ ...
** package ā€˜qsā€™ successfully unpacked and MD5 sums checked
** using staged installation
checking for pkg-config... /usr/bin/pkg-config
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++17 accepts -g... yes
C++ compiler: g++ -std=gnu++17
checking for C++ compiler vendor... gnu
zstd library not detected -- compiling from source
lz4 library not detected -- compiling from source
configure: creating ./config.status
config.status: creating src/Makevars
** libs
using C++ compiler: ā€˜g++ (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2)ā€™
g++ -std=gnu++17 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -DRCPP_USE_UNWIND_PROTECT -DRCPP_NO_RTTI -DRCPP_NO_SUGAR -I. -IZSTD -IZSTD/common -IZSTD/decompress -IZSTD/compress -ILZ4  -I'/opt/R/4.3.3/lib/R/library/Rcpp/include' -I'/opt/R/4.3.3/lib/R/library/RApiSerialize/include' -I'/opt/R/4.3.3/lib/R/library/stringfish/include' -I'/opt/R/4.3.3/lib/R/library/BH/include' -I/usr/local/include    -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++17 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -DRCPP_USE_UNWIND_PROTECT -DRCPP_NO_RTTI -DRCPP_NO_SUGAR -I. -IZSTD -IZSTD/common -IZSTD/decompress -IZSTD/compress -ILZ4  -I'/opt/R/4.3.3/lib/R/library/Rcpp/include' -I'/opt/R/4.3.3/lib/R/library/RApiSerialize/include' -I'/opt/R/4.3.3/lib/R/library/stringfish/include' -I'/opt/R/4.3.3/lib/R/library/BH/include' -I/usr/local/include    -fpic  -g -O2  -c qs_functions.cpp -o qs_functions.o
gcc -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -DRCPP_USE_UNWIND_PROTECT -DRCPP_NO_RTTI -DRCPP_NO_SUGAR -I. -IZSTD -IZSTD/common -IZSTD/decompress -IZSTD/compress -ILZ4  -I'/opt/R/4.3.3/lib/R/library/Rcpp/include' -I'/opt/R/4.3.3/lib/R/library/RApiSerialize/include' -I'/opt/R/4.3.3/lib/R/library/stringfish/include' -I'/opt/R/4.3.3/lib/R/library/BH/include' -I/usr/local/include    -fpic  -g -O2  -c ZSTD/zstd.c -o ZSTD/zstd.o
ar rcs libQSZSTD.a ZSTD/zstd.o
g++ -std=gnu++17 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -DRCPP_USE_UNWIND_PROTECT -DRCPP_NO_RTTI -DRCPP_NO_SUGAR -I. -IZSTD -IZSTD/common -IZSTD/decompress -IZSTD/compress -ILZ4  -I'/opt/R/4.3.3/lib/R/library/Rcpp/include' -I'/opt/R/4.3.3/lib/R/library/RApiSerialize/include' -I'/opt/R/4.3.3/lib/R/library/stringfish/include' -I'/opt/R/4.3.3/lib/R/library/BH/include' -I/usr/local/include    -fpic  -g -O2  -c LZ4/lz4.cpp -o LZ4/lz4.o
g++ -std=gnu++17 -I"/opt/R/4.3.3/lib/R/include" -DNDEBUG -DRCPP_USE_UNWIND_PROTECT -DRCPP_NO_RTTI -DRCPP_NO_SUGAR -I. -IZSTD -IZSTD/common -IZSTD/decompress -IZSTD/compress -ILZ4  -I'/opt/R/4.3.3/lib/R/library/Rcpp/include' -I'/opt/R/4.3.3/lib/R/library/RApiSerialize/include' -I'/opt/R/4.3.3/lib/R/library/stringfish/include' -I'/opt/R/4.3.3/lib/R/library/BH/include' -I/usr/local/include    -fpic  -g -O2  -c LZ4/lz4hc.cpp -o LZ4/lz4hc.o
ar rcs libQSLZ4.a LZ4/lz4.o LZ4/lz4hc.o
g++ -std=gnu++17 -shared -L/opt/R/4.3.3/lib/R/lib -L/usr/local/lib -o qs.so RcppExports.o qs_functions.o -L. -lpthread -latomic -lQSZSTD -lQSLZ4 -L/opt/R/4.3.3/lib/R/lib -lR
/usr/bin/ld: cannot find /usr/lib64/libatomic.so.1.2.0
collect2: error: ld returned 1 exit status
make: *** [/opt/R/4.3.3/lib/R/share/make/shlib.mk:10: qs.so] Error 1
ERROR: compilation failed for package ā€˜qsā€™
* removing ā€˜/opt/R/4.3.3/lib/R/library/qsā€™

It does work after dnf install libatomic. Interestingly, no such problem exists on Debian/Ubuntu, because libgcc-<version>-dev depends on libatomic. Consequently there are binary packages of qs for these OSs at Posit Package Manager.

What is interesting is that other packages such as later also include the atomic header but check if linking with -latomic is actually needed. On Rock Linux 9 this is not the case and consequently it builds even without libatomic being installed. As a test I have removed the relevant lines that add -latomic from your configure and that installed without problems.

It looks like instead of adding SystemRequirements you should check in your configure if -latomic is actually needed. Your current check that all GCC versions need it seems to be to broad.

Hi Ralf, thanks. I followed the example in later and added a check to see if the -latomic flag is necessary.

Compiles on rstudio/r-base:4.3.3-rockylinux9

1 Like