Quantcast

Problems building HEAD

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Problems building HEAD

Reilly Hayes

I'm trying to build head (latest try with ghc-6.5.20060429) for my macbook pro (Mac OS X intel) using hc files built on a x86 linux (Ubuntu Breezy Badger).  I have the following issues:


1) Issues with bookstrap.mk

bootstrap.mk in head contains the following lines

TOP_SAVED := $(TOP)
TOP:=$(TOP)/ghc

include $(TOP)/mk/version.mk
include $(TOP)/mk/paths.mk

# Reset TOP
TOP:=$(TOP_SAVED)

However, those files are not at those locations.  Looking back at 6.4.2, it seems that they were in those locations in 6.4.2, but that changes in the directory structure mean that the line that sets top to $(TOP)/ghc is obsolete.  version.mk is nowhere to be seen, nor is version.mk.in.  It looks as if the variables set in this file are now set in config.mk and that version.mk is no longer required.  If that's true, I can replace all of the lines above with:

include $(TOP)/mk/paths.mk

2) Building the .hc files

The building guide says that I can build hc files on another host running on the same platform.  The word platform seems to be used to describe architecture in some places and architecture & O/S in others.  I have assumed that it means architecture in this case (if we already have a compiler that runs on the same Arch & OS, why are we porting).

What the building guide does not do is provide instructions for producing registerized hc files.  The recipe I have stumbled onto is this

a) Create mk/build.mk and add the following lines:

GhcLibHcOpts = -O -fvia-C -keep-hc-files
GhcRtsHcOpts = -keep-hc-files
GhcStage1HcOpts = -O -fvia-C -keep-hc-files
GhcStage2HcOpts = -O -fvia-C -keep-hc-files

b) run "./configure"
c) run "make"
d) I want to run "make hc-file-bundle Project=ghc", but it complains
about a few missing files.  So first I cd to rts and
run "make AutoApply.hc AutoApply_p.hc AutoApply_thr.hc \
AutoApply_thr_p.hc AutoApply_debug.hc AutoApply_thr_debug.hc"
e) run "make hc-file-bundle Project=ghc", which works just fine.
f) untar the resulting file in the parent directory of ghc-6.5.20060429 on the target machine

3) running the build. 

I'm following the steps in distrib/hc-build by hand, which work out to:

./configure --enable-hc-boot
make -C utils boot all
make -C ghc boot
make -C libraries boot all GhcBootLibs=YES
make -C ghc all

Is this all correct?  I'm having problems with the build in utils, but by then I've already made enough assumptions about how to fix the build that there's little point in asking the question until I've verified that I haven't messed things up upstream.

Reilly Hayes




_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Problems building HEAD

Simon Marlow-5
Reilly Hayes wrote:

> 1) Issues with bookstrap.mk
>
> bootstrap.mk in head contains the following lines
>
> TOP_SAVED := $(TOP)
> TOP:=$(TOP)/ghc
>
> include $(TOP)/mk/version.mk
> include $(TOP)/mk/paths.mk
>
> # Reset TOP
> TOP:=$(TOP_SAVED)

Yes, none of that is required any more.  Thanks.

> 2) Building the .hc files
>
> The building guide says that I can build hc files on another host
> running on the same platform.  The word platform seems to be used to
> describe architecture in some places and architecture & O/S in others.  
> I have assumed that it means architecture in this case (if we already
> have a compiler that runs on the same Arch & OS, why are we porting).
>
> What the building guide does not do is provide instructions for
> producing registerized hc files.

Right - it's a build method that is even less well supported than doing
an unregisterised bootstrap, because it is rarely needed.  You can
always do an unregisterised bootstrap first, and use that compiler to
build a registerised version.  Bootstrapping direct to registerised just
misses out one stage.

>  The recipe I have stumbled onto is this
>
> a) Create mk/build.mk and add the following lines:
>
> GhcLibHcOpts = -O -fvia-C -keep-hc-files
> GhcRtsHcOpts = -keep-hc-files
> GhcStage1HcOpts = -O -fvia-C -keep-hc-files
> GhcStage2HcOpts = -O -fvia-C -keep-hc-files
>
> b) run "./configure"
> c) run "make"
> d) I want to run "make hc-file-bundle Project=ghc", but it complains
> about a few missing files.  So first I cd to rts and
> run "make AutoApply.hc AutoApply_p.hc AutoApply_thr.hc \
> AutoApply_thr_p.hc AutoApply_debug.hc AutoApply_thr_debug.hc"
> e) run "make hc-file-bundle Project=ghc", which works just fine.
> f) untar the resulting file in the parent directory of ghc-6.5.20060429
> on the target machine
>
> 3) running the build.
>
> I'm following the steps in distrib/hc-build by hand, which work out to:
>
> ./configure --enable-hc-boot
> make -C utils boot all
> make -C ghc boot
> make -C libraries boot all GhcBootLibs=YES
> make -C ghc all
>
> Is this all correct?  I'm having problems with the build in utils, but
> by then I've already made enough assumptions about how to fix the build
> that there's little point in asking the question until I've verified
> that I haven't messed things up upstream.

You're in uncharted territory to some extent, because I don't think
anyone has gone through the bootstrapping process with 6.5 since the
recent source tree reorganisation.

If you're willing to be a guinnea pig, that's great :-)

I'm guessing the sequence should be something like this:

./configure --enable-hc-boot
$MAKE -C utils/mkdependC boot all
$MAKE -C includes boot all
$MAKE -C rts boot all
$MAKE -C libraries boot all GhcBootLibs=YES
$MAKE -C compat boot all
$MAKE -C utils boot all
$MAKE -C compiler boot all

Try that, and let me know how far you get.

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Problems building HEAD

Reilly Hayes

Simon,

Thanks for all your help.

I've tried file individual messages when I'm pretty sure I've  
identified a problem with the distribution itself.  However, I  
thought it might be useful to post more on my experiences in creating  
this build.

1) REGISTERISED HC FILE CREATION (on Linux x86)

The way I built the registerised .hc files in the original e-mail  
missed several.  However, doing a vanilla make with the following mk/
build.mk file will generate them:

------
SRC_HC_OPTS     = -H32m -O -fasm -Rghc-timing -keep-hc-files
GhcStage1HcOpts = -O0 -DDEBUG
GhcLibHcOpts    = -O
GhcLibWays      =
SplitObjs       = NO
----

make hc-file-bundle Project=ghc creates the tar file with the hc files.


2) REGISTERISED HC FILE BOOT (on Mac OS X 10.4.6 x86)

On May 2, 2006, at 4:51 AM, Simon Marlow wrote:

>
>
> I'm guessing the sequence should be something like this:
>
> ./configure --enable-hc-boot
> $MAKE -C utils/mkdependC boot all
> $MAKE -C includes boot all
> $MAKE -C rts boot all
> $MAKE -C libraries boot all GhcBootLibs=YES
> $MAKE -C compat boot all
> $MAKE -C utils boot all
> $MAKE -C compiler boot all
>
> Try that, and let me know how far you get.
>
> Cheers,
> Simon

I've managed to build a stage1 compiler that executes, but I'm not  
sure it works.  I tried a hello world test program as suggested in  
the documentation.  It fails to compile because it can't find the .hi  
files for the prelude.  But, if I understand correctly, I won't  
have .hi files until I've rebuilt the libraries with the stage1  
compiler.  Is this right?


3) Refinements to your directions

The following need to be made prior to building RTS

$MAKE -C utils/unlit boot all
$MAKE -C utils/mkdirhier boot all
$MAKE -C driver/mangler

The RTS build generates endless warnings about .o files having no  
symbols and functions not having previous prototypes.  I googled for  
both and is seems that it is OK, but I would like confirmation.

utils/genprimopcode is problematic.  The libraries build fails  
without it, but it wants the libraries to be built in order to link.  
SOMEHOW (I think by typing 'make' at the top level) I ended up with a  
viable executable for this.  Unfortunately, I can't recreate it from  
scratch.  Now that I have it, I admit that I've taken to using it to  
salt new builds rather than figure out what is going on.

The following

readline and ncurses are problematic on the Mac and should be  
replaced with verisons from gnu.  Thanks to whoever posted bug #766,  
I used the following procedure prior to running configure.

        o  Download ncurses and readline and install them into /usr/local/
lib.  Be sure to build ncurses as shared.
        o  set & export  LD_FLAGS=-L/usr/local/lib and CPP_FLAGS=-I/usr/
local/include
        o  make sure these are in your environment when you configure and do  
your build.


cheers,

Reilly Hayes





_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Problems building HEAD

Simon Marlow
On 09 May 2006 21:19, Reilly Hayes wrote:

> The way I built the registerised .hc files in the original e-mail
> missed several.  However, doing a vanilla make with the following mk/
> build.mk file will generate them:
>
> ------
> SRC_HC_OPTS     = -H32m -O -fasm -Rghc-timing -keep-hc-files
> GhcStage1HcOpts = -O0 -DDEBUG
> GhcLibHcOpts    = -O
> GhcLibWays      =
> SplitObjs       = NO
> ----
>
> make hc-file-bundle Project=ghc creates the tar file with the hc
> files.

Thanks, I've added this to the documentation.

> I've managed to build a stage1 compiler that executes, but I'm not
> sure it works.  I tried a hello world test program as suggested in
> the documentation.  It fails to compile because it can't find the .hi
> files for the prelude.  But, if I understand correctly, I won't
> have .hi files until I've rebuilt the libraries with the stage1
> compiler.  Is this right?

Yes.

> 3) Refinements to your directions
>
> The following need to be made prior to building RTS
>
> $MAKE -C utils/unlit boot all
> $MAKE -C utils/mkdirhier boot all
> $MAKE -C driver/mangler
>
> The RTS build generates endless warnings about .o files having no
> symbols and functions not having previous prototypes.  I googled for
> both and is seems that it is OK, but I would like confirmation.

I can't remember the cause - if you send me a sample of the messages I
might remember.

> utils/genprimopcode is problematic.  The libraries build fails
> without it, but it wants the libraries to be built in order to link.
> SOMEHOW (I think by typing 'make' at the top level) I ended up with a
> viable executable for this.  Unfortunately, I can't recreate it from
> scratch.  Now that I have it, I admit that I've taken to using it to
> salt new builds rather than figure out what is going on.

genprimopcode *should* be compilable because it has .hc files, so it
shouldn't need .hi files from the libraries, in the same way that GHC
itself is compilable.  I imagine there's an ordering problem or somesuch
somewhere, but I'll have to try this myself sometime.

> The following
>
> readline and ncurses are problematic on the Mac and should be
> replaced with verisons from gnu.  Thanks to whoever posted bug #766,
> I used the following procedure prior to running configure.
>
> o  Download ncurses and readline and install them into
/usr/local/
> lib.  Be sure to build ncurses as shared.
> o  set & export  LD_FLAGS=-L/usr/local/lib and CPP_FLAGS=-I/usr/
> local/include
> o  make sure these are in your environment when you configure
and do
> your build.

Ok, thanks.

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Loading...