From 836b5f6afa06e1dbf49a56a13004402709104f29 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 30 Mar 2012 15:07:12 +0000 Subject: [PATCH] gf.cabal: removing -O2 Removing "ghc-options: -O2" from gf.cabal has the following advantages: + Compiling GF is faster (time drops from 182s to 142s on my laptop) + Compiling the RGL is faster (time drops from 159s to 155s on my laptop) + Without the hardwired optimization level, the 'cabal configure' options --enable-optimization= and --disable-optimization work as expected (so if you still want -O2, use --enable-optimization=2) + GF can be compiled with ghc-7.2.2 and ghc-7.4.1 (-O2 triggers a bug in these versions of ghc, it seems. Another workaround, discovered by Sergei Trofimovich, is to use -O0 in Data.Binary.) --- gf.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gf.cabal b/gf.cabal index 76c290126..4c9e550b3 100644 --- a/gf.cabal +++ b/gf.cabal @@ -50,7 +50,7 @@ library random, pretty, mtl - ghc-options: -O2 +--ghc-options: -O2 hs-source-dirs: src/compiler src/runtime/haskell extensions: exposed-modules: @@ -119,7 +119,7 @@ executable gf ghc-prof-options: -auto-all - ghc-options: -O2 +--ghc-options: -O2 if impl(ghc>=7.0) ghc-options: -rtsopts hs-source-dirs: src/compiler src/runtime/haskell