Блог пользователя wraith_11

Автор wraith_11, история, 2 года назад, По-английски

codeforces uses this command to compile C++ Codes g++ -Wall -Wextra -Wconversion -static -DONLINE_JUDGE -Wl,--stack=268435456 -O2 -std=c++20 <source> . When I am using this command on my Macbook Air M1, it's giving me the error unknown option: --stack=268435456. Can anyone tell me how do I increase the stack size for c++ codes during compilation on a Macbook, I am using gcc-homebrew 11.2.0

My compilation code is g++ -Wconversion -Davik_local -Wl,--stack=268435456 -O2 -std=c++20 Thank You!

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

This command which you are mentioning is for windows systems, for linux based systems use ulimit -s unlimited. This gives unlimited stack size but if you want limited ones like 256 MB then use the command ulimit -s <size in kb>.

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    now when I am using this command g++ -Wconversion -Davik_local ulimit -s <268435456> -O2 -std=c++20 its giving me error : syntax error near unexpected token268435456'` ,

    • »
      »
      »
      2 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      You dont use it like that!

      In the shell first use
      ulimit -s unlimited
      and then
      g++ -Wconversion -Davik_local -O2 -std=c++20