Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22238

Switch GCC version with HomeBrew

$
0
0

I have used brew to install gcc9 (gcc@9), but the default gccversion is still the old one:

$ gcc --version
gcc (Homebrew GCC 5.5.0_7) 5.5.0

When I look into Homebrew/bin, I find:

c++ -> g++
c++-5 -> ../Cellar/gcc/5.5.0_7/bin/c++-5
c++-9 -> ../Cellar/gcc@9/9.2.0_1/bin/c++-9
cc -> gcc
g++ -> ../Cellar/gcc/5.5.0_7/bin/g++
g++-5 -> ../Cellar/gcc/5.5.0_7/bin/g++-5
g++-9 -> ../Cellar/gcc@9/9.2.0_1/bin/g++-9
gcc -> ../Cellar/gcc/5.5.0_7/bin/gcc
gcc-5 -> ../Cellar/gcc/5.5.0_7/bin/gcc-5
gcc-9 -> ../Cellar/gcc@9/9.2.0_1/bin/gcc-9

So for homebrew the default version is still 5.5. I tried to use switch, but gcc@9is not considered as a gcc formula:

$ brew switch gcc gcc@9
Error: gcc does not have a version "gcc@9" in the Cellar.
gcc's installed versions: 5.5.0_7

I could modify manually all the links in Homebrew/bin, but I bet that homebrew is not going to like it.

Is there a better solution? Knowing that I work on a cluster and I DO NOT HAVE the admin rights.


Viewing all articles
Browse latest Browse all 22238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>