Trouble installing example code for Parallel and Concurrent Programming in Haskell

I just picked up a copy of “Parallel and Concurrent Programming in Haskell”. And I’m trying to follow the instructions on p.4 for getting the examples installed, but having trouble: [23-11-10 9:49] dbanas@Davids-Air-M2:~/prj % cabal unpack parconc-examples Downloading parconc-examples-0.4.8 Downloaded parconc-examples-0.4.8 Unpacking to parconc-examples-0.4.8/ [23-11-10 9:50] dbanas@Davids-Air-M2:~/prj % pushd parconc-examples-0.4.8 ~/prj/parconc-examples-0.4.8 ~/prj ~ [23-11-10 9:50] dbanas@Davids-Air-M2:~/prj/parconc-examples-0.4.8 % cabal install --only-dependencies cabal: Could not resolve dependencies: [__0] trying: parconc-examples-0.4.8 (user goal) [__1] next goal: base (dependency of parconc-examples) [__1] rejecting: base-4.17.2.0/installed-4.17.2.0 (conflict: parconc-examples => base>=4.5 && <4.14) [__1] skipping: base-4.19.0.0, base-4.18.1.0, base-4.18.0.0, 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 (has the same characteristics that caused the previous version to fail: excluded by constraint '>=4.5 && <4.14' from 'parconc-examples') [__1] rejecting: base-4.13.0.0, 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, parconc-examples) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: base, parconc-examples Thanks, -db

It has restrictive bounds on `base` (which secretly means ghc). You can try
`--allow-newer` to see if it works with newer versions.
On Fri, Nov 10, 2023 at 9:55 AM David Banas
I just picked up a copy of “Parallel and Concurrent Programming in Haskell”. And I’m trying to follow the instructions on p.4 for getting the examples installed, but having trouble:
[23-11-10 9:49] dbanas@Davids-Air-M2:~/prj % cabal unpack parconc-examples Downloading parconc-examples-0.4.8 Downloaded parconc-examples-0.4.8 Unpacking to parconc-examples-0.4.8/
[23-11-10 9:50] dbanas@Davids-Air-M2:~/prj % pushd parconc-examples-0.4.8 ~/prj/parconc-examples-0.4.8 ~/prj ~
[23-11-10 9:50] dbanas@Davids-Air-M2:~/prj/parconc-examples-0.4.8 % cabal install --only-dependencies cabal: Could not resolve dependencies: [__0] trying: parconc-examples-0.4.8 (user goal) [__1] next goal: base (dependency of parconc-examples) [__1] rejecting: base-4.17.2.0/installed-4.17.2.0 (conflict: parconc-examples => base>=4.5 && <4.14) [__1] skipping: base-4.19.0.0, base-4.18.1.0, base-4.18.0.0, 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 (has the same characteristics that caused the previous version to fail: excluded by constraint '>=4.5 && <4.14' from 'parconc-examples') [__1] rejecting: base-4.13.0.0, 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, parconc-examples) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: base, parconc-examples
Thanks, -db
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- brandon s allbery kf8nh allbery.b@gmail.com

On Fri, Nov 10, 2023 at 10:22:24AM -0500, Brandon Allbery wrote:
It has restrictive bounds on `base` (which secretly means ghc). You can try `--allow-newer` to see if it works with newer versions.
On Fri, Nov 10, 2023 at 9:55 AM David Banas
wrote: I just picked up a copy of “Parallel and Concurrent Programming in Haskell”. And I’m trying to follow the instructions on p.4 for getting the examples installed, but having trouble: [...]
Oh woe, this package is sorely out of date. Sadly --allow-newer is too loose. There are compile failures. Applying the patch below will get a lot of it working with GHCs up to 9.2, although things that rely on Network won't work (there is no longer a top-level Network module). repa doesn't seem to work with any later GHC, but the bits that don't depend on repa can probably be brought up to date with later GHCs. Anyway, it's rather a mess. Sorry about that. Hope you can get at least some use out of the below patch. Tom --- parconc-examples-0.4.8/parconc-examples.cabal 2023-11-10 15:49:49.065195771 +0000 +++ /home/tom/parconc-examples-0.4.8/parconc-examples.cabal 2023-11-10 15:47:09.037704366 +0000 @@ -84,10 +84,10 @@ build-depends: array >= 0.4 && <0.6, async >= 2.0 && < 2.3, - base >= 4.5 && < 4.14, + base >= 4.5 && < 4.20, binary >=0.6.3 && < 0.11, bytestring >= 0.9 && < 0.12, - containers >= 0.4 && < 0.6, + containers >= 0.4 && < 0.7, deepseq >= 1.3 && < 1.5, directory >= 1.1 && < 1.4, filepath >= 1.3 && < 1.5, @@ -98,15 +98,15 @@ random >= 1.0 && < 1.3, stm >=2.4 && < 2.6, time >= 1.4 && < 1.12, - template-haskell >= 2.7 && < 2.16, - transformers >=0.3 && <0.6, + template-haskell >= 2.7 && < 2.22, + transformers >=0.3 && <0.7, utf8-string >= 0.3 && < 1.1, - vector >= 0.10 && < 0.13, + vector >= 0.10 && < 0.14, xml ==1.3.*, common network if flag(network26) - build-depends: network >= 2.6 && < 2.9 + build-depends: network >= 2.6 && < 3.2 , network-uri >= 2.6 && < 2.7 else build-depends: network >= 2.3 && < 2.6

Thanks for the patch, Tom! :) So, is the `accelerate` package still the preferred approach to access a GPU from within a Haskell program, or has it been superseded by something else? Thanks, -db
On Nov 10, 2023, at 10:57 AM, Tom Ellis
wrote: On Fri, Nov 10, 2023 at 10:22:24AM -0500, Brandon Allbery wrote:
It has restrictive bounds on `base` (which secretly means ghc). You can try `--allow-newer` to see if it works with newer versions.
On Fri, Nov 10, 2023 at 9:55 AM David Banas
wrote: I just picked up a copy of “Parallel and Concurrent Programming in Haskell”. And I’m trying to follow the instructions on p.4 for getting the examples installed, but having trouble: [...]
Oh woe, this package is sorely out of date. Sadly --allow-newer is too loose. There are compile failures. Applying the patch below will get a lot of it working with GHCs up to 9.2, although things that rely on Network won't work (there is no longer a top-level Network module).
repa doesn't seem to work with any later GHC, but the bits that don't depend on repa can probably be brought up to date with later GHCs.
Anyway, it's rather a mess. Sorry about that. Hope you can get at least some use out of the below patch.
Tom
--- parconc-examples-0.4.8/parconc-examples.cabal 2023-11-10 15:49:49.065195771 +0000 +++ /home/tom/parconc-examples-0.4.8/parconc-examples.cabal 2023-11-10 15:47:09.037704366 +0000 @@ -84,10 +84,10 @@ build-depends: array >= 0.4 && <0.6, async >= 2.0 && < 2.3, - base >= 4.5 && < 4.14, + base >= 4.5 && < 4.20, binary >=0.6.3 && < 0.11, bytestring >= 0.9 && < 0.12, - containers >= 0.4 && < 0.6, + containers >= 0.4 && < 0.7, deepseq >= 1.3 && < 1.5, directory >= 1.1 && < 1.4, filepath >= 1.3 && < 1.5, @@ -98,15 +98,15 @@ random >= 1.0 && < 1.3, stm >=2.4 && < 2.6, time >= 1.4 && < 1.12, - template-haskell >= 2.7 && < 2.16, - transformers >=0.3 && <0.6, + template-haskell >= 2.7 && < 2.22, + transformers >=0.3 && <0.7, utf8-string >= 0.3 && < 1.1, - vector >= 0.10 && < 0.13, + vector >= 0.10 && < 0.14, xml ==1.3.*,
common network if flag(network26) - build-depends: network >= 2.6 && < 2.9 + build-depends: network >= 2.6 && < 3.2 , network-uri >= 2.6 && < 2.7 else build-depends: network >= 2.3 && < 2.6 _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

On Sat, Nov 11, 2023 at 04:24:22PM -0500, David Banas wrote:
So, is the `accelerate` package still the preferred approach to access a GPU from within a Haskell program, or has it been superseded by something else?
I have no idea, sorry. It may even be possible to bring repa up to date with a small amount of tweaking, but I'm not familiar with it so couldn't say for sure. Tom

On Sat, 11 Nov 2023, David Banas wrote:
So, is the `accelerate` package still the preferred approach to access a GPU from within a Haskell program, or has it been superseded by something else?
There is an active Google Group for accelerate: https://groups.google.com/g/accelerate-haskell Btw. I have implemented alternatives to 'repa' and 'accelerate': https://hackage.haskell.org/package/comfort-array https://hackage.haskell.org/package/knead The 'knead' package requires more manual planning of what to do on materialized arrays and what to do on-the-fly, compared to 'accelerate'. It does no GPU and no automatic parallelization. It simply translates to LLVM and relies on its vectorization. For readily vectorized arithmetic on the CPU you can use comfort-blas, which is a high-level binding to BLAS. My experience with GPU programming is that the speedup is by far less than claimed in advertisings and conference talks. Fantastic speedups of factors 100 or 1000 are usually due to a comparison of a GPU implementation optimized over months to a specific GPU and a CPU version quickly implemented in one day, often ignoring vectorization and cache optimization. GPU programs are hardly portable between vendors or even different GPU generations of the same vendor.
participants (4)
-
Brandon Allbery
-
David Banas
-
Henning Thielemann
-
Tom Ellis