'M1 Mac how to install llvm

I have done everything possible to install eo-learn but it is not working using Conda won't work closest I got to making it work was with pip but I get stuck while trying to install numba

steps taken

brew install llvm

export LLVM_CONFIG=/opt/homebrew/opt/llvm/bin/llvm-config

LLVM_CONFIG=/opt/homebrew/opt/llvm/bin/llvm-config pip install numba

LLVM_CONFIG=/opt/homebrew/opt/llvm/bin/llvm-config pip install llvmlite which is the major dependency breaking for now

brew link llvm 
Warning: Refusing to link macOS provided/shadowed software: llvm
If you need to have llvm first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"

I have added the flags

brew link -force llvm
Warning: Refusing to link macOS provided/shadowed software: llvm
If you need to have llvm first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"

I have done everything I know someone please help me

can some tell me how I can get the installer to recognise it



Solution 1:[1]

I was able to install llvmlite on my m1 with the following steps:

arch -arm64 brew install llvm@11
LLVM_CONFIG="/opt/homebrew/Cellar/llvm@11/11.1.0_4/bin/llvm-config" arch -arm64 pip install llvmlite

It's important to:

  • specify version 11 of llvm (or check if higher llvm version still compatible with your llvmlite).
  • make sure you're installing both with the same arch arm64.
  • make sure your LLVM_CONFIG value is correct for your system (in my case it's under **/11.1.0_4/) you may have a newer version or even in completly different PATH.

Solution 2:[2]

Check out this link. https://embeddedartistry.com/blog/2017/02/24/installing-llvm-clang-on-osx/

Adding Homebrew llvm/clang to path worked for me.

echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dhia
Solution 2 Dharman