Where is the gcc library link stored in Rstudio

I am working with a Rstudio installed on a Centos server. The default gcc is version 4.4.7 but the lubridate package needs a higher version. I now have one installed but Rstudio still is pointing to the old one. When I run

system2("gcc", "--version") in the console I get

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)

But when I runR in the Rstudio terminal and then enter the system2 code I get

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

How do I change the gcc that Rstudio uses when it compiles packages?

have you checked the preferred version at system level?

sudo update-alternatives --config gcc

I don’t understand this code. And when I run it at the prompt I don’t get any output.

But here’s some info

[gnelson@ip-172-31-42-134 ~]$ which gcc


[gnelson@ip-172-31-42-134 ~]$ gcc --version

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

Yeah sorry that command was for Ubuntu, I think this is for red hat /usr/sbin/alternatives --config gcc

I still don't get any output from that command. What is it supposed to do?

The solution I found was to change the contents of the PATH variable in Rstudio. I made it the same as the system PATH variable.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.