macOS Workarounds (formerly LLVM 10 on macOS with Homebrew)

If you’re using LLVM on macOS with Homebrew, you may want to hold off on updating for a bit. The latest upstream release of LLVM 10.0.1 introduced some linker problems with libxml2, resulting in the build configuration as described by llvm-config advertising limxml2.tbd rather than libxml.

This is a known issue, and is currently being worked on in both the Homebrew and LLVM communities. Current workarounds are:

  • If you have a working LLVM installation you rely upon from Homebrew, don’t update it.
  • If you need to install or update, uninstall LLVM first then install from source using brew reinstall llvm --build-from-source.

If you get the error Failed to detect the version of an installed copy of Xcode, you may need to run the command sudo xcode-select -r to reset your Xcode command line tools path.

I’ll keep my eyes on this issue and update the thread when the packaging is fixed upstream.

-Chris

2 Likes

You can also try to download the LLLVM 10.0.0 from https://releases.llvm.org/download.html and point the llvm-config to the path of llvm config of the downloaded package.

1 Like

Thanks for the valuable information!

Personally I also recommend clangdev/llvmdev from conda-forge (conda install -c conda-forge clangdev), which handles dependency more carefully.

2 Likes

The latest version of XCode ships with a Python binary that is incompatible with the psutil requirement for TVM. The issue is described here. If you’re running into this issue the recommendation is to install python3 from another source (such as Homebrew) and set it as the default in your path.

1 Like

Wow, it is hard to imagine psutil is broken with xcode’s python, after all it is used pretty widely. Thanks for the valuable inputs!

Homebrew has updated their LLVM version to 11.0. This includes a fix for the libxml linker error, so you will no longer need to build the package from source if you’re using that as your package manager.

2 Likes

I have update the llvm version to 11.0, the linker problems with libxml2 it still there

It works. LLVM Download Page LLVM 11.0.0 mac don’t work. if you download from the releases and tar, it doesn’t work. but: brew install llvm set(USE_LLVM /usr/local/Cellar/llvm/11.1.0/bin/llvm-config) works

3 Likes

wow,it works for me.thx

1 Like