Home > database >  How to change Clang version(or InstalledDir) on MacOS?
How to change Clang version(or InstalledDir) on MacOS?

Time:10-19

On MacOS terminal, when I run this command:

$ which clang

I got:

clang version 10.0.0
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Users/myusername/anaconda3/bin

But,I have another clang version on my Mac, the directory is:

/Library/Developer/CommandLineTools/usr/bin/clang

So, how to change my current clang directory (/Users/myusername/anaconda3/bin) to a new clang directory (/Library/Developer/CommandLineTools/usr/bin/clang)?

and I am wondering that why my clang is defaulted to install in Anaconda?

CodePudding user response:

You should install the brew command on macOS. https://brew.sh/

It's better to use it to install clang because the command line tools version of clang's outdated.

CodePudding user response:

export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH should work. You could add it to your run config file, whichever shell you're using.

  • Related