Closed tcsavage closed 10 years ago
Sorry to take so long getting back to you...
There are many factors which differ between your configuration and mine, but the thing that stands out most to me is that your error message comes from ghci. Since you say you see the error when building, your build process is likely trying to use ghci as part of ghc's compilation process. The only time that happens that I know of is in the use of template haskell. While in principle it ought to work, I don't test much with ghci.
Can you tell me if you're actually trying to use llvm-general during TH pre-processing? More likely either I'm completely wrong about what's going on, or TH is bringing in llvm-general because it's so heavy-handed about including dependencies. In the last case, you might be able to circumvent the problem by factoring your TH better.
Please let me know. I'd prefer not to bump up the priority of getting llvm-general working in ghci if I don't have to - it's on the list, but there are other projects I'd like to get done first.
Another approach you could take is digging down into the ghc execution with -v and figuring out which two objects are providing definitions of the multiply defined symbol, tracking back where those symbols came from, and so trying to figure out why we're getting the error in the first place.
Yet another (given the multiply-defined issue) would be to build llvm to produce shared libraries (pass --enable-shared to llvm's configure), llvm-general to use them (pass -fshared-llvm to llvm-general's cabal configure), and see if using that different approach to pulling in llvm works (i.e. dodges the problem).
Have you had a chance to look at your problem again?
My apologies. I was indeed using template Haskell (for creating lenses) and after removing it from the module it compiled fine. Thanks.
I have a simple single-file package using
llvm-general
which refuses to build with cabal or cabal-dev, but works fine when compiled withghc --make Main
.The linker error is as follows:
The .cabal file is as follows:
To make sure it wasn't an issue with my slightly non-standard LLVM installation, I tested it in a freshly configured VM but got the same results.
Operating system: Mint 16 GHC: 7.6.3 Cabal-install: 1.16.0.2 LLVM: 3.3 (compiled from source) llvm-general: 3.3.8.2