Need to update gcc: Will installed packages break?

Related to Installing ‘rstan' on CentOS7? the version of gcc is 4.8.5 does not seem to support CXX14.

However, I am interested in the after effects of upgrading gcc. We have Rstudio Server Pro environment on RHEL 7.7 Linux servers. Our current version of gcc is:

gcc -v
gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

In order to install tidymodels and rstan, we need to update gcc.

If we do this, will any installed packages stop working?

If so, what do I need to ask my users to do?

I was in the same situation with one of my clients. Since this was during the server set-up, we opted for the "play-it-safe" solution:

  • compile a new compiler
  • compile R with the new compiler
  • compile some external libraries with the new compiler (e.g. QuantLib and poppler)
  • install required R packages system wide using the new compiler

For an in-use system, the next step would be re-installation of all (compiled) packages in the user libraries.

I am not sure if one has to use this "play-it-safe" approach. I do not expect any immediate breakages after updating the compiler. However, some strange problems might come down the road, e.g.:

  • You have poppler installed (either from EPEL or compiled with the old compiler) and users have installed pdftools.
  • You upgrade the compiler.
  • A new user tries to install pdftools or an existing user tries to update it.

From my experience this last step will fail. And since this might be long after the compiler upgrade, it can be difficult to come to the right solution, i.e. compile poppler with the new compiler.

BTW, at that time we also considered a workaround: Configure CXX14STD to use -std=gnu++1y, which would give partial C++14 support. IIRC it was possible to install rstan that way, but it was deemed as not safe enough in the long run.