[Apologies if this is not the right place for such questions. If so, where should they go?]
I’m attempting to install QuickCheck via cabal on an iMac, but I’m getting a strange error.
The system complains that it cannot find ghc, even though ghc is in the specified place.
Any suggestions on how to fix? Thank you for your help. Go well, – P
philipwadler@Philips-iMac ~ % ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7
philipwadler@Philips-iMac ~ % .ghcup/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7
philipwadler@Philips-iMac ~ % ~/.ghcup/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7
philipwadler@Philips-iMac ~ % pwd
/Users/philipwadler
philipwadler@Philips-iMac ~ % cabal install QuickCheck
Resolving dependencies…
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
splitmix-0.1.0.4 (lib) (requires build)
random-1.2.1.1 (lib) (requires build)
QuickCheck-2.14.2 (lib) (requires build)
Starting splitmix-0.1.0.4 (lib)
Failed to build splitmix-0.1.0.4. The failure occurred during the configure
step.
Build log (
/Users/philipwadler/.cabal/logs/ghc-8.10.7/spltmx-0.1.0.4-a1adbba1.log ):
Configuring library for splitmix-0.1.0.4…
cabal-3.6.2.0: Cannot find the program ‘ghc’. User-specified path
‘.ghcup/bin/ghc’ does not refer to an executable and the program is not on the
system path.
cabal: Failed to build splitmix-0.1.0.4 (which is required by
QuickCheck-2.14.2). See the build log above for details.
philipwadler@Philips-iMac ~ %
philipwadler@dhcp-91-153 ~ % cabal install QuickCheck
Resolving dependencies…
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
splitmix-0.1.0.4 (lib) (requires build)
random-1.2.1.1 (lib) (requires build)
QuickCheck-2.14.2 (lib) (requires build)
Starting splitmix-0.1.0.4 (lib)
Building splitmix-0.1.0.4 (lib)
Failed to build splitmix-0.1.0.4.
Build log (
/Users/philipwadler/.cabal/logs/ghc-8.10.7/spltmx-0.1.0.4-a1adbba1.log ):
Configuring library for splitmix-0.1.0.4…
Preprocessing library for splitmix-0.1.0.4…
Building library for splitmix-0.1.0.4…
: error:
Warning: Couldn’t figure out LLVM version!
Make sure you have installed LLVM between [9 and 13)
: error:
Warning: Couldn’t figure out LLVM version!
Make sure you have installed LLVM between [9 and 13)
: error:
Warning: Couldn’t figure out LLVM version!
Make sure you have installed LLVM between [9 and 13)
: 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 )
: 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 splitmix-0.1.0.4 (which is required by
QuickCheck-2.14.2). See the build log above for details.
Oh, wait. Stupid me. I failed to note that it was still complaining about the LLVM version. Found the fix with a search, which is to add “/opt/homebrew/opt/llvm@12/bin” to the front of the PATH.