[Haskell] cabal and ghcconfigure.h

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Dec 1 10:18:40 EST 2005

On Wed, 2005-11-30 at 22:48 -0500, Robert Dockins wrote:
> I've just run across a problem with my cabal build system -- I'm not yet sure 
> if this is a cabal problem or a system configuration problem.
> I've been developing a package on OSX using the ghc 6.4.1 and cabal from 
> darwinports.  All is fine and dandy.  However, today I've sucked my darcs 
> repo down to my machine at home (running Gentoo linux) and now my package 
> won't build.  (this time with GHC 6.4.1 from portage and cabal 1.1.3)
> It halts while apparently running an Alex generated lexer through CPP, with 
> the error:
> ghcconfig.h: No such file or directory
> My GHC install has this file at /usr/lib/ghc-6.4.1/include, but it clearly 
> isn't in the include path that cabal is using.
> So the question is -- is this a cabal bug of some kind, or is the gentoo setup 
> messed up some how?  How should I proceed?

Are you using cpphs?

When you use ghc to do the 'cpp'ing it adds -I/usr/lib/ghc-6.4.1/include
but if Cabal is using cpphs then I suspect that it will not.

You can pass -v to Cabal to get it to show you exactly what it is

runhaskell Setup.lhs build -v

Alternatively you can specify the /usr/lib/ghc-6.4.1/include directory
in the "include-dirs" field in the .cabal file, however this is not
ideal of course since that path will vary between systems and ghc


More information about the Haskell mailing list