2

I installed Haskell on an M1 Mac following the official guide. During the installation, the following message was prompted:

System requirements
  Note: On OS X, in the course of running ghcup you will be given a dialog box to install the command line tools. Accept and the requirements will be installed for you. You will then need to run the command again.
On Darwin M1 you might also need a working llvm installed (e.g. via brew) and have the toolchain exposed in PATH.

I additionally installed LLVM using homebrew:

brew install llvm@12

When trying ...

ghc --make <file>

... I get the following error message:

<no location info>: error:
Warning: Couldn't figure out LLVM version!
         Make sure you have installed LLVM between [9 and 13) 
ghc: could not execute: opt

How can I fix that? Or how can I go about the "have the toolchain exposed in PATH" part of the alert? I'm using ZSH, in case this is of relevance.

4
  • For any sh-compliant shell, assuming brew puts things in the usual places, export PATH="/usr/local/opt/llvm@12/bin:$PATH"? This should be placed in whatever profile file zsh reads if you want to make it permanent. Commented Jun 24, 2022 at 2:00
  • Thank you! Strangely enough, but somehow I found the bin folder of llvm@12 to be located here: /opt/homebrew/Cellar/llvm@12/12.0.1_1/bin. However, it works like that. Is there a better way to link to it, or have I misconfigured homebrew when setting it up? Commented Jun 24, 2022 at 9:40
  • No, that seems fine. The Cellar is where things are supposed to go. Commented Jun 24, 2022 at 11:46
  • Quite literally -- thanks! Commented Jun 25, 2022 at 12:06

1 Answer 1

1

Probably not the best solution, but I got it working by adding /opt/homebrew/Cellar/llvm@12/12.0.1_1/bin to the PATH variable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.