-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Hi,
I'm experiencing a compilation error undefined symbol: nand_and_fetch_8 stemming from bits-atomic, when combining Template Haskell with lvish 2.0.2.
I've put together a small test case.
Foo.hs
{-# LANGUAGE TemplateHaskell #-}
module Foo where
import Language.Haskell.TH
build_p1 :: Q [Dec]
build_p1 = return
[ FunD p1
[ Clause [TupP [VarP a,VarP b]] (NormalB (VarE a)) []
]
] where
p1 = mkName "p1"
a = mkName "a"
b = mkName "b"And Main.hs
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Foo
import Control.LVish (Par) -- would require the lvish library
$(build_p1)
main = print $ p1 (1,2)For convenience, this code has been cabalised, available here: http://www.macs.hw.ac.uk/~rs46/files/lvish-template-haskell-fail-case.tar.gz . When trying to compile with cabal install, I get:
<command line>: can't load .so/.DLL for: /home/rob/.cabal/lib/i386-linux-ghc-7.10.1/bitsa_EfESR243Us2C1YfvGtoj49/libHSbits-atomic-0.1.3-EfESR243Us2C1YfvGtoj49-ghc7.10.1.so (/home/rob/.cabal/lib/i386-linux-ghc-7.10.1/bitsa_EfESR243Us2C1YfvGtoj49/libHSbits-atomic-0.1.3-EfESR243Us2C1YfvGtoj49-ghc7.10.1.so: undefined symbol: nand_and_fetch_8)
This symbol should be found from cbits/atomic-bitops-gcc.h and cbits/atomic-bitops-gcc.c from the bits-atomic package, but it's not being found. I don't get this error if I comment out the lvish build-depends entry in the cabal file and comment out the import of Control.LVish in Main.hs .
My software environment is: GHC 7.10, 32bit OS, bits-atomic-0.1.3, lvish-2.0.2. Questions:
- Is the lvish and template haskell combination above supposed to work?
- Can someone else reproduce my compilation error, based on the cabal project I link to above?