Building GHC on Mac OS X or Fixing readline

I've attempted to compile GHC 6.01 from sources for Mac OS X, but after a successful configure, make soon grinds to a halt (see "Listing 1" below). I'm looking for either: 1. A brief list of tips and tricks for getting GHC to build on Mac OS X (see "My Mac" below), or 2. A way to fix my broken readline package (see "Listing 2" below). Arthur Baars mentioned on 2003-07-18 (see "Message Link 1" below) that this problem had been fixed in 6.0.1, and the GHC Downloads page mentions that the readline library must be installed. I've installed GHC 6.0.1 using Wolfgang Thaller's Mac OS X package and I (subsequently) installed readline 4.3, but GHCi still panics, and I also tried Arthur's "quick fix" without success. Thanks for any helpful suggestions, - Kennis ----- Kennis Koldewyn (koldewyn@cloud9.net) ----- Without computers, it would be virtually impossible for us to accompliowur xow;gkc,mf(&( - Dave Barry ----- Start of Listing 1 ----- ==fptools== make boot - --no-print-directory -r; in /Users/kennis/Downloads/ghc-6.0.1/ghc/utils/ghc-pkg ------------------------------------------------------------------------ /usr/local/bin/ghc -M -optdep-f -optdep.depend -osuf o -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY Main.hs Package.hs ParsePkgConfLite.hs make all /usr/local/bin/ghc -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY -c Package.hs -o Package.o -ohi Package.hi Package.hs:1: parse error on input `#' make[4]: *** [Package.o] Error 1 make[3]: *** [boot] Error 2 make[2]: *** [boot] Error 1 make[1]: *** [boot] Error 1 make: *** [build] Error 1 ----- End of Listing 1 ----- ----- Start of My Mac ----- I'm running Mac OS 10.2.8 on an 800 MHz PowerPC G3 12" iBook with 384 MB of memory: [/Users/kennis] uname -a Darwin Voxel.local. 6.8 Darwin Kernel Version 6.8: Wed Sep 10 15:20:55 PDT 2003; root:xnu/xnu-344.49.obj~2/RELEASE_PPC Power Macintosh powerpc [/Users/kennis] gcc --version gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1493) ----- End of My Mac ----- ----- Start of Listing 2 ----- [/Users/kennis] ghci -package util ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.0.1, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base ... linking ... done. Loading package lang ... linking ... done. Loading package concurrent ... linking ... done. Loading package readline ... linking ... /usr/local/lib/ghc-6.0.1/HSreadline.o: unknown symbol `_rl_free_undo_list' ghc-6.0.1: panic! (the `impossible' happened, GHC version 6.0.1): can't load package `readline' ----- End of Listing 2 ----- ----- Message Link 1 ----- http://www.mail-archive.com/glasgow-haskell-users@haskell.org/ msg05041.html ----- End Message Link 1 -----

Hi Kennis,
I've just made the GHC-6.0.1 port under darwinports work, so I know
what the problem is.
(Actually, I know what the problem is because Wolfgang told me :-) )
You're using gcc-3.3 and need to either compile HEAD from cvs or force
the build to
use gcc-3.1. Try running configure as
./configure --with-gcc=gcc3 --with-ghc='ghc -pgmP "gcc3 -E
-traditional"'
You may also need to add a one line mk/build.mk containing:
SRC_HC_OPTS += -pgmP "gcc3 -E -traditional"
The problem you are having is the gcc-3.3 preprocessor is fussier than
that of 3.1.
(I had looked at applying Wolfgang's patches piecemeal to 6.0.1 but
after several
almost-but-not-quite builds decided to just take the simple route.)
Regarding the second problem, whose dlcompat library are you using?
Note that if you just want to build ghc from scratch, you can download
the
darwinports system from opendarwin.org/projects/darwinports. Install it
and
then cd to the directory lang/ghc. Type sudo port -dv install and you
will install
ghc, along with compatible versions of dlcompat, gmp and readline.
(Or you can just peek at the Portfile and files/patch-* to see what I
had to do
to get the build to work.)
The only downside of the darwinports build of ghc is that it puts some
libraries
in
I've attempted to compile GHC 6.01 from sources for Mac OS X, but after a successful configure, make soon grinds to a halt (see "Listing 1" below). I'm looking for either:
1. A brief list of tips and tricks for getting GHC to build on Mac OS X (see "My Mac" below), or
2. A way to fix my broken readline package (see "Listing 2" below). Arthur Baars mentioned on 2003-07-18 (see "Message Link 1" below) that this problem had been fixed in 6.0.1, and the GHC Downloads page mentions that the readline library must be installed. I've installed GHC 6.0.1 using Wolfgang Thaller's Mac OS X package and I (subsequently) installed readline 4.3, but GHCi still panics, and I also tried Arthur's "quick fix" without success.
Thanks for any helpful suggestions,
- Kennis
----- Kennis Koldewyn (koldewyn@cloud9.net) ----- Without computers, it would be virtually impossible for us to accompliowur xow;gkc,mf(&( - Dave Barry
----- Start of Listing 1 ----- ==fptools== make boot - --no-print-directory -r; in /Users/kennis/Downloads/ghc-6.0.1/ghc/utils/ghc-pkg ----------------------------------------------------------------------- - /usr/local/bin/ghc -M -optdep-f -optdep.depend -osuf o -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY Main.hs Package.hs ParsePkgConfLite.hs make all /usr/local/bin/ghc -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY -c Package.hs -o Package.o -ohi Package.hi Package.hs:1: parse error on input `#' make[4]: *** [Package.o] Error 1 make[3]: *** [boot] Error 2 make[2]: *** [boot] Error 1 make[1]: *** [boot] Error 1 make: *** [build] Error 1 ----- End of Listing 1 -----
----- Start of My Mac ----- I'm running Mac OS 10.2.8 on an 800 MHz PowerPC G3 12" iBook with 384 MB of memory:
[/Users/kennis] uname -a Darwin Voxel.local. 6.8 Darwin Kernel Version 6.8: Wed Sep 10 15:20:55 PDT 2003; root:xnu/xnu-344.49.obj~2/RELEASE_PPC Power Macintosh powerpc [/Users/kennis] gcc --version gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1493) ----- End of My Mac -----
----- Start of Listing 2 ----- [/Users/kennis] ghci -package util ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.0.1, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help.
Loading package base ... linking ... done. Loading package lang ... linking ... done. Loading package concurrent ... linking ... done. Loading package readline ... linking ... /usr/local/lib/ghc-6.0.1/HSreadline.o: unknown symbol `_rl_free_undo_list' ghc-6.0.1: panic! (the `impossible' happened, GHC version 6.0.1): can't load package `readline' ----- End of Listing 2 -----
----- Message Link 1 ----- http://www.mail-archive.com/glasgow-haskell-users@haskell.org/ msg05041.html ----- End Message Link 1 -----
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Friday, Oct 31, 2003, at 08:56, Gregory Wright wrote:
I've just made the GHC-6.0.1 port under darwinports work, so I know what the problem is. (Actually, I know what the problem is because Wolfgang told me :-) )
You're using gcc-3.3 and need to either compile HEAD from cvs or force the build to use gcc-3.1. Try running configure as
./configure --with-gcc=gcc3 --with-ghc='ghc -pgmP "gcc3 -E -traditional"'
Well, it's been cranking along now for four or five hours, and is still compiling away, so that seems to be working.
Regarding the second problem, whose dlcompat library are you using?
[/Users/kennis/] cd /Library/Receipts/dlcompat-10505X.pkg/Contents/Resources/ [...505X.pkg/Contents/Resources] cat dlcompat-10505X.info Title dlcompat Version 20010505 ... What would I need to do if I got a more recent version (say 2003-06-29 from opendarwin.org)? Thanks for your help, - Kennis

On Oct 31, 2003, at 2:15 PM, Kennis Koldewyn wrote:
On Friday, Oct 31, 2003, at 08:56, Gregory Wright wrote:
I've just made the GHC-6.0.1 port under darwinports work, so I know what the problem is. (Actually, I know what the problem is because Wolfgang told me :-) )
You're using gcc-3.3 and need to either compile HEAD from cvs or force the build to use gcc-3.1. Try running configure as
./configure --with-gcc=gcc3 --with-ghc='ghc -pgmP "gcc3 -E -traditional"'
Well, it's been cranking along now for four or five hours, and is still compiling away, so that seems to be working.
Yes, it does take a long time---about 5 hours on my powerbook G4 800 MHz.
Regarding the second problem, whose dlcompat library are you using?
[/Users/kennis/] cd /Library/Receipts/dlcompat-10505X.pkg/Contents/Resources/ [...505X.pkg/Contents/Resources] cat dlcompat-10505X.info Title dlcompat Version 20010505 ...
What would I need to do if I got a more recent version (say 2003-06-29 from opendarwin.org)?
The problem with dlcompat is probably not the version, but that there are two different conventions regarding stripping leading underscores. GHC uses the 'fink' style convention, not the opendarwin convention. This will just drive you nuts. The best thing to do is to update ghc/rts/Linker.c. Look at the version in the cvs, and look where dlsym is called. Wolfgang has modified it in HEAD to use the native OS X dynamic symbol lookup procedure. Change just those few lines, otherwise you'll have to do more extensive upgrading to get the build to work again. Before you go to all this trouble, you might want to rebuild dlcompat with debugging turned on. If the symbol dlcompat says it is trying to find differs by an underscore from the one that GHCi complains about, you know the problem is there. Greg
Thanks for your help,
- Kennis
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Just to let everyone know how this all turned out: 1. My build of GHC 6.0.1 using gcc 3.1 completed successfully, and Gregory's hint to run configure as: ./configure --with-gcc=gcc3 --with-ghc='ghc -pgmP "gcc3 -E -traditional"' was the only change I needed to get it to work. 2. My problem with the readline package has gone away with my new build. However, Wolfgang tells me that my binary depends on the libreadline.dylib (version 4.3) I had installed at the time I made my build. Thanks again to Gregory and Wolfgang for your help! - Kennis ----- Kennis Koldewyn (koldewyn@cloud9.net) ----- Without computers, it would be virtually impossible for us to accompliowur xow;gkc,mf(&( - Dave Barry
participants (2)
-
Gregory Wright
-
Kennis Koldewyn