I am having trouble installing the latest GHC binary bundle for
Linux (4.04). I've tried it under Redhat Linux 5.02, and a
Slackware Linux distribution (kernel = 2.0.35), with the same results.
I did not have these problems with GHC 4.02...
GHC 4.04 installs okay, and compiles the standard Main.hs program
that is given in the install guide, but cannot link it.
The first problem is that -lgmp gives errors. (It is apparently not
installed as part of the default Linux package in either system).
I fixed this by installing the gmp package, but I wonder if it could
be packaged with ghc (like it was with 4.02?).
More seriously, I then get the following link errors about missing
data definitions.
Any help would be appreciated! Thanks.
Mark.
======================================================================
:spot:~/tmp> ghc -v -o hello Main.hs
The Glorious Glasgow Haskell Compilation System, version 4.04, patchlevel 0
Effective command line: -v -o hello
Ineffective C pre-processor:
echo '{-# LINE 1 "Main.hs" -}' > /tmp/ghc22730.cpp && cat Main.hs >>
/tmp/ghc22730.cpp
0.01user 0.00system 0:00.01elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (63major+9minor)pagefaults 0swaps
Haskell compiler:
/usr/local/lib/ghc-4.04/hsc /tmp/ghc22730.cpp -fignore-interface-pragmas
-fomit-interface-pragmas -fsimplify [ -finline-phase2 -fmax-simplifier-iterations4 ]
-fwarn-overlapping-patterns -fwarn-missing-methods -fwarn-duplicate-exports
-fhi-version=404 -static -himap=.%.hi:/usr/local/lib/ghc-4.04/imports/std%.hi -v
-hifile=/tmp/ghc22730.hi -C=/tmp/ghc22730.hc -F=/tmp/ghc22730_stb.c
-FH=/tmp/ghc22730_stb.h +RTS -H6000000 -K1000000
Glasgow Haskell Compiler, version 4.04, for Haskell 98, compiled by GHC version 4.04
3.97user 0.19system 0:04.62elapsed 89%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (1298major+1751minor)pagefaults 0swaps
Pin on Haskell consistency info:
echo 'static char ghc_hsc_ID[] = "@(#)hsc Main.hs 40.0,,";' >>
/tmp/ghc22730.hc
0.00user 0.01system 0:00.01elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (63major+9minor)pagefaults 0swaps
*** New hi file follows...
__interface Main 404 where
__export Main main;
main :: PrelIOBase.IO PrelBase.Z0T ;
ghc: module version unchanged at 1
Replace .hi file, if changed:
cmp -s Main.hi /tmp/ghc22730.hi-new || ( rm -f Main.hi && cp
/tmp/ghc22730.hi-new Main.hi )
0.01user 0.00system 0:00.01elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (65major+11minor)pagefaults 0swaps
C compiler:
gcc -v -DDONT_WANT_WIN32_DLL_SUPPORT -S -Wimplicit -O -DSTOLEN_X86_REGS=4
-fomit-frame-pointer -fno-defer-pop -I. -I/usr/local/lib/ghc-4.04/includes
-I/usr/local/lib/ghc-4.04/includes ghc22730.c > /tmp/ghc22730.ccout 2>&1 && ( if [
ghc22730.s != /tmp/ghc22730_o.s ] ; then mv ghc22730.s /tmp/ghc22730_o.s ; else exit 0
; fi )
Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2.3/specs
gcc version 2.7.2.3
/usr/lib/gcc-lib/i486-linux/2.7.2.3/cpp -lang-c -v -I.
-I/usr/local/lib/ghc-4.04/includes -I/usr/local/lib/ghc-4.04/includes -undef
-D__GNUC__=2 -D__GNUC_MINOR__=7 -D__ELF__ -Dunix -Di386 -Dlinux -D__ELF__ -D__unix__
-D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(unix) -Asystem(posix)
-Acpu(i386) -Amachine(i386) -D__OPTIMIZE__ -Wimplicit -D__i486__
-DDONT_WANT_WIN32_DLL_SUPPORT -DSTOLEN_X86_REGS=4 ghc22730.c /tmp/cca22747.i
GNU CPP version 2.7.2.3 (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
.
/usr/local/lib/ghc-4.04/includes
/usr/local/lib/ghc-4.04/includes
/usr/local/include
/usr/i486-linux/include
/usr/lib/gcc-lib/i486-linux/2.7.2.3/include
/usr/include
End of search list.
/usr/lib/gcc-lib/i486-linux/2.7.2.3/cc1 /tmp/cca22747.i -quiet -dumpbase ghc22730.c
-O -Wimplicit -version -fomit-frame-pointer -fno-defer-pop -o ghc22730.s
GNU C version 2.7.2.3 (i386 Linux/ELF) compiled by GNU C version egcs-2.90.29 980515
(egcs-1.0.3 release).
0.73user 0.10system 0:00.96elapsed 86%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (484major+429minor)pagefaults 0swaps
Unix assembler:
gcc -o Main.o -c -I. -I/usr/local/lib/ghc-4.04/includes
-I/usr/local/lib/ghc-4.04/includes /tmp/ghc22730.s
0.04user 0.01system 0:00.06elapsed 83%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (216major+83minor)pagefaults 0swaps
Linker:
gcc -v -u PrelMain_mainIO_closure -u PrelBase_Izh_static_info -u
PrelBase_Czh_static_info -u PrelBase_Fzh_static_info -u PrelBase_Dzh_static_info -u
PrelAddr_Azh_static_info -u PrelAddr_Wzh_static_info -u PrelAddr_I64zh_static_info -u
PrelAddr_W64zh_static_info -u PrelStable_StablePtr_static_info -u
PrelBase_Izh_con_info -u PrelBase_Czh_con_info -u PrelBase_Fzh_con_info -u
PrelBase_Dzh_con_info -u PrelAddr_Azh_con_info -u PrelAddr_Wzh_con_info -u
PrelAddr_I64zh_con_info -u PrelAddr_W64zh_con_info -u PrelStable_StablePtr_con_info -u
PrelBase_False_static_closure -u PrelBase_True_static_closure -u
PrelPack_unpackCString_closure -u PrelException_stackOverflow_closure -u
PrelException_heapOverflow_closure -u PrelException_NonTermination_static_closure -o
hello Main.o -L/usr/local/lib/ghc-4.04 -lHS -lHS_cbits -lHSrts -lgmp -lm
Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2.3/specs
gcc version 2.7.2.3
/usr/i486-linux/bin/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 -o hello -u
PrelMain_mainIO_closure -u PrelBase_Izh_static_info -u PrelBase_Czh_static_info -u
PrelBase_Fzh_static_info -u PrelBase_Dzh_static_info -u PrelAddr_Azh_static_info -u
PrelAddr_Wzh_static_info -u PrelAddr_I64zh_static_info -u PrelAddr_W64zh_static_info
-u PrelStable_StablePtr_static_info -u PrelBase_Izh_con_info -u PrelBase_Czh_con_info
-u PrelBase_Fzh_con_info -u PrelBase_Dzh_con_info -u PrelAddr_Azh_con_info -u
PrelAddr_Wzh_con_info -u PrelAddr_I64zh_con_info -u PrelAddr_W64zh_con_info -u
PrelStable_StablePtr_con_info -u PrelBase_False_static_closure -u
PrelBase_True_static_closure -u PrelPack_unpackCString_closure -u
PrelException_stackOverflow_closure -u PrelException_heapOverflow_closure -u
PrelException_NonTermination_static_closure /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i486-linux/2.7.2.3/crtbegin.o -L/usr/local/lib/ghc-4.04
-L/usr/local/qt/lib -L. -L/usr/lib/gcc-lib/i486-linux!
/2!
!
!
.7.2.3 -L/usr/i486-linux/lib Main.o -lHS -lHS_cbits -lHSrts -lgmp -lm -lgcc -lc -lgcc
/usr/lib/gcc-lib/i486-linux/2.7.2.3/crtend.o /usr/lib/crtn.o
/usr/local/lib/ghc-4.04/libHSrts.a(Schedule.o): In function `raiseAsync':
Schedule.o(.text+0x837): undefined reference to `data_start'
/usr/local/lib/ghc-4.04/libHSrts.a(GC.o): In function `isAlive':
GC.o(.text+0xbac): undefined reference to `data_start'
/usr/local/lib/ghc-4.04/libHSrts.a(GC.o): In function `scavenge_stack':
GC.o(.text+0x22e5): undefined reference to `data_start'
Command exited with non-zero status 1
1.28user 0.32system 0:02.80elapsed 57%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (336major+634minor)pagefaults 0swaps
deleting... hello
rm -f /tmp/ghc22730*
======================================================================
Dr Mark Utting, Senior Lecturer
Department of Computer Science
School of Computing and Mathematical Sciences
The University of Waikato Tel: +64 7 838 4791
Private Bag 3105 Fax: +64 7 838 4155
Hamilton Email: [EMAIL PROTECTED]
New Zealand Web: http://www.cs.waikato.ac.nz/~marku