I want to install accelerate 1.3 (at time the latest version of a gpu acceleration package), either using stack or cabal (preferably cabal). It requires an older version of base than I have... how do I switch GHC versions locally so that when I do cabal run
, I can use accelerate, but keep using the latest GHC version for my other projects?
The version of base required for accelerate is 4.12 <= version < 4.15. I have base 4.18 on my current GHC version.
Error: cabal-3.10.2.1.exe: Could not resolve dependencies:
[__0] trying: gpu-acceleration-haskell-0.1.0.0 (user goal)
[__1] next goal: base (dependency of gpu-acceleration-haskell)
[__1] rejecting: base-4.17.2.1/installed-4.17.2.1 (conflict:
gpu-acceleration-haskell => base^>=4.12)
[__1] skipping: base-4.19.0.0, base-4.18.2.0, base-4.18.1.0, base-4.18.0.0,
base-4.17.2.1, base-4.17.2.0, base-4.17.1.0, base-4.17.0.0, base-4.16.4.0,
base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0, base-4.15.1.0,
base-4.15.0.0, base-4.14.3.0, base-4.14.2.0, base-4.14.1.0, base-4.14.0.0,
base-4.13.0.0 (has the same characteristics that caused the previous version
to fail: excluded by constraint '^>=4.12' from 'gpu-acceleration-haskell')
[__1] rejecting: base-4.12.0.0, base-4.11.1.0, base-4.11.0.0, base-4.10.1.0,
base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0, base-4.8.1.0,
base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1,
base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0,
base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0,
base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from
non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: base, gpu-acceleration-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, gpu-acceleration-haskell
As you probably knew already, base
versions are directly linked to certain GHC versions. You can see the versions here.
To change a GHC version with GHCUp, run ghcup tui
, install the version you want to use and then set it as the active version.
Another option is to install the correct version with GHCUp and specify the GHC version in your "cabal.project" file using the with-compiler
property, e.g. with-compiler: ghc-8.10.7
.