title: Using -with-rtsopts ghc option as a pragma
body: <p>I'm trying to solve an algorithm puzzle in Haskell, and to do so I need quite a big data structure. However the problem solving site I submit my solution to, doesn't use any run time options to allow bigger stack, but I've heard that I can use compiler options as pragma. I've tried using following pragma in my code:</p>
  
  <pre><code>{-# OPTIONS_GHC -O2 -rtsopts -with-rtsopts=-K32m #-}
  </code></pre>
  
  <p>Then I compile with <code>ghc --make algo.hs</code>. However, when I run on my machine on some big tests, program crashes with stack overflow, and reports that current stack size is 8MB. On the other hand, when I compile like that:</p>
  
  <pre><code>ghc -rtsopts -with-rtsopts=-K32M --make algo.hs -fforce-recomp
  </code></pre>
  
  <p>The program works just fine on the same data, without adding any <code>+RTS</code> arguments. I use GHC 7.0.2, but the problem solving site is using 6.12.3, so preferably I'm looking for solution that could work with that old version too.</p>