adaR icon indicating copy to clipboard operation
adaR copied to clipboard

Doesn't compile on Ubuntu 18.04

Open cbpuschmann opened this issue 9 months ago • 4 comments

Hi, when compiling on Ubuntu (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0) I unfortunately get

In file included from ada/ada.cpp:3:0, from adaR.h:5, from adaR.cpp:1: ada/ada.h:5067:10: fatal error: charconv: No such file or directory #include <charconv> ^~~~~~~~~~ compilation terminated. make: *** [/usr/lib/R/etc/Makeconf:200: adaR.o] Error 1 ERROR: compilation failed for package ‘adaR’

cbpuschmann avatar Apr 29 '24 12:04 cbpuschmann

@cbpuschmann Could you please check the exact version of Ubuntu?

lsb_release -a 
R --version

(We have only tested it on Ubuntu 22.04 LTS on CI and locally. But if you are really using 18.04, we can have a look.)

chainsawriot avatar Apr 29 '24 12:04 chainsawriot

Thanks

cpuschmann@rstudio:~/poltrack$ lsb_release -a LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch Distributor ID: Ubuntu Description: Ubuntu 18.04.6 LTS Release: 18.04 Codename: bionic

cpuschmann@rstudio:~/poltrack$ R --version R version 4.3.3 (2024-02-29) -- "Angel Food Cake" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

cbpuschmann avatar Apr 29 '24 13:04 cbpuschmann

@cbpuschmann I have tried with Docker and Ubuntu 18.04 (docker run -ti --entrypoint bash ubuntu:bionic-20221130).

The quick answer is that the underlying C++ library ada requires the header file

https://github.com/gesistsa/adaR/blob/3e62518c591baddd95448d3253d44e804e36c4cb/src/ada/ada.h#L5067

and this standard header is only available since GCC 8.1, whereas 18.04's default repository can only provide GCC 7.5.0 via build-essential. Actually, GCC 8 is available in the main Ubuntu repo of 18.04. If you are determined enough to update your GCC:

sudo apt install gcc-8 g++-8 make
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
## check
sudo update-alternatives --config gcc
gcc --version

At least on this clean slate Ubuntu 18.04, I can compile adaR successfully.

If you are even more determined, please also consider updating your Ubuntu to at least 20.04 LTS. 18.04's official support ended last year in June (unless you pay). CRAN is now check R packages with GCC >12, which is only available since Ubuntu 22.04.

chainsawriot avatar Apr 29 '24 14:04 chainsawriot

Thank you! I will look into updating Ubuntu. It's an RStudio Server instance provided by the university, so I sadly need admin approval to do it.

cbpuschmann avatar Apr 29 '24 14:04 cbpuschmann