Solved ghc compile failed

I just finished installing 10.1 yesterday. Everything is going well except that lang/ghc is not compiling. I don't see anything in /usr/ports/UPDATING (except for upgrading).

make.conf:
Code:
MAKE_JOBS_NUMBER=1
Code:
HC [stage 1] compiler/stage2/build/Bag.p_o
  HC [stage 1] compiler/stage2/build/CmdLineParser.p_o
  HC [stage 1] compiler/stage2/build/DriverPhases.p_o
  HC [stage 1] compiler/stage2/build/PackageConfig.p_o
  HC [stage 1] compiler/stage2/build/PlatformConstants.p_o
  HC [stage 1] compiler/stage2/build/DynFlags.p_o
compiler/ghc.mk:640: recipe for target 'compiler/stage2/build/DynFlags.p_o' failed
Makefile:64: recipe for target 'all' failed
gmake[2]: Leaving directory '/usr/ports/lang/ghc/work/ghc-7.8.3'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/ghc
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/ghc

===>>> make build failed for lang/ghc
===>>> Aborting update


===>>> You can restart from the point of failure with this command line:
       portmaster <flags> lang/ghc
Thanks for any help you can provide.
 
Oh, and it looks like all the dependencies are installed.

Code:
root@:/usr/ports/lang/ghc # make depends 
===>   ghc-7.8.3_1 depends on file: /usr/local/sbin/pkg - found
===>   ghc-7.8.3_1 depends on shared library: libgmp.so - found (/usr/local/lib/libgmp.so.10.1.3)
===>   ghc-7.8.3_1 depends on shared library: libffi.so.6 - found (/usr/local/lib/libffi.so.6.0.1)
===>   ghc-7.8.3_1 depends on shared library: libiconv.so.3 - found (/usr/local/lib/libiconv.so.2.5.1)
===>   ghc-7.8.3_1 depends on file: /usr/local/bin/opt34 - found
===>   ghc-7.8.3_1 depends on file: /usr/local/share/xsl/docbook/html - found
===>   ghc-7.8.3_1 depends on file: /usr/local/bin/xsltproc - found
===>   ghc-7.8.3_1 depends on executable: gmake - found
===>   ghc-7.8.3_1 depends on executable: gcc48 - found
===>   ghc-7.8.3_1 depends on file: /usr/local/bin/as - found
===>   ghc-7.8.3_1 depends on file: /usr/local/bin/autoconf-2.69 - found
===>   ghc-7.8.3_1 depends on file: /usr/local/bin/perl5.18.4 - found
===>   ghc-7.8.3_1 depends on file: /usr/local/bin/opt34 - found
===>   ghc-7.8.3_1 depends on executable: gcc48 - found
 
I had the same error on my system (FreeBSD-10.1 amd64) with traversal.p_o. It causes a reboot.
I turned off option PROFILE, and it compiles fine.
 
Thank you but I still get the same make file error.

Code:
Warning: MonadUtils: could not find link destinations for:
    Data.Traversable.Id Data.Sequence.Id Compiler.Hoopl.Graph.VM Data.Traversable.StateL Data.Traversable.StateR Data.Sequence.State
Warning: FastString: could not find link destinations for:
    GHC.Prim.Addr#
Warning: Outputable: could not find link destinations for:
    Outputable.SDocContext Outputable.QueryQualifyName Outputable.QueryQualifyModule
Warning: BasicTypes: could not find link destinations for:
compiler/ghc.mk:640: recipe for target 'compiler/stage2/doc/html/ghc/ghc.haddock' failed
gmake[3]: *** [compiler/stage2/doc/html/ghc/ghc.haddock] Killed
gmake[2]: *** [all] Error 2
Makefile:64: recipe for target 'all' failed
gmake[2]: Leaving directory '/usr/ports/lang/ghc/work/ghc-7.8.3'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/ghc

I'll try setting make.conf back to
Code:
MAKE_JOBS_NUMBER=1
and try again without PROFILE checked.
 
Got it.

I did not include a swap file in my installation but I added it for this. It seems like there are a couple of ports that look for it. I'm not really sure why we need a swap file now (I thought that was a remnant of having little to no memory).

dmesg
Code:
pid 24193 (gcj-dbtool), uid 0: exited on signal 6 (core dumped)
pid 90086 (ghc-stage1), uid 0, was killed: out of swap space
pid 78572 (ghc-stage1), uid 0, was killed: out of swap space
pid 4267 (haddock), uid 0, was killed: out of swap space
pid 58668 (ghc-stage1), uid 0, was killed: out of swap space

Anyway, solved.
 
Some things need huge amounts of memory. It rarely hurts to have some swap, and the operating system really wants to have at least a little.
 
Thanks wblock,

I added a secondary hard drive; so no problem, but with just the ssd, I hate to do that. Isn't it a bit hard on 'em?
 
Back
Top