ho-jo-bo-ro-lo's blog

By ho-jo-bo-ro-lo, 5 years ago, In English,

UPD: Tested in Windows only, the command (-Wl,--stack,268435456) might be different for other OS

go to settings -> compiler

go to linker settings tab and add "-Wl,--stack,SIZE" in the other linker options section (i've set 256mb)

 
 
 
 
  • Vote: I like it
  • +29
  • Vote: I do not like it

»
5 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hi, I have this mistake: "unrecognized option --stack"

I'm working in Linux

  • »
    »
    5 years ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    The --stack flag is specific for Windows systems. On Linux, to get an unlimited stack, you should open a shell and run this command:

    $ ulimit -s unlimited
    

    And then (until you close that shell) the stack limit for that shell (and for the commands you will call from inside that shell, like ./program < input.txt and so on) will be unlimited.

    I'm not sure how to tell CodeBlocks to run that command every time you click "Run".

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      If you have Linux, you can probably set that command to run on start in some config file.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I didn't know that the commands are different for windows and linux, i'll update the title. If what [user:wild93] says is correct, then you can add that command in place of WI,--stack... that should execute the command every time

»
4 years ago, # |
  Vote: I like it +3 Vote: I do not like it

I chanced upon this blog yesterday and yesterday itself I got to use it to increase the size of the stack to run a dfs on about a million nodes(Coursera assignment with impending deadline).Thanks a lot to ho-jo-bo-ro-lo and also to Xellos for bringing this topic to 'Recent actions' section (as this post was inactive for about 4 months).