Skip to content

[BUG] Compilation errors in accelerate-io #566

Open

Description

@pmiddend

Hi! Thanks for trying out Accelerate! We are sorry that you ran into trouble ): Please fill in the following report to help us fix the problem.

Description

I'm trying to compile accelerate-io in order to convert my Vector.Unboxed to accelerate vectors. I'm getting the following output:

accelerate-io-vector> src/Data/Array/Accelerate/IO/Data/Primitive/ByteArray.hs:49:52: error: [GHC-88464]
accelerate-io-vector>     Variable not in scope:
accelerate-io-vector>       unsafeCoerce# :: MutableByteArray# RealWorld -> ByteArray#
accelerate-io-vector>    |
accelerate-io-vector> 49 |             (# s2, ForeignPtr (byteArrayContents# (unsafeCoerce# mba#)) (PlainPtr mba#) #) }}
accelerate-io-vector>    |                                                    ^^^^^^^^^^^^^
accelerate-io-vector> src/Data/Array/Accelerate/IO/Data/Primitive/ByteArray.hs:51:64: error: [GHC-88464]
accelerate-io-vector>     Variable not in scope:
accelerate-io-vector>       unsafeCoerce# :: ByteArray# -> MutableByteArray# RealWorld
accelerate-io-vector>    |
accelerate-io-vector> 51 |     _  -> (# s, ForeignPtr (byteArrayContents# ba#) (PlainPtr (unsafeCoerce# ba#)) #)
accelerate-io-vector>    |                                                                ^^^^^^^^^^^^^
accelerate-io-vector> [2 of 7] Compiling Data.Array.Accelerate.IO.Data.Vector.Generic.Mutable ( src/Data/Array/Accelerate/IO/Data/Vector/Generic/Mutable.hs, dist/build/Data/Array/Accelerate/IO/Data/Vector/Generic/Mutable.o, dist/build/Data/Array/Accelerate/IO/Data/Vector/Generic/Mutable.dyn_o )
accelerate-io-vector> [3 of 7] Compiling Data.Array.Accelerate.IO.Data.Vector.Generic ( src/Data/Array/Accelerate/IO/Data/Vector/Generic.hs, dist/build/Data/Array/Accelerate/IO/Data/Vector/Generic.o, dist/build/Data/Array/Accelerate/IO/Data/Vector/Generic.dyn_o )
accelerate-io-vector> [6 of 7] Compiling Data.Array.Accelerate.IO.Data.Vector.Storable ( src/Data/Array/Accelerate/IO/Data/Vector/Storable.hs, dist/build/Data/Array/Accelerate/IO/Data/Vector/Storable.o, dist/build/Data/Array/Accelerate/IO/Data/Vector/Storable.dyn_o )
accelerate-io-vector> src/Data/Array/Accelerate/IO/Data/Vector/Storable.hs:68:21: error: [GHC-83865]
accelerate-io-vector>     • Couldn't match type ‘[Char]’
accelerate-io-vector>                      with ‘text-2.1.3:Data.Text.Internal.Builder.Builder’
accelerate-io-vector>       Expected: text-2.1.3:Data.Text.Internal.Builder.Builder
accelerate-io-vector>         Actual: String
accelerate-io-vector>     • In the first argument of ‘boundsCheck’, namely ‘"shape mismatch"’
accelerate-io-vector>       In the first argument of ‘($)’, namely
accelerate-io-vector>         ‘boundsCheck "shape mismatch" (vsize `quot` w == size sh)’
accelerate-io-vector>       In the expression:
accelerate-io-vector>         boundsCheck "shape mismatch" (vsize `quot` w == size sh)
accelerate-io-vector>           $ unsafePerformIO $ newUniqueArray fp
accelerate-io-vector> 68 |       = boundsCheck "shape mismatch" (vsize `quot` w == size sh)
accelerate-io-vector>    |                     ^^^^^^^^^^^^^^^^

Your environment
Include any relevant details about the environment you experienced the bug in. When reporting the versions of Accelerate packages used, include either the release number or the commit SHA if building from source.

If the bug is with the accelerate-llvm-ptx GPU backend, include the output of nvidia-device-query

  • Accelerate: 1.4.0.0
  • Accelerate backend(s): irrelevant
  • GHC: 9.10.3
  • OS: NixOS

Activity

  1. Tjalle-S commented on Sep 15, 2026

    @Tjalle-S
    Contributor

    Firstly, apologies for the late reply.

    The current master branch of accelerate-io, which contains accelerate-io-vector contains a patch to ensure the packages build with modern GHC versions. However, we haven't had much time to properly maintain these packages, so there is no corresponding release on Hackage. I am currently investigating what is necessary to get all satellite/utility packages working for Accelerate 1.4. Until those releases make it to Hackage, a temporary workaround is to pull the dependency directly from GitHub. For that, you can add the following to your cabal.project file (or the equivalent Nix configuration, if you are not using Cabal directly):

    source-repository-package
      type: git
      location: https://github.com/AccelerateHS/accelerate-io.git
      -- Current master branch
      tag: ab29ca6c4f96f1f346b8c196e268d1b44cd51a2e
      subdir:
        accelerate-io-vector
        -- Add other accelerate-io-* packages as necessary
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions