4

I started to learn about Mix IDE and the thing is that, while compiling the Mix IDE, it keeps failing to compile source in the package. So I've done some search and it turns out that I need to use old version llvm. So I installed llvm37 using home-brew and there was no problem while installing it. The only problem is that when I type

clang --version

it keeps returning the following result.

Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Therefore, I need to know how to disable the default LLVM and use the one I installed with Homebrew. Any idea?

Windforces
  • 313
  • 4
  • 12

1 Answers1

4

You have several options:

Modifying PATH

Put Homebrew's binary path before everything else:

export PATH=/usr/local/bin:$PATH

Uninstalling Xcode command line tools

This will remove the command line tools that are delivered along Xcode.

sudo /Developer/Library/uninstall-devtools --mode=all

If you installed the command line tools without Xcode, see this question. Please be aware that Homebrew might depend on some of those tools and may cease to function! I did not test it.

Setting the desired compiler

This is the cleanest solution. Tell the Mix IDE's build system which compiler to use. Since I do not know which build system Mix IDE uses, I cannot tell you how to do that. Some build systems honor the CC, CXX and CPP environment variables, so it may work setting those to the clang binary installed with Homebrew.

Community
  • 1
  • 1
flyx
  • 35,506
  • 7
  • 89
  • 126