Error compiling GHC/Num.lhs

Bas van Dijk v.dijk.bas at
Sun Apr 29 07:54:35 EDT 2007


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"
#define LEFTMOST_BIT 2147483648
#define DIGITS       9
#define BASE         1000000000
#elif SIZEOF_HSWORD == 8
#define LEFTMOST_BIT 9223372036854775808
#define DIGITS       18
#define BASE         1000000000000000000
#error Please define LEFTMOST_BIT to be 2^(SIZEOF_HSWORD*8-1)
-- DIGITS should be the largest integer such that 10^DIGITS <
-- BASE should be 10^DIGITS. Note that ^ is not available yet.

Note that in I set BuildFlavour = quick and I also tried
building it with the following options added:

SRC_HC_OPTS += -optc-march=athlon64  -opta-march=athlon64
SRC_CC_OPTS += -march=athlon64

What can be the problem?


Bas van Dijk

Some info on my system (please ask for more if you need it):
$ uname -a
Linux bassbox 2.6.20-gentoo-r6 #1 PREEMPT Thu Apr 19 10:53:57 CEST
2007 i686 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux

$ gcc --version
gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)

More information about the Glasgow-haskell-users mailing list