
Hi Dominic,
You need to build/install LLVM with shared libraries.
Then, install llvm-general with -fshared-llvm (or, use my fork, which the
stack.yaml files point to).
-Trev
P.S. On mobile, apologies for the terse reply.
On Wed, 22 Feb 2017 at 10:34 AM, Dominic Steinitz
I am trying to build accelerate-llvm but getting the ghc panics below. Here’s my config
bash-3.2$ ghc-pkg list | grep llvm ghc-pkg list | grep llvm llvm-general-3.8.0.0 llvm-general-pure-3.5.0.0 llvm-general-pure-3.5.1.0 llvm-general-pure-3.8.0.0 bash-3.2$ ghc-pkg list | grep acc ghc-pkg list | grep acc accelerate-1.0.0.0 bash-3.2$ ghc --version ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.2
If anyone has any ideas, I’d be very grateful.
bash-3.2$ ~/Library/Haskell/bin/cabal build ~/Library/Haskell/bin/cabal build Building accelerate-llvm-1.0.0.0... Preprocessing library accelerate-llvm-1.0.0.0... ghc: lookupSymbol failed in relocateSection (RELOC_GOT) /usr/local/Cellar/llvm@3.8/3.8.1/lib/llvm-3.8/lib/libLLVMSupport.a: unknown symbol `___dso_handle' [24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, dist/build/Data/Range/Range.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
[31 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( Data/Array/Accelerate/LLVM/Util.hs, dist/build/Data/Array/Accelerate/LLVM/Util.o )
<no location info>: ghc: unable to load package `llvm-general-3.8.0.0' [32 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
[33 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Monad.o-boot ) [34 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.IR ( Data/Array/Accelerate/LLVM/CodeGen/IR.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/IR.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
[44 of 52] Compiling Data.Array.Accelerate.LLVM.Execute.Environment ( Data/Array/Accelerate/LLVM/Execute/Environment.hs, dist/build/Data/Array/Accelerate/LLVM/Execute/Environment.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug

Thanks - it seems I can only do this with home-brew for 3.9 - the flag is ignored for 3.8 - I am building now and will report back.
On 21 Feb 2017, at 15:44, Trevor McDonell
wrote: Hi Dominic,
You need to build/install LLVM with shared libraries.
Then, install llvm-general with -fshared-llvm (or, use my fork, which the stack.yaml files point to).
-Trev
P.S. On mobile, apologies for the terse reply. On Wed, 22 Feb 2017 at 10:34 AM, Dominic Steinitz
mailto:idontgetoutmuch@gmail.com> wrote: I am trying to build accelerate-llvm but getting the ghc panics below. Here’s my config bash-3.2$ ghc-pkg list | grep llvm ghc-pkg list | grep llvm llvm-general-3.8.0.0 llvm-general-pure-3.5.0.0 llvm-general-pure-3.5.1.0 llvm-general-pure-3.8.0.0 bash-3.2$ ghc-pkg list | grep acc ghc-pkg list | grep acc accelerate-1.0.0.0 bash-3.2$ ghc --version ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.2
If anyone has any ideas, I’d be very grateful.
bash-3.2$ ~/Library/Haskell/bin/cabal build ~/Library/Haskell/bin/cabal build Building accelerate-llvm-1.0.0.0... Preprocessing library accelerate-llvm-1.0.0.0... ghc: lookupSymbol failed in relocateSection (RELOC_GOT) /usr/local/Cellar/llvm@3.8/3.8.1/lib/llvm-3.8/lib/libLLVMSupport.a: unknown symbol `___dso_handle' [24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, dist/build/Data/Range/Range.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug http://www.haskell.org/ghc/reportabug
[31 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( Data/Array/Accelerate/LLVM/Util.hs, dist/build/Data/Array/Accelerate/LLVM/Util.o )
<no location info>: ghc: unable to load package `llvm-general-3.8.0.0' [32 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug http://www.haskell.org/ghc/reportabug
[33 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Monad.o-boot ) [34 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.IR http://data.array.accelerate.llvm.codegen.ir/ ( Data/Array/Accelerate/LLVM/CodeGen/IR.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/IR.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug http://www.haskell.org/ghc/reportabug
[44 of 52] Compiling Data.Array.Accelerate.LLVM.Execute.Environment ( Data/Array/Accelerate/LLVM/Execute/Environment.hs, dist/build/Data/Array/Accelerate/LLVM/Execute/Environment.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug http://www.haskell.org/ghc/reportabug

No go at the moment - I am using my tiny macbook on holiday which is on too old a version of Xcode. When I try to upgrade it tells me I am out of space. I think rather than fight I will wait until I get back to a machine with more resources.
On 22 Feb 2017, at 07:02, Dominic Steinitz
wrote: Thanks - it seems I can only do this with home-brew for 3.9 - the flag is ignored for 3.8 - I am building now and will report back.
On 21 Feb 2017, at 15:44, Trevor McDonell
mailto:trevor.mcdonell@gmail.com> wrote: Hi Dominic,
You need to build/install LLVM with shared libraries.
Then, install llvm-general with -fshared-llvm (or, use my fork, which the stack.yaml files point to).
-Trev
P.S. On mobile, apologies for the terse reply. On Wed, 22 Feb 2017 at 10:34 AM, Dominic Steinitz
mailto:idontgetoutmuch@gmail.com> wrote: I am trying to build accelerate-llvm but getting the ghc panics below. Here’s my config bash-3.2$ ghc-pkg list | grep llvm ghc-pkg list | grep llvm llvm-general-3.8.0.0 llvm-general-pure-3.5.0.0 llvm-general-pure-3.5.1.0 llvm-general-pure-3.8.0.0 bash-3.2$ ghc-pkg list | grep acc ghc-pkg list | grep acc accelerate-1.0.0.0 bash-3.2$ ghc --version ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.2
If anyone has any ideas, I’d be very grateful.
bash-3.2$ ~/Library/Haskell/bin/cabal build ~/Library/Haskell/bin/cabal build Building accelerate-llvm-1.0.0.0... Preprocessing library accelerate-llvm-1.0.0.0... ghc: lookupSymbol failed in relocateSection (RELOC_GOT) /usr/local/Cellar/llvm@3.8/3.8.1/lib/llvm-3.8/lib/libLLVMSupport.a: unknown symbol `___dso_handle' [24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, dist/build/Data/Range/Range.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug http://www.haskell.org/ghc/reportabug
[31 of 52] Compiling Data.Array.Accelerate.LLVM.Util ( Data/Array/Accelerate/LLVM/Util.hs, dist/build/Data/Array/Accelerate/LLVM/Util.o )
<no location info>: ghc: unable to load package `llvm-general-3.8.0.0' [32 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Ptr ( Data/Array/Accelerate/LLVM/CodeGen/Ptr.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Ptr.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug http://www.haskell.org/ghc/reportabug
[33 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.Monad[boot] ( Data/Array/Accelerate/LLVM/CodeGen/Monad.hs-boot, dist/build/Data/Array/Accelerate/LLVM/CodeGen/Monad.o-boot ) [34 of 52] Compiling Data.Array.Accelerate.LLVM.CodeGen.IR http://data.array.accelerate.llvm.codegen.ir/ ( Data/Array/Accelerate/LLVM/CodeGen/IR.hs, dist/build/Data/Array/Accelerate/LLVM/CodeGen/IR.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug http://www.haskell.org/ghc/reportabug
[44 of 52] Compiling Data.Array.Accelerate.LLVM.Execute.Environment ( Data/Array/Accelerate/LLVM/Execute/Environment.hs, dist/build/Data/Array/Accelerate/LLVM/Execute/Environment.o )
<no location info>: ghc: panic! (the 'impossible' happened) (GHC version 7.10.2 for x86_64-apple-darwin): Dynamic linker not initialised
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug http://www.haskell.org/ghc/reportabug
participants (2)
-
Dominic Steinitz
-
Trevor McDonell