Re: [accelerate-haskell] runQ linking problems

13 views
Skip to first unread message

Trevor McDonell

unread,
Aug 20, 2019, 4:43:37 AM8/20/19
to Accelerate
Hi Philip,

Sorry for the late reply, I'm currently away at a conference.

I encountered a similar problem recently which I should have fixed now, can you try updating to the latest GitHub version? You'll need to use ghc-8.6, but the special `Setup.hs` and -fplugin options are no longer required.

If that doesn't work, please open a ticket on the issue tracker: https://github.com/AccelerateHS/accelerate/issues/new

Thanks!
-Trev


On Fri, 16 Aug 2019 at 22:58, 'Phillip Seeber' via Accelerate <accelerat...@googlegroups.com> wrote:
Dear all,
i would like to use runQ in my code but get linking errors. I have a module Math with this contents:
{-# LANGUAGE TemplateHaskell #-}
module Math
( vectorProduct
) where
import qualified Data.Array.Accelerate as A
import qualified Data.Array.Accelerate.LLVM.Native as A
import qualified Data.Array.Accelerate.Numeric.LinearAlgebra as A
import           MathHelper

vectorProduct
:: A.Vector Double -> A.Vector Double -> A.Scalar Double
vectorProduct
= $( A.runQ vectorProduct' )

And in MathHelper:
module MathHelper
( vectorProduct'
) where
import qualified Data.Array.Accelerate as A
import qualified Data.Array.Accelerate.LLVM.Native as A
import qualified Data.Array.Accelerate.Numeric.LinearAlgebra as A

vectorProduct'
:: A.Acc (A.Vector Double) -> A.Acc (A.Vector Double) -> A.Acc (A.Scalar Double)
vectorProduct
' = (A.<.>)

And my cabal file has been changed to a custom setup as described in the Accelerate documentation:
build-type:     Custom
custom
-setup
  setup
-depends:
     
Cabal
   
, accelerate-llvm-native
   
, base

library
  exposed
-modules:
     
Math
     
MathHelper
  ghc
-options: -O2 -Wall -Wno-unused-matches -Wno-unused-top-binds -Wno-type-defaults -fplugin=Data.Array.Accelerate.LLVM.Native.Plugin
  build
-depends:
      accelerate
>=1.3.0.0 && <=1.4.0.0
   
, accelerate-blas >=0.3.0.0 && <=0.4.0.0
   
, accelerate-llvm >=1.3.0.0 && <=1.4.0.0
   
, accelerate-llvm-native >=1.3.0.0 && <=1.4.0.0

and finally the Setup.hs
import Data.Array.Accelerate.LLVM.Native.Distribution.Simple
main
= defaultMain

But when building (with stack) i get multiple linking errors:
/usr/bin/ld.bfd: /user/seeber/.cache/accelerate/accelerate-llvm-1.3.0.0/accelerate-llvm-native-1.3.0.0/llvm-hs-8.0.0/x86_64-unknown-linux-gnu/skylake-avx512/rel/meepcbe253e948d483557
1fe7b4a933a11005889f64abcddc2704e46f236b607b0a4.o: in function `foldAllP1_cbe253e948d4835571fe7b4a933a11005889f64abcddc2704e46f236b607b0a4':
:(.text+0x220): multiple definition of `
foldAllP1_cbe253e948d4835571fe7b4a933a11005889f64abcddc2704e46f236b607b0a4'; /user/seeber/.cache/accelerate/accelerate-llvm-1.3.0.0/accelerate
-llvm-native-1.3.0.0/llvm-hs-8.0.0/x86_64-unknown-linux-gnu/skylake-avx512/rel/meepcbe253e948d4835571fe7b4a933a11005889f64abcddc2704e46f236b607b0a4.o::(.text+0x220): first defined he
re
(...)
collect2: error: ld returned 1 exit status
`gcc'
failed in phase `Linker'. (Exit code: 1)

The LLVM is version 8.0.1, gcc 7.4.0 and ld 2.31.1.20180828-lp151.2. Could anyone give me some tips, how this problem can be solved?

Thank you in advance and best wishes
Phillip

--
You received this message because you are subscribed to the Google Groups "Accelerate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelerate-hask...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/accelerate-haskell/433ca49a-ba87-489e-8b23-104080902551%40googlegroups.com.

Phillip Seeber

unread,
Aug 21, 2019, 10:08:46 AM8/21/19
to Accelerate
Hi Trevor,

thank you very much for your hint. Indeed, the most current version doesn't have this issue. I also found the comment message on github, sorry for not testing this first.

Best wishes
Phillip
To unsubscribe from this group and stop receiving emails from it, send an email to accelerate-haskell+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages