From f68d2684bb95696a74a308eb3d8e04e5b5e5e3cd Mon Sep 17 00:00:00 2001 From: Mats Van Molle Date: Fri, 10 Jul 2026 09:27:20 +0200 Subject: [PATCH 1/6] add support for arm64 Signed-off-by: Mats Van Molle --- benchkit/benches/speccpu2017/__init__.py | 63 ++++++++++++++++-------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/benchkit/benches/speccpu2017/__init__.py b/benchkit/benches/speccpu2017/__init__.py index 81f24d4e..30db259b 100644 --- a/benchkit/benches/speccpu2017/__init__.py +++ b/benchkit/benches/speccpu2017/__init__.py @@ -133,7 +133,7 @@ def fetch( FetchResult with `src_dir` set to the installed SPEC directory (`/spec`). """ - parent_dir = get_benches_dir(parent_dir=parent_dir, comm=ctx.platform.comm) + parent_dir = get_benches_dir(parent_dir=parent_dir) spec_dir = parent_dir / "spec-cpu-2017" mnt_dir = benchkit_home_dir() / "spec-cpu-2017-mnt" @@ -155,27 +155,48 @@ def fetch( fuseiso_umount(ctx, mnt_dir) # cp config - # TODO: support ARM arch = ctx.platform.architecture - if arch != "x86_64": - raise NotImplementedError(f"SPEC CPU 2017 is only supported on x86_64 (got {arch})") + print(arch) + if arch not in ["x86_64", "aarch64"]: + raise NotImplementedError( + f"SPEC CPU 2017 is only supported on x86_64 and aarch64 (got {arch})" + ) - ctx.exec( - argv=["cp", "config/Example-gcc-linux-x86.cfg", "config/config-gcc-linux-x86.cfg"], - cwd=spec_dir, - ) + if arch == "x86_64": + ctx.exec( + argv=["cp", "config/Example-gcc-linux-x86.cfg", "config/config-benchkit.cfg"], + cwd=spec_dir, + ) - # sed config - sed_edit( - ctx=ctx, - base_dir=spec_dir, - edits=[ - ( - 's#"/opt/rh/devtoolset-9/root/usr"#"/usr"#', - Path("config/config-gcc-linux-x86.cfg"), - ), - ], - ) + # sed config + sed_edit( + ctx=ctx, + base_dir=spec_dir, + edits=[ + ( + 's#"/opt/rh/devtoolset-9/root/usr"#"/usr"#', + Path("config/config-benchkit.cfg"), + ), + ], + ) + + if arch == "aarch64": + ctx.exec( + argv=["cp", "config/Example-gcc-linux-aarch64.cfg", "config/config-benchkit.cfg"], + cwd=spec_dir, + ) + + # sed config + sed_edit( + ctx=ctx, + base_dir=spec_dir, + edits=[ + ( + 's#"/opt/rh/devtoolset-9/root/usr"#"/usr"#', + Path("config/config-benchkit.cfg"), + ), + ], + ) return FetchResult(src_dir=spec_dir) @@ -222,7 +243,7 @@ def build( ( "source shrc && " f"runcpu --fake --loose --size {size} " - f"--tune base --config config-gcc-linux-x86.cfg {bench_name}" + f"--tune base --config config-benchkit.cfg {bench_name}" ), ], cwd=src_dir, @@ -252,7 +273,7 @@ def build( ( "source shrc && " f"runcpu --loose --size {size} " - f"--tune base --config config-gcc-linux-x86.cfg {bench_name}" + f"--tune base --config config-benchkit.cfg {bench_name}" ), ], cwd=src_dir, From 020960b68c2ab9344a0777d32873c5821d02743f Mon Sep 17 00:00:00 2001 From: Mats Van Molle Date: Fri, 10 Jul 2026 09:52:51 +0200 Subject: [PATCH 2/6] remove TODO Signed-off-by: Mats Van Molle --- benchkit/benches/speccpu2017/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchkit/benches/speccpu2017/__init__.py b/benchkit/benches/speccpu2017/__init__.py index 30db259b..b65f81d6 100644 --- a/benchkit/benches/speccpu2017/__init__.py +++ b/benchkit/benches/speccpu2017/__init__.py @@ -156,7 +156,6 @@ def fetch( # cp config arch = ctx.platform.architecture - print(arch) if arch not in ["x86_64", "aarch64"]: raise NotImplementedError( f"SPEC CPU 2017 is only supported on x86_64 and aarch64 (got {arch})" From 2c12061141cbcbe635f73f0f9dd0d3a03a21d173 Mon Sep 17 00:00:00 2001 From: Mats Van Molle Date: Fri, 10 Jul 2026 10:15:22 +0200 Subject: [PATCH 3/6] add support for arm64 Signed-off-by: Mats Van Molle --- benchkit/benches/speccpu2026/__init__.py | 60 ++++++++++++++++-------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/benchkit/benches/speccpu2026/__init__.py b/benchkit/benches/speccpu2026/__init__.py index 35d0fbd1..614652a2 100644 --- a/benchkit/benches/speccpu2026/__init__.py +++ b/benchkit/benches/speccpu2026/__init__.py @@ -155,27 +155,47 @@ def fetch( fuseiso_umount(ctx, mnt_dir) # cp config - # TODO: support ARM arch = ctx.platform.architecture - if arch != "x86_64": - raise NotImplementedError(f"SPEC CPU 2026 is only supported on x86_64 (got {arch})") + if arch not in ["x86_64", "aarch64"]: + raise NotImplementedError( + f"SPEC CPU 2017 is only supported on x86_64 and aarch64 (got {arch})" + ) - ctx.exec( - argv=["cp", "config/Example-gcc-linux-x86.cfg", "config/config-gcc-linux-x86.cfg"], - cwd=spec_dir, - ) + if arch == "x86_64": + ctx.exec( + argv=["cp", "config/Example-gcc-linux-x86.cfg", "config/config-benchkit.cfg"], + cwd=spec_dir, + ) - # sed config - sed_edit( - ctx=ctx, - base_dir=spec_dir, - edits=[ - ( - 's#"/opt/rh/gcc-toolset-15/root/usr"#"/usr"#', - Path("config/config-gcc-linux-x86.cfg"), - ), - ], - ) + # sed config + sed_edit( + ctx=ctx, + base_dir=spec_dir, + edits=[ + ( + 's#"/opt/rh/gcc-toolset-15/root/usr"#"/usr"#', + Path("config/config-benchkit.cfg"), + ), + ], + ) + + if arch == "aarch64": + ctx.exec( + argv=["cp", "config/Example-gcc-linux-aarch64.cfg", "config/config-benchkit.cfg"], + cwd=spec_dir, + ) + + # sed config + sed_edit( + ctx=ctx, + base_dir=spec_dir, + edits=[ + ( + 's#"/opt/rh/gcc-toolset-15/root/usr"#"/usr"#', + Path("config/config-benchkit.cfg"), + ), + ], + ) return FetchResult(src_dir=spec_dir) @@ -222,7 +242,7 @@ def build( ( "source shrc && " f"runcpu --fake --loose --size {size} " - f"--tune base --config config-gcc-linux-x86.cfg {bench_name}" + f"--tune base --config config-benchkit.cfg {bench_name}" ), ], cwd=src_dir, @@ -252,7 +272,7 @@ def build( ( "source shrc && " f"runcpu --loose --size {size} " - f"--tune base --config config-gcc-linux-x86.cfg {bench_name}" + f"--tune base --config config-benchkit.cfg {bench_name}" ), ], cwd=src_dir, From 61db3f25d68a675c55ed021fe70a7e8ced913099 Mon Sep 17 00:00:00 2001 From: Mats Van Molle Date: Fri, 10 Jul 2026 10:17:22 +0200 Subject: [PATCH 4/6] fix parrent dir Signed-off-by: Mats Van Molle --- benchkit/benches/speccpu2017/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchkit/benches/speccpu2017/__init__.py b/benchkit/benches/speccpu2017/__init__.py index b65f81d6..0722f5bd 100644 --- a/benchkit/benches/speccpu2017/__init__.py +++ b/benchkit/benches/speccpu2017/__init__.py @@ -133,7 +133,7 @@ def fetch( FetchResult with `src_dir` set to the installed SPEC directory (`/spec`). """ - parent_dir = get_benches_dir(parent_dir=parent_dir) + parent_dir = get_benches_dir(parent_dir=parent_dir, comm=ctx.platform.comm) spec_dir = parent_dir / "spec-cpu-2017" mnt_dir = benchkit_home_dir() / "spec-cpu-2017-mnt" From de7670a9c5a68e1c0c7a849cd55ea5fc8b973d6c Mon Sep 17 00:00:00 2001 From: Mats Van Molle Date: Fri, 10 Jul 2026 11:22:17 +0200 Subject: [PATCH 5/6] implemented requisted changes Signed-off-by: Mats Van Molle --- benchkit/benches/speccpu2017/__init__.py | 49 ++++++++---------------- benchkit/benches/speccpu2026/__init__.py | 49 ++++++++---------------- 2 files changed, 30 insertions(+), 68 deletions(-) diff --git a/benchkit/benches/speccpu2017/__init__.py b/benchkit/benches/speccpu2017/__init__.py index 0722f5bd..f4d172bb 100644 --- a/benchkit/benches/speccpu2017/__init__.py +++ b/benchkit/benches/speccpu2017/__init__.py @@ -161,41 +161,22 @@ def fetch( f"SPEC CPU 2017 is only supported on x86_64 and aarch64 (got {arch})" ) - if arch == "x86_64": - ctx.exec( - argv=["cp", "config/Example-gcc-linux-x86.cfg", "config/config-benchkit.cfg"], - cwd=spec_dir, - ) - - # sed config - sed_edit( - ctx=ctx, - base_dir=spec_dir, - edits=[ - ( - 's#"/opt/rh/devtoolset-9/root/usr"#"/usr"#', - Path("config/config-benchkit.cfg"), - ), - ], - ) - - if arch == "aarch64": - ctx.exec( - argv=["cp", "config/Example-gcc-linux-aarch64.cfg", "config/config-benchkit.cfg"], - cwd=spec_dir, - ) + ctx.exec( + argv=["cp", f"config/Example-gcc-linux-{arch}.cfg", "config/config-benchkit.cfg"], + cwd=spec_dir, + ) - # sed config - sed_edit( - ctx=ctx, - base_dir=spec_dir, - edits=[ - ( - 's#"/opt/rh/devtoolset-9/root/usr"#"/usr"#', - Path("config/config-benchkit.cfg"), - ), - ], - ) + # sed config + sed_edit( + ctx=ctx, + base_dir=spec_dir, + edits=[ + ( + 's#"/opt/rh/devtoolset-9/root/usr"#"/usr"#', + Path("config/config-benchkit.cfg"), + ), + ], + ) return FetchResult(src_dir=spec_dir) diff --git a/benchkit/benches/speccpu2026/__init__.py b/benchkit/benches/speccpu2026/__init__.py index 614652a2..b42f5c2a 100644 --- a/benchkit/benches/speccpu2026/__init__.py +++ b/benchkit/benches/speccpu2026/__init__.py @@ -161,41 +161,22 @@ def fetch( f"SPEC CPU 2017 is only supported on x86_64 and aarch64 (got {arch})" ) - if arch == "x86_64": - ctx.exec( - argv=["cp", "config/Example-gcc-linux-x86.cfg", "config/config-benchkit.cfg"], - cwd=spec_dir, - ) - - # sed config - sed_edit( - ctx=ctx, - base_dir=spec_dir, - edits=[ - ( - 's#"/opt/rh/gcc-toolset-15/root/usr"#"/usr"#', - Path("config/config-benchkit.cfg"), - ), - ], - ) - - if arch == "aarch64": - ctx.exec( - argv=["cp", "config/Example-gcc-linux-aarch64.cfg", "config/config-benchkit.cfg"], - cwd=spec_dir, - ) + ctx.exec( + argv=["cp", f"config/Example-gcc-linux-{arch}.cfg", "config/config-benchkit.cfg"], + cwd=spec_dir, + ) - # sed config - sed_edit( - ctx=ctx, - base_dir=spec_dir, - edits=[ - ( - 's#"/opt/rh/gcc-toolset-15/root/usr"#"/usr"#', - Path("config/config-benchkit.cfg"), - ), - ], - ) + # sed config + sed_edit( + ctx=ctx, + base_dir=spec_dir, + edits=[ + ( + 's#"/opt/rh/gcc-toolset-15/root/usr"#"/usr"#', + Path("config/config-benchkit.cfg"), + ), + ], + ) return FetchResult(src_dir=spec_dir) From e89b64d8a21a1075470b8502aff7dc39da9c03a4 Mon Sep 17 00:00:00 2001 From: Mats Van Molle Date: Fri, 10 Jul 2026 13:02:39 +0200 Subject: [PATCH 6/6] add support for riscv64 Signed-off-by: Mats Van Molle --- benchkit/benches/speccpu2017/__init__.py | 2 +- benchkit/benches/speccpu2026/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benchkit/benches/speccpu2017/__init__.py b/benchkit/benches/speccpu2017/__init__.py index f4d172bb..2013d190 100644 --- a/benchkit/benches/speccpu2017/__init__.py +++ b/benchkit/benches/speccpu2017/__init__.py @@ -156,7 +156,7 @@ def fetch( # cp config arch = ctx.platform.architecture - if arch not in ["x86_64", "aarch64"]: + if arch not in ["x86_64", "aarch64", "riscv64"]: raise NotImplementedError( f"SPEC CPU 2017 is only supported on x86_64 and aarch64 (got {arch})" ) diff --git a/benchkit/benches/speccpu2026/__init__.py b/benchkit/benches/speccpu2026/__init__.py index b42f5c2a..8b89f265 100644 --- a/benchkit/benches/speccpu2026/__init__.py +++ b/benchkit/benches/speccpu2026/__init__.py @@ -156,7 +156,7 @@ def fetch( # cp config arch = ctx.platform.architecture - if arch not in ["x86_64", "aarch64"]: + if arch not in ["x86_64", "aarch64", "riscv64"]: raise NotImplementedError( f"SPEC CPU 2017 is only supported on x86_64 and aarch64 (got {arch})" )