1

I'm trying to build ghc following the directions here: How to install Haskell Platform for Ubuntu 13.04?

I keep getting:

HC [stage 1] compiler/stage2/build/DynFlags.p_o Killed make[1]: ***
[compiler/stage2/build/DynFlags.p_o] Error 137 
make: *** [all] Error 2

I think I'm probably missing a dependency, but I have no idea which.

  • While compiling you don't run out of memory? It seems `make` is being killed by something (OOM killer?) – Salem Sep 30 '13 at 17:37

2 Answers2

1

Yup Salem had it right. It was an OOM issue. I increased the servers RAM from 512MB to 1024MB, and the problem was solved. Thanks!

0

I had the same problem building GHC-7.8.2 on a Raspberry Pi: the compiler ran out of memory while doing compiler/main/DynFlags.hs. But switching off optimisations on that particular step apparently keeps the memory use low enough so it works:

$ "/usr/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -H32m -O0 -package-conf libraries/bootstrapping.conf -package-name ghc-7.8.2 -hide-all-packages ...

Wheras make invokes it as ... -static -H32m -O -package-conf ....

After that, you can resume the normal (optimised) build of the other modules by running make again. I suppose the performance doesn't suffer too badly if that one module isn't optimised, in particular since it doesn't look like it really does anything critical – only, it's just really big!

leftaroundabout
  • 846
  • 7
  • 19
  • Mind, that did not get me through the entire building process... I eventually had to make more memory available anyway ([via swap to external HD](http://raspberrypi.stackexchange.com/questions/70/how-to-set-up-swap-space)) when `compiler/hsSyn/HsExpr.lhs` wouldn't compile even in `O0`. – leftaroundabout Apr 27 '14 at 17:13