Building GHC on Mac stops

Austin Seipp aseipp at pobox.com
Fri Aug 16 00:14:16 CEST 2013


Simon,

Edsko luckily already is two steps ahead and filed the ticket as Kazu
notes. However, while I *did* see this bug before, I've had a difficult
time reproducing it now. None of the builds on my amd64/linux machine this
week have triggered it. Kazu - perhaps are you still seeing this
consistently on your Mac?

I looked around and it *looks* like we actually get the dependency for
mkGmpDerivedConstants right. Note under
./libraries/integer-gmp/mkGmpDerivedConstants/ghc.mk we have:

---
...
ifneq "$(HaveLibGmp)" "YES"
ifneq "$(HaveFrameworkGMP)" "YES"
$(libraries/integer-gmp/mkGmpDerivedConstants_dist_depfile_c_asm):
libraries/integer-gmp/gmp/gmp.h
endif
endif
...
---

and also in gmp/ghc.mk:

---
libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h:
... run configure, etc
---

I will keep digging on my Mac machine, although it's very slow to build at
the moment, so the race may be hard to trigger.

On Thu, Aug 15, 2013 at 4:12 PM, Kazu Yamamoto <kazu at iij.ad.jp> wrote:

> Simon,
>
> We have a ticket for this:
>
>         http://ghc.haskell.org/trac/ghc/ticket/8102
>
> We guessed the source of this bug as described in this ticket but I
> don't know how to write GNU Makefile.
>
> --Kazu
>
> > Austin
> >
> > This looks like a make-system bug, based on a cursory read.  Worth a
> ticket?  Do you know enough about the build system to fix it?  It's clearly
> annoying!
> >
> > Simon Marlow and/or Ian Lynagh may well be able to help
> >
> > Simon
> >
> > -----Original Message-----
> > From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Kazu
> Yamamoto
> > Sent: 06 August 2013 13:00
> > To: ghc-devs at haskell.org
> > Subject: Re: Building GHC on Mac stops
> >
> > Hi Nicolas,
> >
> > My guess is here: libraries/integer-gmp/configure generates "gmp.h".
> > Building mkGmpDerivedConstants starts in parallel.  Since "configure"
> > takes time, "mkGmpDerivedConstants" is build before "gmp.h" is
> > created.
> >
> > How can we ensure that these two jobs are carried out sequentially?
> >
> > --Kazu
> >
> >> I never determined how to fix this. Here's the notes I developed:
> >>
> >> tl;dr For some reason, it seems gmp.h is not recognized as a dependency
> of
> >> mkGmpDerivedConstants.o
> >>
> >> HTH
> >>
> >> -----
> >>
> >> If I run
> >>
> >> $ perl boot; ./configure; make -j4
> >>
> >> I tend to see a build failure. Immediately running make -j4 again
> succeeds.
> >>
> >> In the following snippet from the log,
> >> FILE=libraries/integer-gmp/mkGmpDerivedConstants/mkGmpDerivedConstants.c
> >>
> >> {{{
> >> "/usr/bin/gcc"  -m64 -fno-stack-protector
> >>   -Ilibraries/integer-gmp/gmp
> >> -Ilibraries/integer-gmp/mkGmpDerivedConstants/dist
> >>   -c FILE -o
> >>
> libraries/integer-gmp/mkGmpDerivedConstants/dist/build/mkGmpDerivedConstants.o
> >>
> >> FILE:15:17: error: gmp.h: No such file or directory
> >> FILE: In function ¡main¢:
> >> FILE:68: error: ¡MP_INT¢ undeclared (first use in this function)
> >> FILE:68: error: (Each undeclared identifier is reported only once
> >> FILE:68: error: for each function it appears in.)
> >> FILE:69: error: expected expression before ¡)¢ token
> >> FILE:69: error: expected expression before ¡)¢ token
> >> FILE:70: error: expected expression before ¡)¢ token
> >> FILE:70: error: expected expression before ¡)¢ token
> >> FILE:71: error: expected expression before ¡)¢ token
> >> FILE:71: error: expected expression before ¡)¢ token
> >> make[1]: ***
> >>
> [libraries/integer-gmp/mkGmpDerivedConstants/dist/build/mkGmpDerivedConstants.o]
> >> Error 1
> >> make[1]: *** Waiting for unfinished jobs....
> >> }}}
> >>
> >> Some 1677 lines later, I see the line
> >>
> >>> cp libraries/integer-gmp/gmp/gmpbuild/gmp.h libraries/integer-gmp/gmp/
> >>
> >> Which is I suppose why make -j4 succeeds the second time around.
> >>
> >> I also see
> >>
> >>> libraries/integer-gmp/mkGmpDerivedConstants/ghc.mk:20:
> >> libraries/integer-gmp/mkGmpDerivedConstants/dist/build/.depend.c_asm: No
> >> such file or directory
> >>
> >> many lines above.
> >>
> >> On Mon, Aug 5, 2013 at 9:26 PM, Kazu Yamamoto <kazu at iij.ad.jp> wrote:
> >>
> >>> Hi,
> >>>
> >>> I'm using GHC head (32bit) on Mac. Recently, building GHC head
> >>> stops:
> >>>
> >>> ----
> >>> % make maintainer-clean; perl boot; ./configure --prefix=/ghc-head;
> make
> >>> -j3
> >>> ranlib: file: .libs/libgmp.a(mp_clz_tab.o) has no symbols
> >>> ranlib: file: .libs/libgmp.a(obprintf.o) has no symbols
> >>> ranlib: file: .libs/libgmp.a(obvprintf.o) has no symbols
> >>> ranlib: file: .libs/libgmp.a(obprntffuns.o) has no symbols
> >>> ranlib: file: .libs/libgmp.a(repl-vsnprintf.o) has no symbols
> >>> libtool: link: rm -fr .libs/libgmp.lax
> >>> libtool: link: ( cd ".libs" && rm -f "libgmp.la" && cp -p "../
> libgmp.la" "
> >>> libgmp.la" )
> >>> cp libraries/integer-gmp/gmp/gmpbuild/gmp.h libraries/integer-gmp/gmp/
> >>> cp libraries/integer-gmp/gmp/gmpbuild/.libs/libgmp.a
> >>> libraries/integer-gmp/gmp/
> >>> inplace/bin/mkdirhier libraries/integer-gmp/gmp/objs
> >>> cd libraries/integer-gmp/gmp/objs && /usr/bin/ar x ../libgmp.a
> >>> ranlib libraries/integer-gmp/gmp/libgmp.a
> >>> ranlib: file: libraries/integer-gmp/gmp/libgmp.a(mp_clz_tab.o) has no
> >>> symbols
> >>> ranlib: file: libraries/integer-gmp/gmp/libgmp.a(obprintf.o) has no
> symbols
> >>> ranlib: file: libraries/integer-gmp/gmp/libgmp.a(obvprintf.o) has no
> >>> symbols
> >>> ranlib: file: libraries/integer-gmp/gmp/libgmp.a(obprntffuns.o) has no
> >>> symbols
> >>> ranlib: file: libraries/integer-gmp/gmp/libgmp.a(repl-vsnprintf.o) has
> no
> >>> symbols
> >>> make: *** [all] Error 2
> >>> %
> >>> ----
> >>>
> >>> One more "make -j3" finishes the building. I'm sure that this does not
> >>> happen before.
> >>>
> >>> Are there any guys who get this problem?
> >>>
> >>> --Kazu
> >>>
> >>> _______________________________________________
> >>> ghc-devs mailing list
> >>> ghc-devs at haskell.org
> >>> http://www.haskell.org/mailman/listinfo/ghc-devs
> >>>
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs at haskell.org
> > http://www.haskell.org/mailman/listinfo/ghc-devs
> >
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs at haskell.org
> > http://www.haskell.org/mailman/listinfo/ghc-devs
>



-- 
Regards,
Austin - PGP: 4096R/0x91384671
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130815/9194f936/attachment.htm>


More information about the ghc-devs mailing list