Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,10 @@ public async Task SpecCpu2017ExecutorAppliesGcc15WorkaroundWhenGccVersionIs15OrG

Assert.IsNotNull(writtenConfigText);
Assert.IsTrue(writtenConfigText.Contains("%define GCCge15"), "Config should contain '%define GCCge15' when GCC version is 15 or greater.");
Assert.IsTrue(writtenConfigText.Contains("%define GCCge14"), "Config should also contain '%define GCCge14' when GCC version is 15 or greater.");
Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should also contain '%define GCCge10' when GCC version is 15 or greater.");
Assert.IsFalse(writtenConfigText.Contains("$Gcc15Workaround$"), "Placeholder '$Gcc15Workaround$' should be replaced.");
Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$"), "Placeholder '$Gcc14Workaround$' should be replaced.");
Assert.IsFalse(writtenConfigText.Contains("$Gcc10Workaround$"), "Placeholder '$Gcc10Workaround$' should be replaced.");
Assert.IsTrue(writtenConfigText.Contains("-ftree-parallelize-loops=8"), "Config should use the configured thread count.");
Assert.IsFalse(writtenConfigText.Contains("$Threads$"), "Placeholder '$Threads$' should be replaced.");
Expand Down Expand Up @@ -585,11 +587,45 @@ public async Task SpecCpu2017ExecutorDoesNotApplyGcc15WorkaroundWhenGccVersionIs

Assert.IsNotNull(writtenConfigText);
Assert.IsFalse(writtenConfigText.Contains("%define GCCge15"), "Config should NOT contain '%define GCCge15' when GCC version is less than 15.");
Assert.IsFalse(writtenConfigText.Contains("%define GCCge14"), "Config should NOT contain '%define GCCge14' when GCC version is less than 14.");
Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should contain '%define GCCge10' when GCC version is 10.");
Assert.IsFalse(writtenConfigText.Contains("$Gcc15Workaround$"), "Placeholder '$Gcc15Workaround$' should be replaced.");
Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$"), "Placeholder '$Gcc14Workaround$' should be replaced.");
Assert.IsFalse(writtenConfigText.Contains("$Gcc10Workaround$"), "Placeholder '$Gcc10Workaround$' should be replaced.");
}

[Test]
public async Task SpecCpu2017ExecutorAppliesGcc14WorkaroundWhenGccVersionIs14OnLinux()
{
this.SetupLinux();

string writtenConfigText = null;
this.mockFixture.File.Setup(f => f.WriteAllTextAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<CancellationToken>()))
.Callback<string, string, CancellationToken>((path, content, token) => writtenConfigText = content)
.Returns(Task.CompletedTask);

this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) => new InMemoryProcess
{
StartInfo = new ProcessStartInfo { FileName = exe, Arguments = arguments },
StandardOutput = new ConcurrentBuffer(new StringBuilder(exe == "sudo" && arguments == "gcc -dumpversion" ? "14" : string.Empty)),
ExitCode = 0,
OnStart = () => true,
OnHasExited = () => true
};

using (TestSpecCpu2017Executor specCpuExecutor = new TestSpecCpu2017Executor(this.mockFixture.Dependencies, this.mockFixture.Parameters))
{
await specCpuExecutor.ExecuteAsync(CancellationToken.None).ConfigureAwait(false);
}

Assert.IsNotNull(writtenConfigText);
Assert.IsTrue(writtenConfigText.Contains("%define GCCge14"), "Config should contain '%define GCCge14' when GCC version is 14.");
Assert.IsTrue(writtenConfigText.Contains("%define GCCge10"), "Config should contain '%define GCCge10' when GCC version is 14.");
Assert.IsFalse(writtenConfigText.Contains("%define GCCge15"), "Config should NOT contain '%define GCCge15' when GCC version is 14.");
Assert.IsTrue(writtenConfigText.Contains("EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int"), "Config should downgrade implicit-int errors for 527.cam4_r/627.cam4_s.");
Assert.IsFalse(writtenConfigText.Contains("$Gcc14Workaround$"), "Placeholder '$Gcc14Workaround$' should be replaced.");
}

[TestCase("intrate", "0-3", "$SPECCOPYNUM", null)]
[TestCase("intrate", "0,1,48,49", "$BIND", "bind = 0,1,48,49")]
[TestCase("intrate", "2,4,8,10", "$BIND", "bind = 2,4,8,10")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ default:
# line to avoid compile errors for several FP benchmarks
#
$Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later
$Gcc14Workaround$ # workaround for GCC v14 (and presumably later)
$Gcc15Workaround$ # workaround for GCC v15 (and presumably later)

# EDIT if needed: the preENV line adds library directories to the runtime
Expand Down Expand Up @@ -242,13 +243,20 @@ default: # data model applies to all benchmarks
EXTRA_CFLAGS = -fno-strict-aliasing -fgnu89-inline
505.mcf_r,605.mcf_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/505.mcf_r.html
EXTRA_CFLAGS = -fno-strict-aliasing
523.xalancbmk_r,623.xalancbmk_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/523.xalancbmk_r.html
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif
525.x264_r,625.x264_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/525.x264_r.html
EXTRA_CFLAGS = -fcommon
#
# Integer workarounds - base - combine the above - https://www.spec.org/cpu2017/Docs/runrules.html#BaseFlags
#
intrate,intspeed=base:
EXTRA_CFLAGS = -fno-strict-aliasing -fno-unsafe-math-optimizations -fno-finite-math-only -fgnu89-inline -fcommon
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif
#
# Floating Point workarounds - peak
#
Expand All @@ -259,7 +267,11 @@ default: # data model applies to all benchmarks
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
527.cam4_r,627.cam4_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/527.cam4_r.html
EXTRA_CFLAGS = -fno-strict-aliasing
% ifdef %{GCCge14} # workaround for GCC v14 (and presumably later)
EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int
% else
EXTRA_CFLAGS = -fno-strict-aliasing
% endif
% ifdef %{GCCge10} # workaround for GCC v10 (and presumably later)
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
Expand All @@ -272,7 +284,11 @@ default: # data model applies to all benchmarks
# FP workarounds - base - combine the above - https://www.spec.org/cpu2017/Docs/runrules.html#BaseFlags
#
fprate,fpspeed=base:
EXTRA_CFLAGS = -fno-strict-aliasing
% ifdef %{GCCge14} # workaround for GCC v14 (and presumably later)
EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int
% else
EXTRA_CFLAGS = -fno-strict-aliasing
% endif
% ifdef %{GCCge10} # workaround for GCC v10 (and presumably later)
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ protected override async Task<string> CustomizeConfigurationAsync(string templat
Convert.ToInt32(compilerVersion) >= 10 ? SpecCpu2017ConfigPlaceholder.Gcc10WorkaroundContent : string.Empty,
StringComparison.OrdinalIgnoreCase);

templateText = templateText.Replace(
SpecCpu2017ConfigPlaceholder.Gcc14Workaround,
Convert.ToInt32(compilerVersion) >= 14 ? SpecCpu2017ConfigPlaceholder.Gcc14WorkaroundContent : string.Empty,
StringComparison.OrdinalIgnoreCase);

templateText = templateText.Replace(
SpecCpu2017ConfigPlaceholder.Gcc15Workaround,
Convert.ToInt32(compilerVersion) >= 15 ? SpecCpu2017ConfigPlaceholder.Gcc15WorkaroundContent : string.Empty,
Expand All @@ -95,6 +100,11 @@ protected override async Task<string> CustomizeConfigurationAsync(string templat
SpecCpu2017ConfigPlaceholder.Gcc10WorkaroundContent,
StringComparison.OrdinalIgnoreCase);

templateText = templateText.Replace(
SpecCpu2017ConfigPlaceholder.Gcc14Workaround,
SpecCpu2017ConfigPlaceholder.Gcc14WorkaroundContent,
StringComparison.OrdinalIgnoreCase);

templateText = templateText.Replace(
SpecCpu2017ConfigPlaceholder.Gcc15Workaround,
SpecCpu2017ConfigPlaceholder.Gcc15WorkaroundContent,
Expand All @@ -108,6 +118,8 @@ private static class SpecCpu2017ConfigPlaceholder
{
public const string Gcc10Workaround = "$Gcc10Workaround$";
public const string Gcc10WorkaroundContent = "%define GCCge10";
public const string Gcc14Workaround = "$Gcc14Workaround$";
public const string Gcc14WorkaroundContent = "%define GCCge14";
public const string Gcc15Workaround = "$Gcc15Workaround$";
public const string Gcc15WorkaroundContent = "%define GCCge15";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ default:
# line to avoid compile errors for several FP benchmarks
#
$Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later
$Gcc14Workaround$ # workaround for GCC v14 (and presumably later)
$Gcc15Workaround$ # workaround for GCC v15 (and presumably later)

# EDIT if needed: the preENV line adds library directories to the runtime
Expand Down Expand Up @@ -248,13 +249,20 @@ default: # data model applies to all benchmarks
EXTRA_CFLAGS = -fno-strict-aliasing -fgnu89-inline
505.mcf_r,605.mcf_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/505.mcf_r.html
EXTRA_CFLAGS = -fno-strict-aliasing
523.xalancbmk_r,623.xalancbmk_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/523.xalancbmk_r.html
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif
525.x264_r,625.x264_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/525.x264_r.html
EXTRA_CFLAGS = -fcommon
#
# Integer workarounds - base - combine the above - https://www.spec.org/cpu2017/Docs/runrules.html#BaseFlags
#
intrate,intspeed=base:
EXTRA_CFLAGS = -fno-strict-aliasing -fno-unsafe-math-optimizations -fno-finite-math-only -fgnu89-inline -fcommon
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif
#
# Floating Point workarounds - peak
#
Expand All @@ -265,7 +273,11 @@ default: # data model applies to all benchmarks
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
527.cam4_r,627.cam4_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/527.cam4_r.html
EXTRA_CFLAGS = -fno-strict-aliasing
% ifdef %{GCCge14} # workaround for GCC v14 (and presumably later)
EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int
% else
EXTRA_CFLAGS = -fno-strict-aliasing
% endif
% ifdef %{GCCge10} # workaround for GCC v10 (and presumably later)
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
Expand All @@ -278,7 +290,11 @@ default: # data model applies to all benchmarks
# FP workarounds - base - combine the above - https://www.spec.org/cpu2017/Docs/runrules.html#BaseFlags
#
fprate,fpspeed=base:
EXTRA_CFLAGS = -fno-strict-aliasing
% ifdef %{GCCge14} # workaround for GCC v14 (and presumably later)
EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int
% else
EXTRA_CFLAGS = -fno-strict-aliasing
% endif
% ifdef %{GCCge10} # workaround for GCC v10 (and presumably later)
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
Expand Down Expand Up @@ -315,9 +331,6 @@ default: # data model applies to all benchmarks
#
default=base: # flags for all base
OPTIMIZE = $BaseOptimizingFlags$
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif


#-------- Peak Tuning Flags ----------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ default:
# line to avoid compile errors for several FP benchmarks
#
%define GCCge10 # EDIT: remove the '#' from column 1 if using GCC 10 or later
%define GCCge14 # EDIT: remove the '#' from column 1 if using GCC 14 or later
%define GCCge15 # EDIT: remove the '#' from column 1 if using GCC 15 or later

# EDIT if needed: the preENV line adds library directories to the runtime
Expand Down Expand Up @@ -252,13 +253,20 @@ default: # data model applies to all benchmarks
EXTRA_CFLAGS = -fno-strict-aliasing -fgnu89-inline
505.mcf_r,605.mcf_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/505.mcf_r.html
EXTRA_CFLAGS = -fno-strict-aliasing
523.xalancbmk_r,623.xalancbmk_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/523.xalancbmk_r.html
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif
525.x264_r,625.x264_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/525.x264_r.html
EXTRA_CFLAGS = -fcommon
#
# Integer workarounds - base - combine the above - https://www.spec.org/cpu2017/Docs/runrules.html#BaseFlags
#
intrate,intspeed=base:
EXTRA_CFLAGS = -fno-strict-aliasing -fno-unsafe-math-optimizations -fno-finite-math-only -fgnu89-inline -fcommon
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif
#
# Floating Point workarounds - peak
#
Expand All @@ -269,7 +277,11 @@ default: # data model applies to all benchmarks
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
527.cam4_r,627.cam4_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/527.cam4_r.html
EXTRA_CFLAGS = -fno-strict-aliasing
% ifdef %{GCCge14} # workaround for GCC v14 (and presumably later)
EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int
% else
EXTRA_CFLAGS = -fno-strict-aliasing
% endif
% ifdef %{GCCge10} # workaround for GCC v10 (and presumably later)
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
Expand All @@ -282,7 +294,11 @@ default: # data model applies to all benchmarks
# FP workarounds - base - combine the above - https://www.spec.org/cpu2017/Docs/runrules.html#BaseFlags
#
fprate,fpspeed=base:
EXTRA_CFLAGS = -fno-strict-aliasing
% ifdef %{GCCge14} # workaround for GCC v14 (and presumably later)
EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int
% else
EXTRA_CFLAGS = -fno-strict-aliasing
% endif
% ifdef %{GCCge10} # workaround for GCC v10 (and presumably later)
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
Expand Down Expand Up @@ -319,9 +335,6 @@ default: # data model applies to all benchmarks
#
default=base: # flags for all base
OPTIMIZE = -g -O3 -mcpu=native
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif


#-------- Peak Tuning Flags ----------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ default:
# line to avoid compile errors for several FP benchmarks
#
$Gcc10Workaround$ # EDIT: remove the '#' from column 1 if using GCC 10 or later
$Gcc14Workaround$ # workaround for GCC v14 (and presumably later)
$Gcc15Workaround$ # workaround for GCC v15 (and presumably later)

# EDIT if needed: the preENV line adds library directories to the runtime
Expand Down Expand Up @@ -242,13 +243,20 @@ default: # data model applies to all benchmarks
EXTRA_CFLAGS = -fno-strict-aliasing -fgnu89-inline
505.mcf_r,605.mcf_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/505.mcf_r.html
EXTRA_CFLAGS = -fno-strict-aliasing
523.xalancbmk_r,623.xalancbmk_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/523.xalancbmk_r.html
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif
525.x264_r,625.x264_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/525.x264_r.html
EXTRA_CFLAGS = -fcommon
#
# Integer workarounds - base - combine the above - https://www.spec.org/cpu2017/Docs/runrules.html#BaseFlags
#
intrate,intspeed=base:
EXTRA_CFLAGS = -fno-strict-aliasing -fno-unsafe-math-optimizations -fno-finite-math-only -fgnu89-inline -fcommon
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif
#
# Floating Point workarounds - peak
#
Expand All @@ -259,7 +267,11 @@ default: # data model applies to all benchmarks
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
527.cam4_r,627.cam4_s=peak: # https://www.spec.org/cpu2017/Docs/benchmarks/527.cam4_r.html
EXTRA_CFLAGS = -fno-strict-aliasing
% ifdef %{GCCge14} # workaround for GCC v14 (and presumably later)
EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int
% else
EXTRA_CFLAGS = -fno-strict-aliasing
% endif
% ifdef %{GCCge10} # workaround for GCC v10 (and presumably later)
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
Expand All @@ -272,7 +284,11 @@ default: # data model applies to all benchmarks
# FP workarounds - base - combine the above - https://www.spec.org/cpu2017/Docs/runrules.html#BaseFlags
#
fprate,fpspeed=base:
EXTRA_CFLAGS = -fno-strict-aliasing
% ifdef %{GCCge14} # workaround for GCC v14 (and presumably later)
EXTRA_CFLAGS = -fno-strict-aliasing -Wno-error=implicit-int
% else
EXTRA_CFLAGS = -fno-strict-aliasing
% endif
% ifdef %{GCCge10} # workaround for GCC v10 (and presumably later)
EXTRA_FFLAGS = -fallow-argument-mismatch
% endif
Expand All @@ -298,9 +314,6 @@ fpspeed:
#
default=base: # flags for all base
OPTIMIZE = $BaseOptimizingFlags$
% ifdef %{GCCge15} # workaround for GCC v15 (and presumably later)
EXTRA_CXXFLAGS = -Wno-error=template-body
% endif


#-------- Peak Tuning Flags ----------------------------------------------
Expand Down
Loading
Loading