Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Compilation ghc 8.10 Segmentation fault 1.3.0.0 #546

Open
NCrashed opened this issue Nov 5, 2024 · 10 comments
Open

[BUG] Compilation ghc 8.10 Segmentation fault 1.3.0.0 #546

NCrashed opened this issue Nov 5, 2024 · 10 comments

Comments

@NCrashed
Copy link

NCrashed commented Nov 5, 2024

Description
Failed to compile the last version of the accelerate with Nix + GHC 8.10. The compilation fails with segmentation fault:

Compilation log
Running phase: setupCompilerEnvironmentPhase
@nix { "action": "setPhase", "phase": "setupCompilerEnvironmentPhase" }
Build with /nix/store/ch2j55w7zpsihhqnl6nm73fjynya20x3-ghc-8.10.7.
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/4axxv7kn3gfx8c5sicpvn1wdvshdf7ml-accelerate-1.3.0.0.tar.gz
source root is accelerate-1.3.0.0
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file accelerate-1.3.0.0/test/nofib/Main.hs
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Run jailbreak-cabal to lift version restrictions on build inputs.
Running phase: compileBuildDriverPhase
@nix { "action": "setPhase", "phase": "compileBuildDriverPhase" }
setupCompileFlags: -package-db=/build/tmp.dbRV1jQXXY/setup-package.conf.d -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/tmp.dbRV1jQXXY/Main.o )
Linking Setup ...
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configureFlags: --verbose --prefix=/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --with-gcc=gcc --package-db=/build/tmp.dbRV1jQXXY/package.conf.d --ghc-option=-j16 --ghc-option=+RTS --ghc-option=-A64M --ghc-option=-RTS --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --enable-split-sections --enable-library-stripping --enable-executable-stripping --extra-lib-dirs=/nix/store/z7nr6aqlzv51pk5ar8bgzg2alfqvi8fd-ncurses-6.4.20221231/lib --extra-lib-dirs=/nix/store/jn33apjqyxyn0vpags3k6c57s9i5qq1c-libffi-3.3/lib --extra-lib-dirs=/nix/store/mdnhaasvbh5mmxqd5yqc9qvyzc48i998-gmp-with-cxx-6.3.0/lib
Using Parsec parser
Configuring accelerate-1.3.0.0...
Flags chosen: bounds-checks=True, debug=False, ekg=False,
internal-checks=False, nofib=False, unsafe-checks=False
Dependency ansi-terminal -any: using ansi-terminal-1.0.2
Dependency base -any: using base-4.14.3.0
Dependency base-orphans -any: using base-orphans-0.9.2
Dependency bytestring -any: using bytestring-0.10.12.0
Dependency containers -any: using containers-0.6.5.1
Dependency cryptonite -any: using cryptonite-0.30
Dependency deepseq -any: using deepseq-1.4.4.0
Dependency directory -any: using directory-1.3.6.0
Dependency exceptions -any: using exceptions-0.10.4
Dependency filepath -any: using filepath-1.4.2.1
Dependency ghc-prim -any: using ghc-prim-0.6.1
Dependency half -any: using half-0.3.1
Dependency hashable -any: using hashable-1.4.4.0
Dependency hashtables -any: using hashtables-1.3.1
Dependency hedgehog -any: using hedgehog-1.4
Dependency lens -any: using lens-5.2.3
Dependency mtl -any: using mtl-2.2.2
Dependency prettyprinter -any: using prettyprinter-1.7.1
Dependency prettyprinter-ansi-terminal -any: using
prettyprinter-ansi-terminal-1.1.3
Dependency primitive -any: using primitive-0.8.0.0
Dependency tasty -any: using tasty-1.4.3
Dependency template-haskell -any: using template-haskell-2.16.0.0
Dependency terminal-size -any: using terminal-size-0.3.4
Dependency text -any: using text-1.2.4.1
Dependency transformers -any: using transformers-0.5.6.2
Dependency unique -any: using unique-0.0.1
Dependency unix -any: using unix-2.7.2.2
Dependency unordered-containers -any: using unordered-containers-0.2.20
Dependency vector -any: using vector-0.13.1.0
Source component graph: component lib
Configured component graph:
    component accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP
        include ansi-terminal-1.0.2-Fd7PnOdHCx723wDIbbSSvV
        include base-4.14.3.0
        include base-orphans-0.9.2-Hhm0XZzUVVK4X9gslAthbx
        include bytestring-0.10.12.0
        include containers-0.6.5.1
        include cryptonite-0.30-8FMa0t4bw3B7EQma2oCAbp
        include deepseq-1.4.4.0
        include directory-1.3.6.0
        include exceptions-0.10.4
        include filepath-1.4.2.1
        include ghc-prim-0.6.1
        include half-0.3.1-Ekzt8Wk4K7CG2u1KB5gaiA
        include hashable-1.4.4.0-9x1tzOGBb6FEX9YkgdO9wg
        include hashtables-1.3.1-ByR0ObYj3XC9eXiO6dc4D2
        include hedgehog-1.4-EY5JZmGErqBCQiDrND1vK9
        include lens-5.2.3-5qkF1QctYDS9dAY1TP8LCQ
        include mtl-2.2.2
        include prettyprinter-1.7.1-9SYNvhPK1YH2WAvQ3G3gEB
        include prettyprinter-ansi-terminal-1.1.3-4k2npAu8Gsy4DdQHP8Kj5
        include primitive-0.8.0.0-K7H5igh7Gtv4e7ddo66j0Z
        include tasty-1.4.3-LIkP7ay6Xi3J6n4cXQFfOV
        include template-haskell-2.16.0.0
        include terminal-size-0.3.4-EMcKF2kYFo0CJGrVkneWkg
        include text-1.2.4.1
        include transformers-0.5.6.2
        include unique-0.0.1-7sC04tvrUmSCUgP8HX8RxI
        include unix-2.7.2.2
        include unordered-containers-0.2.20-6fiKIzlNeGzBco9mubEmMN
        include vector-0.13.1.0-IhEzpoV4A8eE7UhyYcXNXy
Linked component graph:
    unit accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP
        include ansi-terminal-1.0.2-Fd7PnOdHCx723wDIbbSSvV
        include base-4.14.3.0
        include base-orphans-0.9.2-Hhm0XZzUVVK4X9gslAthbx
        include bytestring-0.10.12.0
        include containers-0.6.5.1
        include cryptonite-0.30-8FMa0t4bw3B7EQma2oCAbp
        include deepseq-1.4.4.0
        include directory-1.3.6.0
        include exceptions-0.10.4
        include filepath-1.4.2.1
        include ghc-prim-0.6.1
        include half-0.3.1-Ekzt8Wk4K7CG2u1KB5gaiA
        include hashable-1.4.4.0-9x1tzOGBb6FEX9YkgdO9wg
        include hashtables-1.3.1-ByR0ObYj3XC9eXiO6dc4D2
        include hedgehog-1.4-EY5JZmGErqBCQiDrND1vK9
        include lens-5.2.3-5qkF1QctYDS9dAY1TP8LCQ
        include mtl-2.2.2
        include prettyprinter-1.7.1-9SYNvhPK1YH2WAvQ3G3gEB
        include prettyprinter-ansi-terminal-1.1.3-4k2npAu8Gsy4DdQHP8Kj5
        include primitive-0.8.0.0-K7H5igh7Gtv4e7ddo66j0Z
        include tasty-1.4.3-LIkP7ay6Xi3J6n4cXQFfOV
        include template-haskell-2.16.0.0
        include terminal-size-0.3.4-EMcKF2kYFo0CJGrVkneWkg
        include text-1.2.4.1
        include transformers-0.5.6.2
        include unique-0.0.1-7sC04tvrUmSCUgP8HX8RxI
        include unix-2.7.2.2
        include unordered-containers-0.2.20-6fiKIzlNeGzBco9mubEmMN
        include vector-0.13.1.0-IhEzpoV4A8eE7UhyYcXNXy
        Data.Array.Accelerate=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate,Data.Array.Accelerate.AST=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.AST,Data.Array.Accelerate.AST.Environment=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.AST.Environment,Data.Array.Accelerate.AST.Idx=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.AST.Idx,Data.Array.Accelerate.AST.LeftHandSide=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.AST.LeftHandSide,Data.Array.Accelerate.AST.Var=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.AST.Var,Data.Array.Accelerate.Analysis.Hash=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Analysis.Hash,Data.Array.Accelerate.Analysis.Match=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Analysis.Match,Data.Array.Accelerate.Array.Data=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Array.Data,Data.Array.Accelerate.Array.Remote=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Array.Remote,Data.Array.Accelerate.Array.Remote.Class=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Array.Remote.Class,Data.Array.Accelerate.Array.Remote.LRU=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Array.Remote.LRU,Data.Array.Accelerate.Array.Remote.Table=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Array.Remote.Table,Data.Array.Accelerate.Array.Unique=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Array.Unique,Data.Array.Accelerate.Async=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Async,Data.Array.Accelerate.Data.Bits=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Bits,Data.Array.Accelerate.Data.Complex=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Complex,Data.Array.Accelerate.Data.Either=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Either,Data.Array.Accelerate.Data.Fold=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Fold,Data.Array.Accelerate.Data.Functor=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Functor,Data.Array.Accelerate.Data.Maybe=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Maybe,Data.Array.Accelerate.Data.Monoid=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Monoid,Data.Array.Accelerate.Data.Ratio=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Ratio,Data.Array.Accelerate.Data.Semigroup=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Data.Semigroup,Data.Array.Accelerate.Debug=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Debug,Data.Array.Accelerate.Error=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Error,Data.Array.Accelerate.Interpreter=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Interpreter,Data.Array.Accelerate.Lifetime=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Lifetime,Data.Array.Accelerate.Pretty=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Pretty,Data.Array.Accelerate.Representation.Array=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Representation.Array,Data.Array.Accelerate.Representation.Elt=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Representation.Elt,Data.Array.Accelerate.Representation.Shape=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Representation.Shape,Data.Array.Accelerate.Representation.Slice=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Representation.Slice,Data.Array.Accelerate.Representation.Stencil=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Representation.Stencil,Data.Array.Accelerate.Representation.Tag=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Representation.Tag,Data.Array.Accelerate.Representation.Type=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Representation.Type,Data.Array.Accelerate.Representation.Vec=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Representation.Vec,Data.Array.Accelerate.Smart=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Smart,Data.Array.Accelerate.Sugar.Array=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Sugar.Array,Data.Array.Accelerate.Sugar.Elt=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Sugar.Elt,Data.Array.Accelerate.Sugar.Foreign=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Sugar.Foreign,Data.Array.Accelerate.Sugar.Shape=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Sugar.Shape,Data.Array.Accelerate.Sugar.Vec=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Sugar.Vec,Data.Array.Accelerate.Test.NoFib=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Test.NoFib,Data.Array.Accelerate.Test.Similar=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Test.Similar,Data.Array.Accelerate.Trafo=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Trafo,Data.Array.Accelerate.Trafo.Config=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Trafo.Config,Data.Array.Accelerate.Trafo.Delayed=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Trafo.Delayed,Data.Array.Accelerate.Trafo.Fusion=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Trafo.Fusion,Data.Array.Accelerate.Trafo.Sharing=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Trafo.Sharing,Data.Array.Accelerate.Trafo.Substitution=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Trafo.Substitution,Data.Array.Accelerate.Type=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Type,Data.Array.Accelerate.Unsafe=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Array.Accelerate.Unsafe,Data.BitSet=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.BitSet,Data.Primitive.Vec=accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP:Data.Primitive.Vec
Ready component graph:
    definite accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP
        depends ansi-terminal-1.0.2-Fd7PnOdHCx723wDIbbSSvV
        depends base-4.14.3.0
        depends base-orphans-0.9.2-Hhm0XZzUVVK4X9gslAthbx
        depends bytestring-0.10.12.0
        depends containers-0.6.5.1
        depends cryptonite-0.30-8FMa0t4bw3B7EQma2oCAbp
        depends deepseq-1.4.4.0
        depends directory-1.3.6.0
        depends exceptions-0.10.4
        depends filepath-1.4.2.1
        depends ghc-prim-0.6.1
        depends half-0.3.1-Ekzt8Wk4K7CG2u1KB5gaiA
        depends hashable-1.4.4.0-9x1tzOGBb6FEX9YkgdO9wg
        depends hashtables-1.3.1-ByR0ObYj3XC9eXiO6dc4D2
        depends hedgehog-1.4-EY5JZmGErqBCQiDrND1vK9
        depends lens-5.2.3-5qkF1QctYDS9dAY1TP8LCQ
        depends mtl-2.2.2
        depends prettyprinter-1.7.1-9SYNvhPK1YH2WAvQ3G3gEB
        depends prettyprinter-ansi-terminal-1.1.3-4k2npAu8Gsy4DdQHP8Kj5
        depends primitive-0.8.0.0-K7H5igh7Gtv4e7ddo66j0Z
        depends tasty-1.4.3-LIkP7ay6Xi3J6n4cXQFfOV
        depends template-haskell-2.16.0.0
        depends terminal-size-0.3.4-EMcKF2kYFo0CJGrVkneWkg
        depends text-1.2.4.1
        depends transformers-0.5.6.2
        depends unique-0.0.1-7sC04tvrUmSCUgP8HX8RxI
        depends unix-2.7.2.2
        depends unordered-containers-0.2.20-6fiKIzlNeGzBco9mubEmMN
        depends vector-0.13.1.0-IhEzpoV4A8eE7UhyYcXNXy
Using Cabal-3.2.1.0 compiled by ghc-8.10
Using compiler: ghc-8.10.7
Using install prefix:
/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0
Executables installed in:
/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0/bin
Libraries installed in:
/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0/lib/ghc-8.10.7/x86_64-linux-ghc-8.10.7/accelerate-1.3.0.0-7Xr5CwBDbdBqWcg1BP0kP
Dynamic Libraries installed in:
/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0/lib/ghc-8.10.7/x86_64-linux-ghc-8.10.7
Private executables installed in:
/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0/libexec/x86_64-linux-ghc-8.10.7/accelerate-1.3.0.0
Data files installed in:
/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0/share/x86_64-linux-ghc-8.10.7/accelerate-1.3.0.0
Documentation installed in:
/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0/share/doc/x86_64-linux-ghc-8.10.7/accelerate-1.3.0.0
Configuration files installed in:
/nix/store/wqznvn1sd9z4kr80gy8qnaniprm7gh6g-accelerate-1.3.0.0/etc
No alex found
Using ar found on system at:
/nix/store/81xsp348yfgmaan9r5055mcdjfw7a8wc-binutils-2.42/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 13.3.0 given by user at:
/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/gcc
Using ghc version 8.10.7 found on system at:
/nix/store/ch2j55w7zpsihhqnl6nm73fjynya20x3-ghc-8.10.7/bin/ghc
Using ghc-pkg version 8.10.7 found on system at:
/nix/store/ch2j55w7zpsihhqnl6nm73fjynya20x3-ghc-8.10.7/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.24.2 found on system at:
/nix/store/ch2j55w7zpsihhqnl6nm73fjynya20x3-ghc-8.10.7/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.68 found on system at:
/nix/store/ch2j55w7zpsihhqnl6nm73fjynya20x3-ghc-8.10.7/bin/hpc
Using hsc2hs version 0.68.7 found on system at:
/nix/store/ch2j55w7zpsihhqnl6nm73fjynya20x3-ghc-8.10.7/bin/hsc2hs
Using hscolour version 1.25 found on system at:
/nix/store/khbxqkf5qiq9dhvmqj1abi50srjimgfh-hscolour-1.25/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/b74nxf0yn2dzha02mgdxyklaqjaijzqp-binutils-wrapper-2.42/bin/ld.gold
No pkg-config found
Using runghc version 8.10.7 found on system at:
/nix/store/ch2j55w7zpsihhqnl6nm73fjynya20x3-ghc-8.10.7/bin/runghc
Using strip version 2.42 found on system at:
/nix/store/zznja5f8v3jafffyah1rk46vpfcn38dv-gcc-wrapper-13.3.0/bin/strip
Using tar found on system at:
/nix/store/l2l5xr2zczq19gqpqz4j8vxxia1j41s1-gnutar-1.35/bin/tar
No uhc found
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Preprocessing library for accelerate-1.3.0.0..
Building library for accelerate-1.3.0.0..
[  1 of 104] Compiling Data.Array.Accelerate.AST.Idx ( src/Data/Array/Accelerate/AST/Idx.hs, dist/build/Data/Array/Accelerate/AST/Idx.o, dist/build/Data/Array/Accelerate/AST/Idx.dyn_o )
[  2 of 104] Compiling Data.Array.Accelerate.Analysis.Hash.TH ( src/Data/Array/Accelerate/Analysis/Hash/TH.hs, dist/build/Data/Array/Accelerate/Analysis/Hash/TH.o, dist/build/Data/Array/Accelerate/Analysis/Hash/TH.dyn_o )
[  3 of 104] Compiling Data.Array.Accelerate.Async ( src/Data/Array/Accelerate/Async.hs, dist/build/Data/Array/Accelerate/Async.o, dist/build/Data/Array/Accelerate/Async.dyn_o )
[  4 of 104] Compiling Data.Array.Accelerate.Debug.Clock ( src/Data/Array/Accelerate/Debug/Clock.hs, dist/build/Data/Array/Accelerate/Debug/Clock.o, dist/build/Data/Array/Accelerate/Debug/Clock.dyn_o )
[  5 of 104] Compiling Data.Array.Accelerate.Debug.Flags ( src/Data/Array/Accelerate/Debug/Flags.hs, dist/build/Data/Array/Accelerate/Debug/Flags.o, dist/build/Data/Array/Accelerate/Debug/Flags.dyn_o )
[  6 of 104] Compiling Data.Array.Accelerate.Debug.Trace ( src/Data/Array/Accelerate/Debug/Trace.hs, dist/build/Data/Array/Accelerate/Debug/Trace.o, dist/build/Data/Array/Accelerate/Debug/Trace.dyn_o )
[  7 of 104] Compiling Data.Array.Accelerate.Debug.Timed ( src/Data/Array/Accelerate/Debug/Timed.hs, dist/build/Data/Array/Accelerate/Debug/Timed.o, dist/build/Data/Array/Accelerate/Debug/Timed.dyn_o )
[  8 of 104] Compiling Data.Array.Accelerate.Debug.Stats ( src/Data/Array/Accelerate/Debug/Stats.hs, dist/build/Data/Array/Accelerate/Debug/Stats.o, dist/build/Data/Array/Accelerate/Debug/Stats.dyn_o )

src/Data/Array/Accelerate/Debug/Stats.hs:34:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc’ is deprecated:
      Use "Prettyprinter" instead.
   |
34 | import Data.Text.Prettyprint.Doc                          hiding ( annotate, Doc )
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Array/Accelerate/Debug/Stats.hs:36:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc.Render.String’ is deprecated:
      Use "Prettyprinter.Render.String" instead.
   |
36 | import Data.Text.Prettyprint.Doc.Render.String
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Array/Accelerate/Debug/Stats.hs:39:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc’ is deprecated:
      Use "Prettyprinter" instead.
   |
39 | import qualified Data.Text.Prettyprint.Doc                as Pretty
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[  9 of 104] Compiling Data.Array.Accelerate.Error ( src/Data/Array/Accelerate/Error.hs, dist/build/Data/Array/Accelerate/Error.o, dist/build/Data/Array/Accelerate/Error.dyn_o )
[ 10 of 104] Compiling Data.Array.Accelerate.Lifetime ( src/Data/Array/Accelerate/Lifetime.hs, dist/build/Data/Array/Accelerate/Lifetime.o, dist/build/Data/Array/Accelerate/Lifetime.dyn_o )
[ 11 of 104] Compiling Data.Array.Accelerate.Array.Unique ( src/Data/Array/Accelerate/Array/Unique.hs, dist/build/Data/Array/Accelerate/Array/Unique.o, dist/build/Data/Array/Accelerate/Array/Unique.dyn_o )
[ 12 of 104] Compiling Data.Array.Accelerate.Orphans ( src/Data/Array/Accelerate/Orphans.hs, dist/build/Data/Array/Accelerate/Orphans.o, dist/build/Data/Array/Accelerate/Orphans.dyn_o )
[ 13 of 104] Compiling Data.Array.Accelerate.Sugar.Foreign ( src/Data/Array/Accelerate/Sugar/Foreign.hs, dist/build/Data/Array/Accelerate/Sugar/Foreign.o, dist/build/Data/Array/Accelerate/Sugar/Foreign.dyn_o )
[ 14 of 104] Compiling Data.Array.Accelerate.Test.NoFib.Config ( src/Data/Array/Accelerate/Test/NoFib/Config.hs, dist/build/Data/Array/Accelerate/Test/NoFib/Config.o, dist/build/Data/Array/Accelerate/Test/NoFib/Config.dyn_o )
[ 15 of 104] Compiling Data.Atomic      ( src/Data/Atomic.hs, dist/build/Data/Atomic.o, dist/build/Data/Atomic.dyn_o )
[ 16 of 104] Compiling Data.Array.Accelerate.Debug.Monitoring ( src/Data/Array/Accelerate/Debug/Monitoring.hs, dist/build/Data/Array/Accelerate/Debug/Monitoring.o, dist/build/Data/Array/Accelerate/Debug/Monitoring.dyn_o )
[ 17 of 104] Compiling Data.BitSet      ( src/Data/BitSet.hs, dist/build/Data/BitSet.o, dist/build/Data/BitSet.dyn_o )
[ 18 of 104] Compiling Data.Array.Accelerate.Trafo.Config ( src/Data/Array/Accelerate/Trafo/Config.hs, dist/build/Data/Array/Accelerate/Trafo/Config.o, dist/build/Data/Array/Accelerate/Trafo/Config.dyn_o )
[ 19 of 104] Compiling Data.Primitive.Vec ( src/Data/Primitive/Vec.hs, dist/build/Data/Primitive/Vec.o, dist/build/Data/Primitive/Vec.dyn_o )

src/Data/Primitive/Vec.hs:42:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc’ is deprecated:
      Use "Prettyprinter" instead.
   |
42 | import Data.Text.Prettyprint.Doc
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 20 of 104] Compiling Data.Array.Accelerate.Type ( src/Data/Array/Accelerate/Type.hs, dist/build/Data/Array/Accelerate/Type.o, dist/build/Data/Array/Accelerate/Type.dyn_o )
[ 21 of 104] Compiling Data.Array.Accelerate.Representation.Tag ( src/Data/Array/Accelerate/Representation/Tag.hs, dist/build/Data/Array/Accelerate/Representation/Tag.o, dist/build/Data/Array/Accelerate/Representation/Tag.dyn_o )
[ 22 of 104] Compiling Data.Array.Accelerate.Classes.RealFrac[boot] ( src/Data/Array/Accelerate/Classes/RealFrac.hs-boot, dist/build/Data/Array/Accelerate/Classes/RealFrac.o-boot, dist/build/Data/Array/Accelerate/Classes/RealFrac.dyn_o )
[ 23 of 104] Compiling Data.Array.Accelerate.Representation.Type ( src/Data/Array/Accelerate/Representation/Type.hs, dist/build/Data/Array/Accelerate/Representation/Type.o, dist/build/Data/Array/Accelerate/Representation/Type.dyn_o )
[ 24 of 104] Compiling Data.Array.Accelerate.Representation.Vec ( src/Data/Array/Accelerate/Representation/Vec.hs, dist/build/Data/Array/Accelerate/Representation/Vec.o, dist/build/Data/Array/Accelerate/Representation/Vec.dyn_o )
[ 25 of 104] Compiling Data.Array.Accelerate.Representation.Shape ( src/Data/Array/Accelerate/Representation/Shape.hs, dist/build/Data/Array/Accelerate/Representation/Shape.o, dist/build/Data/Array/Accelerate/Representation/Shape.dyn_o )
[ 26 of 104] Compiling Data.Array.Accelerate.Representation.Slice ( src/Data/Array/Accelerate/Representation/Slice.hs, dist/build/Data/Array/Accelerate/Representation/Slice.o, dist/build/Data/Array/Accelerate/Representation/Slice.dyn_o )
[ 27 of 104] Compiling Data.Array.Accelerate.AST.Var ( src/Data/Array/Accelerate/AST/Var.hs, dist/build/Data/Array/Accelerate/AST/Var.o, dist/build/Data/Array/Accelerate/AST/Var.dyn_o )
[ 28 of 104] Compiling Data.Array.Accelerate.AST.LeftHandSide ( src/Data/Array/Accelerate/AST/LeftHandSide.hs, dist/build/Data/Array/Accelerate/AST/LeftHandSide.o, dist/build/Data/Array/Accelerate/AST/LeftHandSide.dyn_o )
[ 29 of 104] Compiling Data.Array.Accelerate.AST.Environment ( src/Data/Array/Accelerate/AST/Environment.hs, dist/build/Data/Array/Accelerate/AST/Environment.o, dist/build/Data/Array/Accelerate/AST/Environment.dyn_o )
[ 30 of 104] Compiling Data.Array.Accelerate.Representation.Elt ( src/Data/Array/Accelerate/Representation/Elt.hs, dist/build/Data/Array/Accelerate/Representation/Elt.o, dist/build/Data/Array/Accelerate/Representation/Elt.dyn_o )
[ 31 of 104] Compiling Data.Array.Accelerate.Array.Data ( src/Data/Array/Accelerate/Array/Data.hs, dist/build/Data/Array/Accelerate/Array/Data.o, dist/build/Data/Array/Accelerate/Array/Data.dyn_o )
[ 32 of 104] Compiling Data.Array.Accelerate.Representation.Array ( src/Data/Array/Accelerate/Representation/Array.hs, dist/build/Data/Array/Accelerate/Representation/Array.o, dist/build/Data/Array/Accelerate/Representation/Array.dyn_o )
[ 33 of 104] Compiling Data.Array.Accelerate.Representation.Stencil ( src/Data/Array/Accelerate/Representation/Stencil.hs, dist/build/Data/Array/Accelerate/Representation/Stencil.o, dist/build/Data/Array/Accelerate/Representation/Stencil.dyn_o )
[ 34 of 104] Compiling Data.Array.Accelerate.Array.Remote.Class ( src/Data/Array/Accelerate/Array/Remote/Class.hs, dist/build/Data/Array/Accelerate/Array/Remote/Class.o, dist/build/Data/Array/Accelerate/Array/Remote/Class.dyn_o )
[ 35 of 104] Compiling Data.Array.Accelerate.AST ( src/Data/Array/Accelerate/AST.hs, dist/build/Data/Array/Accelerate/AST.o, dist/build/Data/Array/Accelerate/AST.dyn_o )
[ 36 of 104] Compiling Data.Array.Accelerate.Trafo.Var ( src/Data/Array/Accelerate/Trafo/Var.hs, dist/build/Data/Array/Accelerate/Trafo/Var.o, dist/build/Data/Array/Accelerate/Trafo/Var.dyn_o )
[ 37 of 104] Compiling Data.Array.Accelerate.Pretty.Print ( src/Data/Array/Accelerate/Pretty/Print.hs, dist/build/Data/Array/Accelerate/Pretty/Print.o, dist/build/Data/Array/Accelerate/Pretty/Print.dyn_o )

src/Data/Array/Accelerate/Pretty/Print.hs:68:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc’ is deprecated:
      Use "Prettyprinter" instead.
   |
68 | import Data.Text.Prettyprint.Doc
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Array/Accelerate/Pretty/Print.hs:69:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc.Render.Terminal’ is deprecated:
      Use "Prettyprinter.Render.Terminal" instead.
   |
69 | import Data.Text.Prettyprint.Doc.Render.Terminal
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 38 of 104] Compiling Data.Array.Accelerate.Pretty.Graphviz.Type ( src/Data/Array/Accelerate/Pretty/Graphviz/Type.hs, dist/build/Data/Array/Accelerate/Pretty/Graphviz/Type.o, dist/build/Data/Array/Accelerate/Pretty/Graphviz/Type.dyn_o )

src/Data/Array/Accelerate/Pretty/Graphviz/Type.hs:22:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc’ is deprecated:
      Use "Prettyprinter" instead.
   |
22 | import Data.Text.Prettyprint.Doc
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 39 of 104] Compiling Data.Array.Accelerate.Pretty.Graphviz.Monad ( src/Data/Array/Accelerate/Pretty/Graphviz/Monad.hs, dist/build/Data/Array/Accelerate/Pretty/Graphviz/Monad.o, dist/build/Data/Array/Accelerate/Pretty/Graphviz/Monad.dyn_o )
[ 40 of 104] Compiling Data.Array.Accelerate.Analysis.Hash ( src/Data/Array/Accelerate/Analysis/Hash.hs, dist/build/Data/Array/Accelerate/Analysis/Hash.o, dist/build/Data/Array/Accelerate/Analysis/Hash.dyn_o )
[ 41 of 104] Compiling Language.Haskell.TH.Extra ( src/Language/Haskell/TH/Extra.hs, dist/build/Language/Haskell/TH/Extra.o, dist/build/Language/Haskell/TH/Extra.dyn_o )
[ 42 of 104] Compiling Data.Array.Accelerate.Sugar.Elt ( src/Data/Array/Accelerate/Sugar/Elt.hs, dist/build/Data/Array/Accelerate/Sugar/Elt.o, dist/build/Data/Array/Accelerate/Sugar/Elt.dyn_o )
[ 43 of 104] Compiling Data.Array.Accelerate.Sugar.Vec ( src/Data/Array/Accelerate/Sugar/Vec.hs, dist/build/Data/Array/Accelerate/Sugar/Vec.o, dist/build/Data/Array/Accelerate/Sugar/Vec.dyn_o )
[ 44 of 104] Compiling Data.Array.Accelerate.Sugar.Shape ( src/Data/Array/Accelerate/Sugar/Shape.hs, dist/build/Data/Array/Accelerate/Sugar/Shape.o, dist/build/Data/Array/Accelerate/Sugar/Shape.dyn_o )
[ 45 of 104] Compiling Data.Array.Accelerate.Analysis.Match ( src/Data/Array/Accelerate/Analysis/Match.hs, dist/build/Data/Array/Accelerate/Analysis/Match.o, dist/build/Data/Array/Accelerate/Analysis/Match.dyn_o )
[ 46 of 104] Compiling Data.Array.Accelerate.Trafo.Substitution ( src/Data/Array/Accelerate/Trafo/Substitution.hs, dist/build/Data/Array/Accelerate/Trafo/Substitution.o, dist/build/Data/Array/Accelerate/Trafo/Substitution.dyn_o )
[ 47 of 104] Compiling Data.Array.Accelerate.Trafo.LetSplit ( src/Data/Array/Accelerate/Trafo/LetSplit.hs, dist/build/Data/Array/Accelerate/Trafo/LetSplit.o, dist/build/Data/Array/Accelerate/Trafo/LetSplit.dyn_o )
[ 48 of 104] Compiling Data.Array.Accelerate.Trafo.Environment ( src/Data/Array/Accelerate/Trafo/Environment.hs, dist/build/Data/Array/Accelerate/Trafo/Environment.o, dist/build/Data/Array/Accelerate/Trafo/Environment.dyn_o )
[ 49 of 104] Compiling Data.Array.Accelerate.Trafo.Shrink ( src/Data/Array/Accelerate/Trafo/Shrink.hs, dist/build/Data/Array/Accelerate/Trafo/Shrink.o, dist/build/Data/Array/Accelerate/Trafo/Shrink.dyn_o )
[ 50 of 104] Compiling Data.Array.Accelerate.Trafo.Delayed ( src/Data/Array/Accelerate/Trafo/Delayed.hs, dist/build/Data/Array/Accelerate/Trafo/Delayed.o, dist/build/Data/Array/Accelerate/Trafo/Delayed.dyn_o )
[ 51 of 104] Compiling Data.Array.Accelerate.Trafo.Algebra ( src/Data/Array/Accelerate/Trafo/Algebra.hs, dist/build/Data/Array/Accelerate/Trafo/Algebra.o, dist/build/Data/Array/Accelerate/Trafo/Algebra.dyn_o )

src/Data/Array/Accelerate/Trafo/Algebra.hs:42:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc’ is deprecated:
      Use "Prettyprinter" instead.
   |
42 | import Data.Text.Prettyprint.Doc
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Array/Accelerate/Trafo/Algebra.hs:43:1: warning: [-Wdeprecations]
    Module ‘Data.Text.Prettyprint.Doc.Render.Text’ is deprecated:
      Use "Prettyprinter.Render.Text" instead.
   |
43 | import Data.Text.Prettyprint.Doc.Render.Text
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/nix/store/91d27rjqlhkzx7mhzxrir1jcr40nyc7p-stdenv-linux/setup: line 1708:   232 Segmentation fault      (core dumped) ./Setup build

Steps to reproduce

Steps to reproduce the behaviour:

  1. Clone the demo repo https://github.com/NCrashed/accelerate-1.3-segfault/tree/6d7c27a490022e4925df4284f19908828f2a494c
  2. Run nix-build
  3. See the result

Expected behaviour
Success build of accelerate and dependencies

Your environment
The exact environment is pinned in the demo repo (by pinning accelerate version and nixpkgs).

  • Accelerate: 1.3.0.0
  • Accelerate backend(s): none
  • GHC: 8.10.7
  • OS: NixOS 21 kernel 5.4.277
@tomsmeding
Copy link
Member

Running cabal repl -w ghc-8.10.7 accelerate picks up 1.3.0.0 from hackage, and works for me. I don't use Nix so I cannot easily test your specific setup, sorry.

A segmentation fault in the compiler while compiling accelerate sounds highly suspect. Are you sure it is a segmentation fault, and not, for example, an OOM kill?

Also: the release on Hackage is fairly old, for various reasons. The master version on git, as well as that of accelerate-llvm{,-native,-ptx} here should have support for newer compilers, and is more tested.

@Bodigrim
Copy link

Given dist/build substring in the output, apparently Nix chooses to run cabal v1-install, which is quite odd and error prone.

@Bodigrim
Copy link

Also: the release on Hackage is fairly old, for various reasons.

BTW is there anything we can do to improve the situation? It would be great to have a new release of accelerate.

@tomsmeding
Copy link
Member

(Disclaimer: I've never been an active developer of accelerate, just contributed on the sidelines and happen to work in the same office as those who do.)

Warning: braindump incoming.

There's a few reasons that I can see; I'll ask around if I'm missing things.

  1. There are various Accelerate-related packages on Hackage (Trevor's packages in this list) that the maintainer(s) wanted to update in sync with the main package. Currently a bunch of these will not work with the latest accelerate master, I suspect — though I haven't tried. We don't really have the time to update these, at the moment (other tasks have higher priority).

  2. A significant installation difficulty for using Accelerate has always been that 1. you need LLVM installed, 2. that needs to be compiled in such a way that llvm-hs can find both the static and the dynamic libraries in the correct configuration, and 3. LLVM's version must be in sync with the llvm-hs haskell package version. (1.) is not so bad, (2.) is automatic only on Ubuntu and MacOS (necessitating a custom build of LLVM on other linux distros, and a prayer for Windows users), and (3.) is just plain annoying and prevents portable distribution of built executables. Furthermore, because the latest LLVM version supported by llvm-hs (on the llvm-15 branch on github, not on Hackage!) is 15, whereas the newest LLVM version by now is already 19.

    To improve this situation I've written a patch for accelerate-llvm-native (the CPU backend) to rely on clang only and communicate via pretty-printed LLVM IR with llvm-pretty. This seems to work and is much more portable, but 1. increases compilation time of the Accelerate peogram a little bit (not much — this is not our main worry), 2. is relatively untested, and 3. doesn't do anything for the GPU backend, which also wouldn't share accelerate-llvm with -native any more. We're going to address (2.) by asking >150 students in a bachelor course to use accelerate on CPU in this way, but (3.) stands. Extending the patch to the GPU backend is theoretically possible by significantly extending (possibly forking, because the extensions are likely backwards-incompatible — addrspace is everywhere) llvm-pretty, but will take a decent amount of work. (And we're all PhDs currently so hours are in short supply.)

  3. So the GPU backend still requires a properly-built LLVM 15. It also requires the cuda package to be in sync with the cuda version on the system, and the cuda version on Hackage supports cuda 11. Fortunately, with your involvement in language-c recently (bless @Bodigrim), only this cuda PR needs to be merged (mind: I have only tested that PR through using Accelerate, not actually checked whether the patch makes any sense!) to make accelerate support cuda 12, which is what everyone is running.

There are further quality-of-life improvements that would be good, but that's what patch releases are for, I guess.

Regarding work / priorities / help (regardless of from whom):

  1. For (1.) I'm not sure how important the side-packages are personally, we should ask users perhaps? Who are even our users anymore? Do we still have any?
  2. We'd have a choice to release with or without the llvm-pretty patch. It only improves life for CPU, not for GPU, and for the time being it awkwardly duplicates the intended-to-be-shared code between the two. If we want the patch in, we should wait until February when the students have used it a bit.
  3. That cuda PR would be cool (+ a Hackage release), but the system is still awkward to use then. But I guess it's not any more awkward than it was before.

Sorry for the braindump. Thoughts?

(Also, nothing here has anything to do with the segfault in OP here, which I'm still suspicious about.)

@tmcdonell
Copy link
Member

Regarding the original issue, GHC-8.10 is very old at this point, how long does Nix need (us) to maintain backwards compatibility? I don't think I have tested with 8.* in quite a while, even when I was more actively working on accelerate...

Regarding the rest, warning: brain dump incoming...

BTW is there anything we can do to improve the situation? It would be great to have a new release of accelerate.

That's a great question. I have a lot of half-finished work that I wanted to complete before cutting a new release, but that has kind of stalled due to lack of spare time & motivation. Also a lot of ideas for how the language should evolve. But, again... ¯\_(ツ)_/¯

I'm not sure how important the side-packages are personally, we should ask users perhaps?

These all came about as an example of the classic chicken-and-egg problem: people are interested in Accelerate but don't know how to use it, or it is missing some feature that the would need but they don't (yet!) have the time/skill to write it themselves. Basically, I needed a standard library of stuff, both for others to use, as well as myself to write demo programs to show others to get them interested and so (hopefully) entice them to write something in Accelerate, etc. etc., and build momentum that way. That was the idea anyway, I don't know if it every worked out...

Other than the FFI packages they should all be pretty easy to update.

But to your question, which parts of this are actually useful is unknown...

We'd have a choice to release with or without the llvm-pretty patch

This sounds like adding technical debt, without a clear path to when it would be cleaned up. I'd also be hesitant to take on llvm-pretty as another(/different) dependency.

An alternative I tried was to make llvm-hs an internal package to accelerate-llvm, which at least unblocks us from their hackage release schedule. Due to technical limitations with cabal at the time that was not possible. That might be fixed now, but I don't know.

As with most open source work, Windows support is often a second or third class citizen. Accelerate has occasionally worked on Windows, or so I am told...

That cuda PR would be cool (+ a Hackage release)

The larger question I have with this is whether on not to continue in the same direction with this package. The surface area of the CUDA API keeps increasing, and a lot of the bindings I have made here are just completely untested. The README started tracking what functions were not covered from each CUDA version, but that is only from the driver API; the runtime API is in even worse shape.

So, maybe we shouldn't try to provide bindings to all functions, but rather just the types (so that they can be shared across different packages) and let users declare their own FFI declarations at the point where they need it. All this package really needs to do is find the relevant libraries and tell the linker how to include them, and all clients really need is to tell the compiler to assume that a particular symbol exists. All this automatic marshalling with c2hs is, I now think, more hassle than it's worth...

But I'm old and jaded, so take that all with a grain of salt. Thoughts?

@tomsmeding
Copy link
Member

tomsmeding commented Nov 18, 2024

@tmcdonell Thanks for sharing your thoughts! You naturally have more perspective here, practical and historical :)

I have a lot of half-finished work that I wanted to complete before cutting a new release, but that has kind of stalled due to lack of spare time & motivation. Also a lot of ideas for how the language should evolve. But, again... ¯\_(ツ)_/¯

I think point releases exist for a reason. If the code works and is not worse than before, but is improved in some respect, that could be worth releasing. Backwards-incompatble changes are trickier, but new features or better optimisations / compilation strategies etc. shouldn't block a release, I think.

We'd have a choice to release with or without the llvm-pretty patch

This sounds like adding technical debt, without a clear path to when it would be cleaned up. I'd also be hesitant to take on llvm-pretty as another(/different) dependency.

I'm also not a fan of a half-llvm-pretty half-llvm-hs situation either. The changes are also not yet merged to master anywhere in accelerate for this reason. Don't worry :)

But re dependencies, in the ideal world where the GPU backend is also refactored to use (a forked) llvm-pretty, I do think things are better: llvm-hs and llvm-hs-pure get scrapped from the dep list, and llvm-pretty comes in place. (In the patched version of -native this is already the case.)

An alternative I tried was to make llvm-hs an internal package to accelerate-llvm, which at least unblocks us from their hackage release schedule. Due to technical limitations with cabal at the time that was not possible. That might be fixed now, but I don't know.

I think this is quite possible, and even Stack seems to have support for this now (e.g. this, can't find the proper issue at the moment). However, while vendoring-in llvm-hs does free us from their release process, or indeed from binding anything from LLVM that we don't need in accelerate, it does not change the fact that users need to version-match LLVM against a haskell library version (right? Actually how would that even work as a sublibrary?).

As with most open source work, Windows support is often a second or third class citizen. Accelerate has occasionally worked on Windows, or so I am told...

As I alluded to, the Concurrency students this year are (hopefully! 🙏) going to use Accelerate on CPU (! not gpu!) on Windows native, no WSL, with the llvm-pretty approach. That should be a decent test. :)

... cuda ...

I dunno, this is very much your area.

@Bodigrim
Copy link

My personal priority is that readers of Marlow's book have an opportunity to run Accelerate on modern GHC versions. New features can be added later on, but it would be nice if https://hackage.haskell.org/package/accelerate works out of the box.

With regards to llvm-hs / llvm-pretty situation, have you seen https://hackage.haskell.org/package/llvm-codegen-0.1.0.0? Is it up to task?

@tomsmeding
Copy link
Member

Haven't seen it, but I just had a look. It seems it does essentially what llvm-pretty does, with a different API, and adds a few basic bindings to the LLVM C API by linking to LLVM. The C API bindings are not for actual code generation but only got getting type size information, which we don't really care about because we just generate explicitly sized types anyway.

So it would be a replacement for llvm-pretty for us, not a replacement for llvm-hs. And while I didn't check the whole instruction list, it doesn't seem to support address spaces on pointers, so it isn't (yet) capable of supporting the GPU backend. Of course the same holds for llvm-pretty, as written above, but this means it's not really an improvement over llvm-pretty either — and we already have a patch for the CPU backend for llvm-pretty so sunk cost. :)

@tmcdonell
Copy link
Member

... GPU backend is also refactored to use (a forked) llvm-pretty

The LLVM AST internal to accelerate-llvm is already fully featured for what we need, it just lacks a pretty printer. I started working on this already a while ago, but, again, that's one of those things I have not yet finished...

Using llvm-pretty as an intermediate solution was a good choice, but it sounds like moving forward it will be more pain than it is worth.

it does not change the fact that users need to version-match LLVM against a haskell library version (right? Actually how would that even work as a sublibrary?).

Correct, but this is also true in the current setup because in practice only one version of llvm-hs on hackage has ever worked at a time, so the fact that accelerate-llvm itself supports multiple versions is somewhat irrelevant (for end users). Having a particular version of llvm available on your system would just become part of the installation prerequisites.

Saying that, we should at least pay attention to what versions of llvm are supported for the versions of ghc that we support (and potentially that nix offers, but someone from that crowd would need to be in charge of that).

Related to this:

that needs to be compiled in such a way that llvm-hs can find both the static and the dynamic libraries in the correct configuration ... is automatic only on Ubuntu and MacOS

That isn't an accident. I submitted the patches to homebrew to make this happen, and also maintained my own homebrew tap during the period they only provided the latest llvm release while llvm-hs/llvm-general lagged behind. So the situation on macOS is easy now, but it would be even easier if they could just use the system clang they have already (Xcode default toolchain is going to be built on an older version of llvm than what you could get directly from llvm.org, but for the most part that shouldn't matter).

Concurrency students

Good luck! It's great to have so many (un)willing guinea pigs 😂

My personal priority is that readers of Marlow's book have an opportunity to run Accelerate on modern GHC versions

That would be great. In the far distant past I started working on the necessary errata so that people knew what to change in order to use the newer versions of the library with his book; here and mostly the Mandelbrot example here. Maybe also in the hackage docs, I can't remember. That should also be kept up-to-date (the whole website needs attention, really...)

@Bodigrim
Copy link

I think it would be most beneficial to get at least something working released and available from Hackage. What is the minimal amount of work required for it to happen? Shall we start with a release of cuda?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants