DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
720 stars 254 forks source link

Add C++11 support #129

Closed elieux closed 10 years ago

elieux commented 10 years ago

ICPC contests seem to be gradually moving towards C++11 and UVa OJ is also giving the option. Could DOMjudge have C++11 configured by default?

eldering commented 10 years ago

The current C++ compile script simply uses the standard that GCC sets, and I prefer that as default over setting a specific version (which may not be available or well-supported, e.g. on older versions of GCC). It is very easy to modify, so I prefer to keep the default as is. Note that in the current master branch, we've moved the compile scripts to the database, so you only have to modify it in the admin webinterface once, and it gets distributed to all judgehosts automatically.

elieux commented 10 years ago

Thank you for the explanation.

dancju commented 8 years ago

C++11 still not supported in 2016?

corneym commented 8 years ago

This is something we do by altering the compile script in the cpp and c executable by adding an extra option:

For C++ add: -std=c++11

For C add: -std=c11

From: Daniel Chau [mailto:notifications@github.com] Sent: Sunday, 8 May 2016 12:32 PM To: DOMjudge/domjudge Subject: Re: [DOMjudge/domjudge] Add C++11 support (#129)

C++11 still not supported in 2016?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/DOMjudge/domjudge/issues/129#issuecomment-217684117 https://github.com/notifications/beacon/AClEDGHLargUMM-Ao1WlJjlSedhiAob4ks5p_UsYgaJpZM4BoyL2.gif

dancju commented 8 years ago

Do you mean C++11 is supported by DOMJudge without configuration?

I submitted a C++11 source code but got a compilation error. I am sure C++11 is supported on the judge machine.

corneym commented 8 years ago

If you have a version of a C++ or C compiler on your judgehost you just have to alter the compilation string in the C++ and/or C executable script via configuring the Web interface.

home --> executables --> cpp or (c) --> edit --> edit file contents --> select run tab

Change:

g++ -x c++ -Wall -O2 -static -pipe -DONLINE_JUDGE -DDOMJUDGE -o "$DEST" "$@"

gcc -x c -Wall -O2 -static -pipe -DONLINE_JUDGE -DDOMJUDGE -o "$DEST" "$@" –lm

to:

g++ -x c++ -Wall -O2 -std=c++11 -static -pipe -DONLINE_JUDGE -DDOMJUDGE -o "$DEST" "$@"

gcc -x c -Wall -O2 -std=c11 -static -pipe -DONLINE_JUDGE -DDOMJUDGE -o "$DEST" "$@" –lm

and save

From: Daniel Chau [mailto:notifications@github.com] Sent: Sunday, 8 May 2016 2:10 PM To: DOMjudge/domjudge Cc: Malcolm Corney; Comment Subject: Re: [DOMjudge/domjudge] Add C++11 support (#129)

Do you mean C++11 is supported by DOMJudge without configuration?

I submitted a C++11 source code but got a compilation error. I am sure C++11 is supported on the judge machine.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/DOMjudge/domjudge/issues/129#issuecomment-217690287 https://github.com/notifications/beacon/AClEDJGeuxOW2jA746-RAjHNnb4g2kzvks5p_WIxgaJpZM4BoyL2.gif

dancju commented 8 years ago

found it. thank you :)