I would like to create a Windows executable.
My program uses the async library for concurrently downloading files from a website.
I remember in order to run concurrent programs, I need to provide the appropriate flags, both compile time and runtime.
For console program launching, i can simply do:
./myprogram.exe +RTS -N4 for example.
But what should I do if myprogram.exe is to be launched by clicking it?
The user's guide says:
There are four ways to set RTS options:
- on the command line between +RTS ... -RTS, when running the program (Setting RTS options on the command line)
- at compile-time, using -with-rtsopts=⟨opts⟩ (Setting RTS options at compile time)
- with the environment variable GHCRTS (Setting RTS options with the GHCRTS environment variable)
- by overriding “hooks” in the runtime system (“Hooks” to change RTS behaviour)
The second bullet gets you where you want to go.
Additionally, many of the RTS options are programmatically controllable, in case you want to do some computation before choosing the value -- say, checking how many physical CPUs there are. For -N specifically, there is setNumCapabilities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With