Building GHC on Mac OS X or Fixing readline

Gregory Wright gwright at comcast.net
Fri Oct 31 08:56:58 EST 2003


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 <darwinports_prefix>/lib, which not on the usual system library  
path. This requires
adding -L<darwinports_prefix>/lib explicitly to your invocations of  
ghc. This can
be fix, but I haven't bothered to do it yet.


Best WIshes,

Greg


On Oct 30, 2003, at 11:47 PM, Kennis Koldewyn wrote:

> 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 at 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>



More information about the Glasgow-haskell-users mailing list