forked from DMOJ/judge-server
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM vnoj/runtimes-tiericpc | ||
|
||
ARG TAG=tiericpc | ||
|
||
RUN mkdir /judge /problems && cd /judge && \ | ||
curl -L https://github.com/VNOI-Admin/judge-server/archive/"${TAG}".tar.gz | tar -xz --strip-components=1 && \ | ||
python3 -m venv --prompt=DMOJ /env && \ | ||
/env/bin/pip3 install cython && \ | ||
/env/bin/pip3 install -e . && \ | ||
/env/bin/python3 setup.py develop && \ | ||
HOME=~judge . ~judge/.profile && \ | ||
runuser -u judge -w PATH -- /env/bin/dmoj-autoconf -V > /judge-runtime-paths.yml && \ | ||
echo ' crt_x86_in_lib32: true' >> /judge-runtime-paths.yml && \ | ||
/judge/.docker/download_testlib_and_precompile | ||
|
||
ENTRYPOINT ["/usr/bin/tini", "--", "/judge/.docker/entry"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from typing import List | ||
|
||
from dmoj.executors.base_executor import VersionFlags | ||
from dmoj.executors.c_like_executor import CExecutor, GCCMixin | ||
|
||
|
||
class Executor(GCCMixin, CExecutor): | ||
command = 'gcc' | ||
std = 'gnu11' | ||
command_paths = ['gcc'] | ||
|
||
test_program = """ | ||
#include <stdio.h> | ||
#if __STDC_VERSION__ == 201112 | ||
int main() { | ||
int ch; | ||
while ((ch = getchar()) != EOF) | ||
putchar(ch); | ||
return 0; | ||
} | ||
#endif | ||
""" | ||
|
||
def get_defines(self) -> List[str]: | ||
return self.defines | ||
|
||
def get_flags(self) -> List[str]: | ||
return ['-x', 'c', '-g', '-O2', '-std=gnu11', '-static', '-lm'] | ||
|
||
def get_compile_args(self) -> List[str]: | ||
command = self.get_command() | ||
assert command is not None | ||
return ( | ||
[command] | ||
+ (['-fdiagnostics-color=always'] if self.has_color else []) | ||
+ self.source_paths | ||
+ self.get_defines() | ||
+ self.get_flags() | ||
+ ['-o', self.get_compiled_file()] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from typing import List | ||
|
||
from dmoj.executors.base_executor import VersionFlags | ||
from dmoj.executors.c_like_executor import CPPExecutor, GCCMixin | ||
|
||
|
||
class Executor(GCCMixin, CPPExecutor): | ||
command = 'g++' | ||
command_paths = ['g++-11', 'g++'] | ||
std = 'gnu++20' | ||
test_program = """ | ||
#include <iostream> | ||
#if __cplusplus == 202002 | ||
int main() { | ||
std::strong_ordering comparison = 1 <=> 2; | ||
auto input = std::cin.rdbuf(); | ||
std::cout << input; | ||
return 0; | ||
} | ||
#endif | ||
""" | ||
|
||
def get_defines(self) -> List[str]: | ||
return self.defines | ||
|
||
def get_flags(self) -> List[str]: | ||
return ['-x', 'c++', '-g', '-O2', '-std=gnu++20', '-static'] | ||
|
||
def get_compile_args(self) -> List[str]: | ||
command = self.get_command() | ||
assert command is not None | ||
return ( | ||
[command] | ||
+ (['-fdiagnostics-color=always'] if self.has_color else []) | ||
+ self.source_paths | ||
+ self.get_defines() | ||
+ self.get_flags() | ||
+ ['-o', self.get_compiled_file()] | ||
) |