Open quinn-r88 opened 2 weeks ago
The issue isn’t with R 3.6 itself but with the fact that it compiles by default with C++11, whereas lidR requires C++14. Previously, this was enforced by explicitly adding the C++14 flag in the Makevars file. However, with the transition to R 4.0, then 4.1, and subsequent versions, CRAN has progressively moved to default C++ standards—first C++11, then C++14, and now C++17. CRAN specifically requested that I remove the explicit C++14 flag from Makevars: https://github.com/r-lidar/lidR/commit/072d031b64295e76fcd2ff5a2f47ae384cd0e262. As a result, without this explicit C++14 specification, it compiles under C++11 with R 3.6. While R 3.6 does support C++14, the recent CRAN policy changes mean that this information is no longer enforced in older R versions.
Yeah, I did see those spec changes. I notice though that other CRAN packages are still able to compile with C++14 or higher, even on old R versions. This article describes using a configure script to the same effect, which CRAN seems to prefer - why they would prefer that over just stating the c++ version I cannot say, but at least it works.
Here's one example of such a script: https://github.com/tidyverse/readxl/pull/722
Or alternatively, you could just change the description to require R 4.0+ or something
Thank you for sharing the link. Can you make a PR ?
Done! Check out #787 when you've got a chance.
Problem
Attempting to install lidR on R 3.6.3 yields the following errors:
Steps to Reproduce
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal-dev libgeos++-dev libudunits2-dev libproj-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libxt-dev libfftw3-dev
terra
package from R-Universe (the CRAN version similarly does not install on R 3.6.3)install.packages('terra', repos='https://rspatial.r-universe.dev')
lidR
packages.install('lidR')
My Setup
Commentary
I know that 3.6.3 is reasonably out of date, however the lidR CRAN package still claims to support R versions as old as 3.5. Ideally a user should not have to look up the history of R's default compiler settings to install a package if it claims to be supported. Would it be possible to either change the CRAN package to report that it only supports R 4+, or else add back the C++ version requirements somewhere, perhaps as described here?
Thanks!