From e0d63964465b19dcbcec6c18788fa1aafb16f877 Mon Sep 17 00:00:00 2001 From: MasloMaslane Date: Sat, 23 Aug 2025 13:03:15 +0200 Subject: [PATCH 1/2] Update to g++14 with c++23 and python 3.13 --- example_package/prog/__ID__ingen.sh | 2 +- src/sinol_make/commands/export/__init__.py | 2 +- src/sinol_make/helpers/compile.py | 2 +- src/sinol_make/helpers/compiler.py | 10 +++++----- src/sinol_make/helpers/parsers.py | 4 ++-- tests/commands/export/util.py | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/example_package/prog/__ID__ingen.sh b/example_package/prog/__ID__ingen.sh index 8d59ccde..4520c5c2 100755 --- a/example_package/prog/__ID__ingen.sh +++ b/example_package/prog/__ID__ingen.sh @@ -15,7 +15,7 @@ sol_exe="$cache_dir/${task_id}solution" slo_exe="$cache_dir/${task_id}slow" stresstest_seconds=10 function compile_cpp { - g++ -std=c++20 -O3 -lm -Werror -Wall -Wextra -Wshadow -Wconversion -Wno-unused-result -Wfloat-equal "$1" -o "$2" \ + g++ -std=c++23 -O3 -lm -Werror -Wall -Wextra -Wshadow -Wconversion -Wno-unused-result -Wfloat-equal "$1" -o "$2" \ || exit 1 } diff --git a/src/sinol_make/commands/export/__init__.py b/src/sinol_make/commands/export/__init__.py index ddb3c12f..b135b082 100644 --- a/src/sinol_make/commands/export/__init__.py +++ b/src/sinol_make/commands/export/__init__.py @@ -210,7 +210,7 @@ def create_makefile_in(self, target_dir: str, config: dict): :param config: Config dictionary. """ with open(os.path.join(target_dir, 'makefile.in'), 'w') as f: - cxx_flags = '-std=c++20' + cxx_flags = '-std=c++23' c_flags = '-std=gnu99' def format_multiple_arguments(obj): diff --git a/src/sinol_make/helpers/compile.py b/src/sinol_make/helpers/compile.py index 30f445ba..13a5b916 100644 --- a/src/sinol_make/helpers/compile.py +++ b/src/sinol_make/helpers/compile.py @@ -76,7 +76,7 @@ def compile(program, output, compilers: Compilers = None, compile_log=None, comp if ext == '.cpp': arguments = [compilers.cpp_compiler_path or compiler.get_cpp_compiler_path(), program] + \ extra_compilation_args + ['-o', output] + \ - f'--std=c++20 -O3 -lm{gcc_compilation_flags} -fdiagnostics-color'.split(' ') + f'--std=c++23 -O3 -lm{gcc_compilation_flags} -fdiagnostics-color'.split(' ') if use_fsanitize and compilation_flags != 'weak': arguments += ['-fsanitize=address,undefined', '-fno-sanitize-recover'] elif ext == '.c': diff --git a/src/sinol_make/helpers/compiler.py b/src/sinol_make/helpers/compiler.py index 9bb80b98..efe5fc9e 100644 --- a/src/sinol_make/helpers/compiler.py +++ b/src/sinol_make/helpers/compiler.py @@ -54,8 +54,8 @@ def get_cpp_compiler_path(): else: return 'g++' elif sys.platform == 'darwin': - if check_if_installed('g++-12'): # g++12 is currently the default compiler on sio. - return 'g++-12' + if check_if_installed('g++-14'): # g++14 is currently the default compiler on sio. + return 'g++-14' for i in [9, 10, 11, 13, 14]: compiler = 'g++-' + str(i) if check_if_installed(compiler): @@ -70,9 +70,9 @@ def get_python_interpreter_path(): Get the Python interpreter """ - if check_if_installed('python3.11'): # python3.11 is currently the default interpreter on sio. - return 'python3.11' - for ver in ['3.9', '3.8', '3.7', '3']: + if check_if_installed('python3.13'): # python3.13 is currently the default interpreter on sio. + return 'python3.13' + for ver in ['3.12', '3.11', '3.10', '3.9', '3']: if check_if_installed('python' + ver): return 'python' + ver return None diff --git a/src/sinol_make/helpers/parsers.py b/src/sinol_make/helpers/parsers.py index e69c79c6..a3240885 100644 --- a/src/sinol_make/helpers/parsers.py +++ b/src/sinol_make/helpers/parsers.py @@ -7,8 +7,8 @@ def add_compilation_arguments(parser: argparse.ArgumentParser): if sys.platform == 'darwin': - gcc_versions = 'gcc-9, gcc-10, gcc-11' - gpp_versions = 'g++-9, g++-10, g++-11' + gcc_versions = 'gcc-10, gcc-11, gcc-12, gcc-13, gcc-14' + gpp_versions = 'g++-10, g++-11, g++-12, g++-13, g++-14' else: gcc_versions = 'gcc' gpp_versions = 'g++' diff --git a/tests/commands/export/util.py b/tests/commands/export/util.py index ad703948..acc924b6 100644 --- a/tests/commands/export/util.py +++ b/tests/commands/export/util.py @@ -56,7 +56,7 @@ def _get_value_from_key(key, separator): assert _get_value_from_key("SLOW_TIMELIMIT", "=") == str(4 * config["time_limit"]) assert _get_value_from_key("MEMLIMIT", "=") == str(config["memory_limit"]) - cxx_flags = '-std=c++20' + cxx_flags = '-std=c++23' c_flags = '-std=gnu99' def format_multiple_arguments(obj): if isinstance(obj, str): From b32a106cd3304850df9df8f77c9d8281315f7201 Mon Sep 17 00:00:00 2001 From: MasloMaslane Date: Sat, 23 Aug 2025 13:05:00 +0200 Subject: [PATCH 2/2] Bump version --- src/sinol_make/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sinol_make/__init__.py b/src/sinol_make/__init__.py index d7af16b5..d5e4bdcb 100644 --- a/src/sinol_make/__init__.py +++ b/src/sinol_make/__init__.py @@ -12,7 +12,7 @@ from sinol_make.task_type.interactive import InteractiveTaskType # noqa -__version__ = "1.9.9" +__version__ = "1.9.10" def configure_parsers():