[Haskell-beginners] the flag -N2 requires the program to be built with -threaded

Sumit Sahrawat, Maths & Computing, IIT (BHU) sumit.sahrawat.apm13 at iitbhu.ac.in
Wed Mar 23 06:25:25 UTC 2016


As there are a lot of options, ghc has a `--show-options` flag which shows
them all. The `-threaded` flag is to be passed to ghc.
I think the second command in the `all` block is redundant, as `ghc -O
mvar.hs` should produce a binary named mvar.

This should work:

all:
    ghc -O -threaded mvar.hs

Regards,
  Sumit

On 23 March 2016 at 10:49, Jung Kim <jungkkr at gmail.com> wrote:

> I am currently reading an article[1] where the author uses Haskell to
> explain her idea. The problem is I don't understand Haskell and am not
> familiar with Haskell concept like MVar, IVar, etc. (I can get the
> code compile, and have several years programming experiences.)
>
> When testing the code, it throws the error messages "the flag -N2
> requires the program to be built with -threaded"; however I can't find
> thread related flag with ghc command by `ghc --help`. How can I fix
> this problem?
>
> Environment I use: Debian stretch/sid, kernel 4.0.0-2-rt-686-pae, GHC
> version 7.10.3.
>
> The code is exactly the same as described in the section
> 'Nondeterminism with MVars' of article; and the makefile content is
>
> all:
>         ghc -O mvar.hs
>         ghc -o mvar mvar.o
> run:
>         ./execute # while true; do ./mvar +RTS -N2; done
> clean:
>         rm mvar
>
> Thanks
>
> [1].
> http://composition.al/blog/2013/09/22/some-example-mvar-ivar-and-lvar-programs-in-haskell/
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160323/5fd9c111/attachment.html>


More information about the Beginners mailing list