# Are any compiler flags set on the online judge?

**URL:** <https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866>\
**Category:** faq\
**Tags:** compiler, faq\
**Created:** [April 10, 2013, 3:55pm UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866 "2013-04-10T15:55:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anup](https://discuss.codechef.com/user_avatar/discuss.codechef.com/anup/32/257725_2.png) [@anup](https://discuss.codechef.com/u/anup)\
**Post date:** [April 10, 2013, 3:55pm UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866/1 "2013-04-10T15:55:52Z")

</div>

Does the online judge have any compiler flags set?

---

<div class="post-metadata">

**Author:** ![admin](https://discuss.codechef.com/user_avatar/discuss.codechef.com/admin/32/212587_2.png) [@admin](https://discuss.codechef.com/u/admin)\
**Post date:** [April 10, 2013, 3:56pm UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866/2 "2013-04-10T15:56:29Z")

</div>

This is the updated information regarding flags on the compilers set by online judge as of March 2024.

- **C++ :**

```auto
O2 - second optimization level,
lm - access to "math.h" library,
fomit-frame-pointer - disallow to store frame pointer in CPU register,
pthread - enable multithreading 

```

- **C :**

```auto
O2 - second optimization level,
lm - access to "math.h" library,
fomit-frame-pointer - disallow to store frame pointer in CPU register,
pthread - enable multithreading

```

- **Rust :**

```auto
opt-level=2 - second optimization level
edition=2024

```

### Runtime Flags

- **Java :**

```auto
Xss64m

```

- \*\* PyPy 3 :\*\*

```auto
OO

```

---

<div class="post-metadata">

**Author:** ![betlista](https://discuss.codechef.com/user_avatar/discuss.codechef.com/betlista/32/203_2.png) [@betlista](https://discuss.codechef.com/u/betlista)\
**Post date:** [April 10, 2013, 4:00pm UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866/3 "2013-04-10T16:00:30Z")

</div>

Here is more complete answer - [What are the compiler options that the judge uses? - faq - CodeChef Discuss](http://discuss.codechef.com/questions/3480/what-are-the-compiler-options-that-the-judge-uses)

Previous part is from FAQ - [FAQ | CodeChef](http://www.codechef.com/wiki/faq#Are_any_compiler_flags_set_on_the_online_judge)

---

<div class="post-metadata">

**Author:** ![xyzzy529](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@xyzzy529](https://discuss.codechef.com/u/xyzzy529)\
**Post date:** [January 5, 2015, 8:59am UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866/4 "2015-01-05T08:59:32Z")

</div>

Is ONLINE\_JUDGE actually set properly?

Please look at [this question](http://discuss.codechef.com/questions/60767/defined-online_judge-for-testing-and-real-judge-runs) for an example.

Thanks.

---

<div class="post-metadata">

**Author:** ![betlista](https://discuss.codechef.com/user_avatar/discuss.codechef.com/betlista/32/203_2.png) [@betlista](https://discuss.codechef.com/u/betlista)\
**Post date:** [January 5, 2015, 4:07pm UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866/5 "2015-01-05T16:07:49Z")

</div>

You can check yourself, for example by throwing exception if not set 😉 If there is flag missing, please write an e-mail to [bugs@codechef.com](mailto:bugs@codechef.com)

---

<div class="post-metadata">

**Author:** ![xyzzy529](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@xyzzy529](https://discuss.codechef.com/u/xyzzy529)\
**Post date:** [January 5, 2015, 11:47pm UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866/6 "2015-01-05T23:47:04Z")

</div>

I did check and it is ALSO being set for the IDE (which is not what we want).

Sent email to bugs. Thanks.

---

<div class="post-metadata">

**Author:** ![abcdexter24](https://discuss.codechef.com/user_avatar/discuss.codechef.com/abcdexter24/32/7452_2.png) [@abcdexter24](https://discuss.codechef.com/u/abcdexter24)\
**Post date:** [June 25, 2016, 11:23am UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866/7 "2016-06-25T11:23:50Z")

</div>

Also, we can use `#ifdef` instead, right ?

---

<div class="post-metadata">

**Author:** ![andersk](https://discuss.codechef.com/user_avatar/discuss.codechef.com/andersk/32/12030_2.png) [@andersk](https://discuss.codechef.com/u/andersk)\
**Post date:** [May 14, 2019, 1:59am UTC](https://discuss.codechef.com/t/are-any-compiler-flags-set-on-the-online-judge/1866/8 "2019-05-14T01:59:26Z")

</div>

Rust code is not being compiled with `-O` as claimed, and this is slowing down Rust submissions dramatically, making Rust unusable for many problems. ☹

See [Bug report: Rust code is being compiled in debug mode without optimization](https://discuss.codechef.com/t/bug-report-rust-code-is-being-compiled-in-debug-mode-without-optimization/24530) for reproducible proof. ~~I’ve gotten no response yet from my report to bugs@.~~ (Edit: Actually I got a reasonably quick “we’ll look into this” response that landed in my spam folder, but that’s all so far.)
