the flag -N2 requires the program to be built with -threaded

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

the flag -N2 requires the program to be built with -threaded

Jung Kim
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
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: the flag -N2 requires the program to be built with -threaded

Sumit Sahrawat, Maths & Computing,
 IIT (BHU)
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 <[hidden email]> 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
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: the flag -N2 requires the program to be built with -threaded

Jung Kim
I changed to the suggested solution and that fixes the problem. Thank
you very much!

On 23 March 2016 at 14:25, Sumit Sahrawat, Maths & Computing, IIT
(BHU) <[hidden email]> wrote:

> 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 <[hidden email]> 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
>> [hidden email]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners