Error compiling GHC/Num.lhs

Bas van Dijk v.dijk.bas at gmail.com
Tue May 1 15:36:40 EDT 2007


On 4/29/07, Ian Lynagh <igloo at earth.li> wrote:
>
> Hi Bas,
>
> On Sun, Apr 29, 2007 at 11:54:35AM +0000, Bas van Dijk wrote:
> >
> > I'm trying to build GHC from darcs. Unfortunately compilation fails
> > with the following error:
> >
> > ...
> > cpphs: #error Please define LEFTMOST_BIT to be 2^(SIZEOF_HSWORD*8-1)
> > in GHC/Num.lhs  at line 27 col 1
> > make[1]: *** [doc.library.base] Error 1
> > make[1]: Leaving directory `/home/bas/development/haskell/ghc/libraries'
> > make: *** [stage1] Error 2
> > ...
> >
> > The following is the part where the error occurs in
> > libraries/base/GHC/Num.lhs :
> > ...
> > #include "MachDeps.h"
> > #if SIZEOF_HSWORD == 4
>
> This is a cpphs bug - IIRC it wasn't recursively expanding
> SIZEOF_HSWORD. Either install cpphs from darcs (I don't think there is a
> release with the fix yet) or uninstall it so that cpp is used instead.
>
>
> Thanks
> Ian

After uninstalling cpphs the error no longer occurs, thanks!

However the build now crashes when running Haddock on Cabal:
...
ifBuildable/ifBuildable Cabal setup/Setup haddock
Preprocessing library Cabal-1.1.7...
Running Haddock for Cabal-1.1.7...
Warning: cannot use package base-2.1:
   ghc-pkg failed
dist/build/tmp/Distribution/PreProcess.hs:"Distribution/PreProcess.hs":
115:1: parse error in doc string: [TokSpecial '/',TokString
"build",TokSpecial '"']
make[1]: *** [doc.library.Cabal] Error 1
make[1]: Leaving directory `/home/bas/development/haskell/ghc/libraries'
make: *** [stage1] Error 2

The respected code from libraries/Cabal/Distribution/PreProcess.hs
(line 115 and onwards a bit):

data PreProcessor = PreProcessor {

  -- Is the output of the pre-processor platform independent? eg happy
output
  -- is portable haskell but c2hs's output is platform dependent.
  -- This matters since only platform independent generated code can
be
  -- inlcuded into a source tarball.
  platformIndependent :: Bool,

  -- TODO: deal with pre-processors that have implementaion dependent
output
  --       eg alex and happy have --ghc flags. However we can't really
inlcude
  --       ghc-specific code into supposedly portable source tarballs.

  runPreProcessor :: (FilePath, FilePath) -- Location of the source
file relative to a base dir
                  -> (FilePath, FilePath) -- Output file name,
relative to an output base dir
                  -> Int      -- verbosity
                  -> IO ()    -- Should exit if the preprocessor fails
  }

Do I maybe need a newer Haddock for this? Currently I have version
0.8. Installing darcs version right now...

Thanks,

Bas van Dijk


More information about the Glasgow-haskell-users mailing list