Trouble installing Tidal library - MacOS Big Sur (Failed to build... Warning: Couldn't figure out LLVM version...)

Hallo,

I've been battling for two hours now trying to get Tidal to work on my M1 Mac (Big Sur).

I've tried installing via stack, I've gone through the Troubleshooting in the docs, read through the forums... to no avail.

When installing via cabal I get the following error messages, mainly about things failing to build and not figuring out LLVM versions.

Any help would be very much appreciated!

Failed to build blaze-builder-0.4.2.1.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/blz-bldr-0.4.2.1-1bd7ec40.log
):
Configuring library for blaze-builder-0.4.2.1..
Preprocessing library for blaze-builder-0.4.2.1..
Building library for blaze-builder-0.4.2.1..

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

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

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

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

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[ 1 of 11] Compiling Blaze.ByteString.Builder.Internal.Write ( Blaze/ByteString/Builder/Internal/Write.hs, dist/build/Blaze/ByteString/Builder/Internal/Write.o, dist/build/Blaze/ByteString/Builder/Internal/Write.dyn_o )

Blaze/ByteString/Builder/Internal/Write.hs:57:1: warning: [-Wunused-imports]
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()
   |
57 | import Data.Monoid (Monoid(..))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<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

Failed to build base-orphans-0.8.5.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/bs-rphns-0.8.5-9350ba43.log ):
Configuring library for base-orphans-0.8.5..
Preprocessing library for base-orphans-0.8.5..
Building library for base-orphans-0.8.5..

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

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[1 of 2] Compiling Data.Orphans.Prelude ( src/Data/Orphans/Prelude.hs, dist/build/Data/Orphans/Prelude.o, dist/build/Data/Orphans/Prelude.dyn_o )

<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

Failed to build clock-0.8.2.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/clck-0.8.2-5700beeb.log ):
Configuring library for clock-0.8.2..
Preprocessing library for clock-0.8.2..
Building library for clock-0.8.2..
[1 of 1] Compiling System.Clock     ( dist/build/System/Clock.hs, dist/build/System/Clock.o, dist/build/System/Clock.dyn_o )

<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

Failed to build colour-2.3.6.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/clr-2.3.6-eb6910a5.log ):
Configuring library for colour-2.3.6..
Preprocessing library for colour-2.3.6..
Building library for colour-2.3.6..
[ 1 of 14] Compiling Data.Colour.CIE.Chromaticity ( Data/Colour/CIE/Chromaticity.hs, dist/build/Data/Colour/CIE/Chromaticity.o, dist/build/Data/Colour/CIE/Chromaticity.dyn_o )

<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

Failed to build data-binary-ieee754-0.4.4.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/dt-bnry-754-0.4.4-29c0f572.log
):
Warning: data-binary-ieee754.cabal:36:21: version operators used. To use
version operators the package needs to specify at least 'cabal-version: >=
1.8'.
Configuring data-binary-ieee754-0.4.4...
Preprocessing library for data-binary-ieee754-0.4.4..
Building library for data-binary-ieee754-0.4.4..
[1 of 1] Compiling Data.Binary.IEEE754 ( lib/Data/Binary/IEEE754.hs, dist/build/Data/Binary/IEEE754.o, dist/build/Data/Binary/IEEE754.dyn_o )

lib/Data/Binary/IEEE754.hs:12:1: warning: [-Wtabs]
    Tab character found here, and in 70 further locations.
    Please use spaces instead.
   |
12 |         -- * Parsing
   | ^^^^^^^^

<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

Failed to build exe:hsc2hs from hsc2hs-0.68.7.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/hsc2hs-0.68.7-3fdf4607.log ):
Configuring executable 'hsc2hs' for hsc2hs-0.68.7..
Preprocessing executable 'hsc2hs' for hsc2hs-0.68.7..
Building executable 'hsc2hs' for hsc2hs-0.68.7..

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

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

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

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

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

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[ 1 of 12] Compiling ATTParser        ( ATTParser.hs, dist/build/hsc2hs/hsc2hs-tmp/ATTParser.o )

<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

Failed to build indexed-traversable-0.1.1.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/ndxd-trvrsbl-0.1.1-dc1c18e0.log
):
Configuring library for indexed-traversable-0.1.1..
Preprocessing library for indexed-traversable-0.1.1..
Building library for indexed-traversable-0.1.1..

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

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

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

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

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[1 of 5] Compiling GhcExts          ( src/GhcExts.hs, dist/build/GhcExts.o, dist/build/GhcExts.dyn_o )

<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

Failed to build primitive-0.7.2.0.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/prmtv-0.7.2.0-ce5a353e.log ):
Configuring library for primitive-0.7.2.0..
Preprocessing library for primitive-0.7.2.0..
Building library for primitive-0.7.2.0..

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

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

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

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

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

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

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

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

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

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

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

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[ 1 of 13] Compiling Control.Monad.Primitive ( Control/Monad/Primitive.hs, dist/build/Control/Monad/Primitive.o, dist/build/Control/Monad/Primitive.dyn_o )

<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

Failed to build splitmix-0.1.0.3.
Build log (
/Users/cristobalfeaugas/.cabal/logs/ghc-8.10.7/spltmx-0.1.0.3-77855e0e.log ):
Configuring library for splitmix-0.1.0.3..
Preprocessing library for splitmix-0.1.0.3..
Building library for splitmix-0.1.0.3..

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

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

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

<no location info>: error:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM between [9 and 13)
[1 of 4] Compiling Data.Bits.Compat ( src-compat/Data/Bits/Compat.hs, dist/build/Data/Bits/Compat.o, dist/build/Data/Bits/Compat.dyn_o )

<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
cabal: Failed to build blaze-builder-0.4.2.1 (which is required by
tidal-1.7.8). See the build log above for details.
Failed to build base-orphans-0.8.5 (which is required by tidal-1.7.8). See the
build log above for details.
Failed to build clock-0.8.2 (which is required by tidal-1.7.8). See the build
log above for details.
Failed to build colour-2.3.6 (which is required by tidal-1.7.8). See the build
log above for details.
Failed to build data-binary-ieee754-0.4.4 (which is required by tidal-1.7.8).
See the build log above for details.
Failed to build exe:hsc2hs from hsc2hs-0.68.7 (which is required by
tidal-1.7.8). See the build log above for details.
Failed to build indexed-traversable-0.1.1 (which is required by tidal-1.7.8).
See the build log above for details.
Failed to build primitive-0.7.2.0 (which is required by tidal-1.7.8). See the
build log above for details.
Failed to build splitmix-0.1.0.3 (which is required by tidal-1.7.8). See the
build log above for details.

Well, got it to work it seems.

Installed it with stack again and moved some things around.

How did you make this work? I am still trying to figure out the solution to the same problem on an M1 Mac :confused:

I honestly can't remember what I did exactly... for what it's worth, it ended up working with the stack install, not cabal.

@arethusa
I had the same issue today while trying to install tidal on my new M1 Mac.

I tried using stack (following the instructions from the docs - Troubleshoot on MacOS | Tidal Cycles) but I was still getting errors from Atom.

Eventually I solved by setting "Interpreter" to Stack in the tidal plugin setting in Atom (this step wasn't on the docs)

I hope this helps!

1 Like

Great! I'll try that later. After I managed to get it working, I'd still get some error messaged from Atom, but they didn't seem to be interfering with any functionality so I was just ignoring them on startup.

I am having this same issue, and installing with stack is not resolving it either. I also tried installing GHC HEAD which is said install version 10 of LLVM, which did nothing either.

Is this to do with incompatibility for Apple Silicon ARM CPU, or something else?

Haskell tooling is notoriously opaque, and not designed with our use case in mind. The Haskell Cabal is designed for building software packages, but is explicitly not a "package manager". This makes difficult the installation of libraries meant for interactive use, like tidal. Unfortunately, cabal is all we really have. The Haskell Stack is also primarily a build tool, and it is just as easy to fall into the same holes. As such, if you are using your Haskell installation only for tidal, I recommend the following:

  1. Ensure ghc and cabal are up-to-date. (I recommend following the versions recommended by ghcup.)
  2. cabal update followed by cabal v1-install tidal
  3. Test your installation.

This should work for now with the current implementation of cabal. If you change your version of ghc or cabal by running ghcup set _____, then the installation will break until you run cabal v1-install tidal again.


Further Reading
1 Like

Thanks for this info! I’m expecting a 14-inch MBP in the next two weeks, and started getting a little nervous about potential setup difficulties.

1 Like

Last I read, GHC builds on Apple Silicon are passing, so I don't expect you'll have too much issue there :slight_smile: I have no idea about SuperCollider, though.

1 Like

Recent setup of SuperCollider, Tidal and Atom on an M1 MacBook Air was perfectly straightforward, and all working well :slight_smile:

4 Likes

Well, apart from this very pesky issue:

Dang, I'm definitely stuck with my new M1 MBP. Running cabal update is fine, and outputs the following:

Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date at index-state 2021-11-22T22:53:25Z

When I then try running cabal v1-install tidal, I get hit with a bunch of llvm warnings:

<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

I'm sure this has to do with $PATH business, but I'm afraid I'm completely stumped on how to patch that kind of problem up. Any ideas?

EDIT — Indeed, I had missed the crucial step of adding LLVM to my PATH during install via homebrew. All seems to be ok for the time being!

1 Like

How did you do that? Sorry im such a noob

1 Like

Oh god — I'm not sure I can remember. Fellow noob, here. From what I can remember, I installed llvm via homebrew, but I had missed a recommendation (printed in terminal at the end of install) to run a separate command to add llvm to my $PATH. I did that, and ended up with the following in my local ~/.zshrc file:

[ -f "/Users/[your-user-name]/.ghcup/env" ] && source "/Users/[your-user-name]/.ghcup/env" # ghcup-env
. $HOME/.ghcup/env
export PATH="/usr/local/opt/llvm/bin:$PATH"
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
2 Likes

Hi there - not Big Sur but what I ended up needing to do on a new MBP M1 Pro, Monterrey:

  • I had to install zsh version of brew
  • I then used that to install llvm
  • I can't remember why, but was trying different "path" configurations and ended up using this:
    export PATH=/usr/local/opt/llvm/bin:$PATH

I had previously tried using the auto install script as well as the manual install and those had both failed.
Once I had brew, llvm, "path" config'd I retried auto install script and that worked.

This seems to be similar to what Oli has also posted.

3 Likes

I managed to solve this issue through the following steps (I work on a Mac M1 Big Sur, all commmands were posted in the Terminal):

  1. Install Homebrew; make sure to add echo 'PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile after the installation to add Homebrew to your path
  2. Install LLVM via Homebrew; make sure to add echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile after the installation to add LLVM to your path
  3. Run
    cabal update
    cabal install tidal --lib

to install Tydal Cycles, hopefully you won't get any error!

3 Likes