Understanding Compiler Version Impact on Building R and R Packages

41 views Asked by At

I am currently performing local testing based on rhub images, which requires to install R packages (and other dependencies) from source. I’ve noticed that the compiler versions used in the rhub images are not the same as those used on CRAN.

Specifically, the r-hub/fedora-clang-devel image uses (as of today) GNU Fortran (GCC) 12.2.1 and clang version 14.0.5, while the CRAN flavour r-devel-linux-x86_64-fedora-clang uses GNU Fortran 13.2 and clang version 16.0.6.

I am trying to understand the potential impact of this difference. Could someone provide some background or explanation on the following:

  1. What are the potential effects of using different compiler versions for building R and installing R packages? In general but also specifically for package testing that include source code.

  2. Is it necessary to match the compiler versions exactly when building R and installing packages? I understand that it is possible to change the defaults used to install R packages from source by changing ~/.R/Makevars, but I don't understand the exact effect this has on the behaviour of the R packages with source code and on other (compiled), non-R dependencies.

  3. What are the risks or issues that might arise if I update the compiler of the rhub image and install my packages (and their dependencies) with this new compiler version?

I am aware that different compiler versions can lead to performance differences and compatibility issues, but I would like to understand this in more depth.

Any insights or explanations would be greatly appreciated.

0

There are 0 answers