Begin forwarded message:

From: Dominic Steinitz <idontgetoutmuch@gmail.com>
Subject: Re: accelerate-llvm problems
Date: 3 March 2017 at 16:44:59 GMT
To: Trevor McDonell <trevor.mcdonell@gmail.com>
Cc: GHC users <glasgow-haskell-users@haskell.org>, Ben Lippmeier <benl@ouroborus.net>

Hi Trevor,

I installed llvm with shared libraries:

brew install llvm --with-shared-libs

But I now get

llvm-general/llvm-general $ git branch
git branch
  llvm-3.8
* llvm-3.9
  master


cabal configure -fshared-llvm --extra-lib-dirs=/usr/local/opt/llvm/lib --extra-include-dirs=/usr/local/opt/llvm/include
Warning: The package list for 'hackage.haskell.org' is 30 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Configuring llvm-general-3.9.0.0...
Warning: Instead of 'cc-options: -I/usr/local/Cellar/llvm/3.9.1/include' use
'include-dirs: /usr/local/Cellar/llvm/3.9.1/include'
setup: Missing dependency on a foreign library:
* Missing C library: LLVM-3.9.1
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.

Perhaps I should report this here: https://github.com/bscarlet/llvm-general/issues?


On 21 Feb 2017, at 23:44, Trevor McDonell <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 <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
>
> [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




Dominic Steinitz
dominic@steinitz.org
http://idontgetoutmuch.wordpress.com