diff --git a/VERSION b/VERSION index 6a675e4585..eb9087c475 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.19 \ No newline at end of file +1.16.20 diff --git a/src/VirtualClient/VirtualClient.Actions.FunctionalTests/CoreMarkProfileTests.cs b/src/VirtualClient/VirtualClient.Actions.FunctionalTests/CoreMarkProfileTests.cs index fa6bc13643..36a6230127 100644 --- a/src/VirtualClient/VirtualClient.Actions.FunctionalTests/CoreMarkProfileTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.FunctionalTests/CoreMarkProfileTests.cs @@ -177,7 +177,8 @@ public async Task CoreMarkProWorkloadProfileExecutesTheExpectedWorkloadsOnWindow this.mockFixture.SetupLinuxPackagesInstalled(new Dictionary { { "gcc", "10" }, // Should match profile defaults. - { "cc", "10" } + { "cc", "10" }, + { "gfortran", "10" } }); this.mockFixture.ProcessManager.OnGetProcess = (id) => null; diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpuExecutorTests.cs b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpuExecutorTests.cs index 94d9b37ceb..83d32add90 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpuExecutorTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/SPEC/SpecCpuExecutorTests.cs @@ -10,6 +10,7 @@ namespace VirtualClient.Actions using System.IO.Abstractions; using System.Linq; using System.Reflection; + using System.Text; using System.Threading; using System.Threading.Tasks; using global::VirtualClient; @@ -55,6 +56,7 @@ public async Task SpecCpuExecutorExecutesTheCorrectCommandsWithInstallationInLin { $"sudo mount -t iso9660 -o ro,exec,loop {this.mockPackage.Path}/speccpu.iso {this.mockFixture.GetPackagePath()}/speccpu_mount", $"sudo ./install.sh -f -d {this.mockPackage.Path}", + $"sudo gcc -dumpversion", $"sudo chmod -R ugo=rwx {this.mockPackage.Path}", $"sudo umount {this.mockFixture.GetPackagePath()}/speccpu_mount", $"sudo bash runspeccpu.sh \"--config vc-linux-x64.cfg --iterations 2 --copies 4 --threads 8 --tune all --reportable intrate\"" @@ -66,17 +68,35 @@ public async Task SpecCpuExecutorExecutesTheCorrectCommandsWithInstallationInLin Assert.AreEqual(expectedCommands.ElementAt(processCount), $"{exe} {arguments}"); processCount++; - return new InMemoryProcess + if (exe == "sudo" && arguments == "gcc -dumpversion") { - StartInfo = new ProcessStartInfo + return new InMemoryProcess { - FileName = exe, - Arguments = arguments - }, - ExitCode = 0, - OnStart = () => true, - OnHasExited = () => true - }; + StartInfo = new ProcessStartInfo + { + FileName = exe, + Arguments = arguments + }, + StandardOutput = new ConcurrentBuffer(new StringBuilder("10")), + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + } + else + { + return new InMemoryProcess + { + StartInfo = new ProcessStartInfo + { + FileName = exe, + Arguments = arguments + }, + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + } }; using (TestSpecCpuExecutor specCpuExecutor = new TestSpecCpuExecutor(this.mockFixture.Dependencies, this.mockFixture.Parameters)) @@ -84,7 +104,7 @@ public async Task SpecCpuExecutorExecutesTheCorrectCommandsWithInstallationInLin await specCpuExecutor.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); } - Assert.AreEqual(5, processCount); + Assert.AreEqual(expectedCommands.Count, processCount); } [Test] @@ -99,6 +119,7 @@ public async Task SpecCpuExecutorExecutesTheCorrectCommandsWithInstallationInWin $"powershell -Command \"Mount-DiskImage -ImagePath {this.mockPackage.Path}\\speccpu.iso\"", $"powershell -Command \"(Get-DiskImage -ImagePath {this.mockPackage.Path}\\speccpu.iso| Get-Volume).DriveLetter\"", $"cmd /c echo 1 | X:\\install.bat {this.mockPackage.Path}", + "gcc -dumpversion", $"powershell -Command \"Dismount-DiskImage -ImagePath {this.mockPackage.Path}\\speccpu.iso\"", $"cmd /c runspeccpu.bat --config vc-win-x64.cfg --iterations 2 --copies 4 --threads 8 --tune all --noreportable intrate" }; @@ -114,18 +135,36 @@ public async Task SpecCpuExecutorExecutesTheCorrectCommandsWithInstallationInWin output.Append("X"); } - return new InMemoryProcess + if (exe == "gcc" && arguments == "-dumpversion") { - StartInfo = new ProcessStartInfo + return new InMemoryProcess { - FileName = exe, - Arguments = arguments - }, - ExitCode = 0, - OnStart = () => true, - OnHasExited = () => true, - StandardOutput = output - }; + StartInfo = new ProcessStartInfo + { + FileName = exe, + Arguments = arguments + }, + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true, + StandardOutput = new ConcurrentBuffer(new StringBuilder("10")), + }; + } + else + { + return new InMemoryProcess + { + StartInfo = new ProcessStartInfo + { + FileName = exe, + Arguments = arguments + }, + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true, + StandardOutput = output + }; + } }; using (TestSpecCpuExecutor specCpuExecutor = new TestSpecCpuExecutor(this.mockFixture.Dependencies, this.mockFixture.Parameters)) @@ -133,7 +172,7 @@ public async Task SpecCpuExecutorExecutesTheCorrectCommandsWithInstallationInWin await specCpuExecutor.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); } - Assert.AreEqual(5, processCount); + Assert.AreEqual(processCount, expectedCommands.Count); } [Test] @@ -273,7 +312,7 @@ public async Task SpecCpuExecutorExecutesTheCorrectCommandsWithDifferentProfiles { commandCalled = true; } - + return new InMemoryProcess { StartInfo = new ProcessStartInfo @@ -353,7 +392,6 @@ private void SetupLinux() this.mockFixture.Parameters = new Dictionary() { - { nameof(SpecCpuExecutor.CompilerVersion), "10" }, { nameof(SpecCpuExecutor.SpecProfile), "intrate" }, { nameof(SpecCpuExecutor.PackageName), "speccpu" }, { nameof(SpecCpuExecutor.RunPeak), true }, @@ -385,7 +423,6 @@ private void SetupWindows() this.mockFixture.Parameters = new Dictionary() { - { nameof(SpecCpuExecutor.CompilerVersion), "10" }, { nameof(SpecCpuExecutor.SpecProfile), "intrate" }, { nameof(SpecCpuExecutor.PackageName), "speccpu" }, { nameof(SpecCpuExecutor.RunPeak), true }, diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs index 24be75d00c..9836463c9e 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs @@ -19,6 +19,7 @@ namespace VirtualClient.Actions using global::VirtualClient.Contracts; using Microsoft.Extensions.DependencyInjection; using VirtualClient.Contracts.Metadata; + using VirtualClient.Metadata; /// /// The SpecCpu workload executor. @@ -86,17 +87,6 @@ public string BaseOptimizingFlags } } - /// - /// Compiler version - /// - public string CompilerVersion - { - get - { - return this.Parameters.GetValue(nameof(SpecCpuExecutor.CompilerVersion)); - } - } - /// /// Iterations. /// Recommand Default: 2 @@ -432,16 +422,50 @@ private async Task WriteSpecCpuConfigAsync(CancellationToken cancellationToken) true); } + string compilerVersion = await this.GetInstalledCompilerDumpVersionAsync("gcc", cancellationToken); + + if (string.IsNullOrEmpty(compilerVersion)) + { + throw new WorkloadException("gcc version not found."); + } + templateText = templateText.Replace(SpecCpuConfigPlaceHolder.BaseOptimizingFlags, this.BaseOptimizingFlags, StringComparison.OrdinalIgnoreCase); templateText = templateText.Replace(SpecCpuConfigPlaceHolder.PeakOptimizingFlags, this.PeakOptimizingFlags, StringComparison.OrdinalIgnoreCase); templateText = templateText.Replace( SpecCpuConfigPlaceHolder.Gcc10Workaround, - Convert.ToInt32(this.CompilerVersion) >= 10 ? SpecCpuConfigPlaceHolder.Gcc10WorkaroundContent : string.Empty, + Convert.ToInt32(compilerVersion) >= 10 ? SpecCpuConfigPlaceHolder.Gcc10WorkaroundContent : string.Empty, StringComparison.OrdinalIgnoreCase); await this.fileSystem.File.WriteAllTextAsync(this.Combine(this.PackageDirectory, "config", configurationFile), templateText, cancellationToken); } + private async Task GetInstalledCompilerDumpVersionAsync(string compilerName, CancellationToken cancellationToken) + { + string command = compilerName; + string commandArguments = "-dumpversion"; + + string version = string.Empty; + + using (IProcessProxy process = this.systemManager.ProcessManager.CreateElevatedProcess(this.Platform, command, commandArguments)) + { + try + { + await process.StartAndWaitAsync(cancellationToken); + + if (!cancellationToken.IsCancellationRequested) + { + version = process.StandardOutput.ToString().Trim().Split(".")[0]; + } + } + catch + { + version = string.Empty; + } + } + + return version; + } + internal class SpecCpuState : State { public SpecCpuState(IDictionary properties = null) diff --git a/src/VirtualClient/VirtualClient.Dependencies.UnitTests/CompilerInstallationTests.cs b/src/VirtualClient/VirtualClient.Dependencies.UnitTests/CompilerInstallationTests.cs index 3b2b9f5662..2e757db2c6 100644 --- a/src/VirtualClient/VirtualClient.Dependencies.UnitTests/CompilerInstallationTests.cs +++ b/src/VirtualClient/VirtualClient.Dependencies.UnitTests/CompilerInstallationTests.cs @@ -7,7 +7,7 @@ namespace VirtualClient.Dependencies using System.Collections.Generic; using System.Diagnostics; using System.Linq; - using System.Runtime.InteropServices; + using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; @@ -37,21 +37,6 @@ public void SetupTest() this.mockFixture.FileSystem.SetupGet(fs => fs.File).Returns(this.mockFixture.File.Object); } - [Test] - public void CompilerInstallationThrowsForUnsupportedCompiler() - { - this.mockFixture.Parameters = new Dictionary() - { - { nameof(CompilerInstallation.CompilerName), "icc" }, - { nameof(CompilerInstallation.CompilerVersion), "123" } - }; - - using (TestCompilerInstallation compilerInstallation = new TestCompilerInstallation(this.mockFixture.Dependencies, this.mockFixture.Parameters)) - { - Assert.ThrowsAsync(() => compilerInstallation.ExecuteAsync(CancellationToken.None)); - } - } - [Test] public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInLinuxForGcc() { @@ -59,7 +44,6 @@ public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInLinuxForGc this.mockFixture.Parameters = new Dictionary() { - { nameof(CompilerInstallation.CompilerName), "gcc" }, { nameof(CompilerInstallation.CompilerVersion), "123" } }; @@ -113,68 +97,6 @@ public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInLinuxForGc Assert.AreEqual(expectedCommands.Count(), commandExecuted); } - [Test] - [TestCase(Architecture.X64)] - [TestCase(Architecture.Arm64)] - public async Task CompilerInstallationRunsTheExpectedCommandForCharmPlusPlusOnLinux(Architecture architecture) - { - this.mockFixture.Setup(PlatformID.Unix, architecture); - - this.mockFixture.File.Reset(); - this.mockFixture.File.Setup(f => f.Exists(It.IsAny())) - .Returns(true); - this.mockFixture.Directory.Setup(f => f.Exists(It.IsAny())) - .Returns(true); - - this.mockFixture.FileSystem.SetupGet(fs => fs.File).Returns(this.mockFixture.File.Object); - - this.mockFixture.Parameters = new Dictionary() - { - { nameof(CompilerInstallation.CompilerName), "charm++" }, - { nameof(CompilerInstallation.CompilerVersion), "6.5.0" } - }; - - ProcessStartInfo expectedInfo = new ProcessStartInfo(); - List expectedCommands = new List() - { - "sudo wget https://charm.cs.illinois.edu/distrib/charm-6.5.0.tar.gz -O charm.tar.gz", - "sudo tar -xzf charm.tar.gz", - "sudo ./build charm++ netlrts-linux-x86_64 --with-production -j4", - "sudo ./build charm++ netlrts-linux-arm8 --with-production -j4" - }; - - int commandExecuted = 0; - this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) => - { - if (expectedCommands.Any(c => c == $"{exe} {arguments}")) - { - commandExecuted++; - } - - IProcessProxy process = new InMemoryProcess - { - StartInfo = new ProcessStartInfo - { - FileName = exe, - Arguments = arguments - }, - ExitCode = 0, - OnStart = () => true, - OnHasExited = () => true - }; - process.StandardOutput.AppendLine("gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 123.3.0"); - process.StandardOutput.AppendLine("cc (Ubuntu 10.3.0-1ubuntu1~20.04) 123.3.0"); - return process; - }; - - using (TestCompilerInstallation compilerInstallation = new TestCompilerInstallation(this.mockFixture.Dependencies, this.mockFixture.Parameters)) - { - await compilerInstallation.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); - } - - Assert.AreEqual(3, commandExecuted); - } - [Test] [TestCase(null)] [TestCase("")] @@ -189,7 +111,6 @@ public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInWindowsFor this.mockFixture.Parameters = new Dictionary() { - { nameof(CompilerInstallation.CompilerName), "gcc" }, { nameof(CompilerInstallation.CygwinPackages), packages } }; @@ -235,26 +156,17 @@ public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInWindowsFor } [Test] - public async Task CompilerInstallationInLinuxDefaultsToGcc10() + public async Task CompilerInstallationInLinuxDefaultsToEmptyIfNoExistingVersion() { this.mockFixture.Parameters = new Dictionary(); ProcessStartInfo expectedInfo = new ProcessStartInfo(); List expectedCommands = new List() { - "sudo update-alternatives --remove-all gcc", - "sudo update-alternatives --remove-all gfortran", + "sudo gcc -dumpversion", "sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y", "sudo apt update", - "sudo apt install build-essential gcc-10 g++-10 gfortran-10 -y --quiet", - "sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 " + - $"--slave /usr/bin/g++ g++ /usr/bin/g++-10 " + - $"--slave /usr/bin/gcov gcov /usr/bin/gcov-10 " + - $"--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 " + - $"--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 " + - $"--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-10", - "sudo update-alternatives --remove-all cpp", - "sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-10 100", + "sudo apt install build-essential gcc g++ gfortran make -y --quiet" }; int commandExecuted = 0; @@ -266,20 +178,38 @@ public async Task CompilerInstallationInLinuxDefaultsToGcc10() commandExecuted++; } - IProcessProxy process = new InMemoryProcess + if (exe == "sudo" && arguments.Contains("-dumpversion")) { - StartInfo = new ProcessStartInfo + IProcessProxy process = new InMemoryProcess { - FileName = exe, - Arguments = arguments - }, - ExitCode = 0, - OnStart = () => true, - OnHasExited = () => true - }; - process.StandardOutput.AppendLine("gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0"); - process.StandardOutput.AppendLine("cc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0"); - return process; + StartInfo = new ProcessStartInfo + { + FileName = exe, + Arguments = arguments + }, + ExitCode = 1, + OnStart = () => true, + OnHasExited = () => true + }; + return process; + } + else + { + IProcessProxy process = new InMemoryProcess + { + StartInfo = new ProcessStartInfo + { + FileName = exe, + Arguments = arguments + }, + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + process.StandardOutput.AppendLine("gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0"); + process.StandardOutput.AppendLine("cc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0"); + return process; + } }; using (TestCompilerInstallation compilerInstallation = new TestCompilerInstallation(this.mockFixture.Dependencies, this.mockFixture.Parameters)) @@ -287,45 +217,74 @@ public async Task CompilerInstallationInLinuxDefaultsToGcc10() await compilerInstallation.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); } - Assert.AreEqual(expectedCommands.Count(), commandExecuted); + Assert.GreaterOrEqual(commandExecuted, expectedCommands.Count()); } [Test] - public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInLinuxForAocc() + public async Task CompilerInstallationInLinuxDefaultsToEmptyIfExistingVersion() { - this.mockFixture.Parameters = new Dictionary() - { - { nameof(CompilerInstallation.CompilerName), "Aocc" }, - { nameof(CompilerInstallation.CompilerVersion), "5.6.7" } - }; + this.mockFixture.Parameters = new Dictionary(); ProcessStartInfo expectedInfo = new ProcessStartInfo(); List expectedCommands = new List() { - "sudo wget https://developer.amd.com/wordpress/media/files/aocc-compiler-5.6.7.tar", - "sudo tar -xvf aocc-compiler-5.6.7.tar", - "sudo bash install.sh" + "sudo gcc -dumpversion", + "sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y", + "sudo apt update" + }; + List unexpectedCommands = new List() + { + "sudo apt install build-essential gcc g++ gfortran make -y --quiet" }; - int commandExecuted = 0; + int expectedCommandExecuted = 0; + int unexpectedCommandExecuted = 0; + this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDir) => { if (expectedCommands.Any(c => c == $"{exe} {arguments}")) { - commandExecuted++; + expectedCommandExecuted++; } - return new InMemoryProcess + if (unexpectedCommands.Any(c => c == $"{exe} {arguments}")) { - StartInfo = new ProcessStartInfo + unexpectedCommandExecuted++; + } + + if (exe == "sudo" && arguments.Contains("-dumpversion")) + { + IProcessProxy process = new InMemoryProcess { - FileName = exe, - Arguments = arguments - }, - ExitCode = 0, - OnStart = () => true, - OnHasExited = () => true - }; + StartInfo = new ProcessStartInfo + { + FileName = exe, + Arguments = arguments + }, + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true, + StandardOutput = new ConcurrentBuffer(new StringBuilder("10")) + }; + return process; + } + else + { + IProcessProxy process = new InMemoryProcess + { + StartInfo = new ProcessStartInfo + { + FileName = exe, + Arguments = arguments + }, + ExitCode = 0, + OnStart = () => true, + OnHasExited = () => true + }; + process.StandardOutput.AppendLine("gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0"); + process.StandardOutput.AppendLine("cc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0"); + return process; + } }; using (TestCompilerInstallation compilerInstallation = new TestCompilerInstallation(this.mockFixture.Dependencies, this.mockFixture.Parameters)) @@ -333,7 +292,8 @@ public async Task CompilerInstallationRunsTheExpectedWorkloadCommandInLinuxForAo await compilerInstallation.ExecuteAsync(CancellationToken.None).ConfigureAwait(false); } - Assert.AreEqual(3, commandExecuted); + Assert.GreaterOrEqual(expectedCommandExecuted, expectedCommands.Count()); + Assert.AreEqual(unexpectedCommandExecuted, 0); } [Test] @@ -351,7 +311,6 @@ public void CompilerInstallationConfirmsTheInstalledVersionOfGCCAsExpected(strin { using (TestCompilerInstallation compilerInstallation = new TestCompilerInstallation(this.mockFixture.Dependencies, this.mockFixture.Parameters)) { - compilerInstallation.CompilerName = "gcc"; compilerInstallation.CompilerVersion = expectedVersion; this.mockFixture.ProcessManager.OnProcessCreated = (process) => @@ -369,7 +328,6 @@ public void CompilerInstallationThrowsIfGccVersionIsNotConfirmed() { using (TestCompilerInstallation compilerInstallation = new TestCompilerInstallation(this.mockFixture.Dependencies, this.mockFixture.Parameters)) { - compilerInstallation.CompilerName = "gcc"; compilerInstallation.CompilerVersion = "10"; this.mockFixture.ProcessManager.OnProcessCreated = (process) => @@ -386,7 +344,6 @@ public void CompilerInstallationConfirmsExpectedCompilersForGcc() { using (TestCompilerInstallation compilerInstallation = new TestCompilerInstallation(this.mockFixture.Dependencies, this.mockFixture.Parameters)) { - compilerInstallation.CompilerName = "gcc"; compilerInstallation.CompilerVersion = "9"; Dictionary compilers = new Dictionary() diff --git a/src/VirtualClient/VirtualClient.Dependencies/CompilerInstallation.cs b/src/VirtualClient/VirtualClient.Dependencies/CompilerInstallation.cs index a920db889a..cb9b5d56ab 100644 --- a/src/VirtualClient/VirtualClient.Dependencies/CompilerInstallation.cs +++ b/src/VirtualClient/VirtualClient.Dependencies/CompilerInstallation.cs @@ -5,9 +5,7 @@ namespace VirtualClient.Dependencies { using System; using System.Collections.Generic; - using System.IO; - using System.IO.Abstractions; - using System.Linq; + using System.Configuration; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; @@ -43,22 +41,6 @@ public CompilerInstallation(IServiceCollection dependencies, IDictionary(); } - /// - /// The name of the compiler (e.g. gcc). - /// - public string CompilerName - { - get - { - return this.Parameters.GetValue(nameof(CompilerInstallation.CompilerName), "gcc"); - } - - set - { - this.Parameters[nameof(CompilerInstallation.CompilerName)] = value; - } - } - /// /// The version of the compiler (e.g. 10). /// @@ -102,50 +84,31 @@ public string CygwinPackages /// protected override async Task ExecuteAsync(EventContext telemetryContext, CancellationToken cancellationToken) { - string compiler = this.CompilerName.ToLowerInvariant(); - switch (this.CompilerName.ToLowerInvariant()) + if (this.Platform == PlatformID.Unix) { - case "gcc": - if (this.Platform == PlatformID.Unix) - { - await this.InstallGccAsync(this.CompilerVersion, telemetryContext, cancellationToken); - - if (!await this.ConfirmGccVersionInstalledAsync(cancellationToken)) - { - throw new DependencyException($"'{this.CompilerName.ToLowerInvariant()}' compiler version '{this.CompilerVersion}' not confirmed.", ErrorReason.DependencyInstallationFailed); - } - } - else if (this.Platform == PlatformID.Win32NT) - { - string chocolateyToolsLocation = this.GetEnvironmentVariable("ChocolateyToolsLocation", EnvironmentVariableTarget.User); - string cygwinInstallationPath = this.PlatformSpecifics.Combine(chocolateyToolsLocation, "cygwin"); - - DependencyPath cygwinPackage = new DependencyPath("cygwin", cygwinInstallationPath); - await this.systemManager.PackageManager.RegisterPackageAsync(cygwinPackage, cancellationToken); - - await this.InstallCygwinAsync(cygwinPackage, telemetryContext, cancellationToken); - } - - break; + await this.InstallGccAsync(this.CompilerVersion, telemetryContext, cancellationToken); - case "aocc": - if (this.Platform == PlatformID.Unix) - { - await this.InstallAoccAsync(this.CompilerVersion, telemetryContext, cancellationToken); - } + if (!string.IsNullOrEmpty(this.CompilerVersion) && !await this.ConfirmGccVersionInstalledAsync(cancellationToken)) + { + throw new DependencyException($"gcc compiler version '{this.CompilerVersion}' not confirmed.", ErrorReason.DependencyInstallationFailed); + } - break; + // Ensure gcc, cc, and gfrotran versions match + bool compilerVersionsMatch = await this.ConfirmCompilerVerionsMatchAsync(telemetryContext, cancellationToken); + if (!compilerVersionsMatch) + { + throw new DependencyException("gcc, cc, and gfortran compiler versions do not match", ErrorReason.DependencyInstallationFailed); + } + } + else if (this.Platform == PlatformID.Win32NT) + { + string chocolateyToolsLocation = this.GetEnvironmentVariable("ChocolateyToolsLocation", EnvironmentVariableTarget.User); + string cygwinInstallationPath = this.PlatformSpecifics.Combine(chocolateyToolsLocation, "cygwin"); - case Compilers.Charmplusplus: - if (this.Platform == PlatformID.Unix) - { - await this.InstallCharmplusplusAsync(this.CompilerVersion, telemetryContext, cancellationToken); - } + DependencyPath cygwinPackage = new DependencyPath("cygwin", cygwinInstallationPath); + await this.systemManager.PackageManager.RegisterPackageAsync(cygwinPackage, cancellationToken); - break; - - default: - throw new NotSupportedException($"Compiler '{this.CompilerName}' is not supported."); + await this.InstallCygwinAsync(cygwinPackage, telemetryContext, cancellationToken); } // The compiler + version installed is an important part of the metadata @@ -189,6 +152,15 @@ protected async Task ConfirmGccVersionInstalledAsync(CancellationToken can return (confirmedCompilers == compilersToCheck.Count); } + private async Task ConfirmCompilerVerionsMatchAsync(EventContext telemetryContext, CancellationToken cancellationToken) + { + string gccVersion = await this.GetInstalledCompilerDumpVersionAsync("gcc", telemetryContext, cancellationToken); + string ccVersion = await this.GetInstalledCompilerDumpVersionAsync("cc", telemetryContext, cancellationToken); + string gfortranVersion = await this.GetInstalledCompilerDumpVersionAsync("gfortran", telemetryContext, cancellationToken); + + return gccVersion == ccVersion && ccVersion == gfortranVersion; + } + private Task InstallCygwinAsync(DependencyPath cygwinInstallationPath, EventContext telemetryContext, CancellationToken cancellationToken) { string cygwinCommandArguments; @@ -209,26 +181,61 @@ private Task InstallCygwinAsync(DependencyPath cygwinInstallationPath, EventCont private async Task InstallGccAsync(string gccVersion, EventContext telemetryContext, CancellationToken cancellationToken) { LinuxDistributionInfo distro = await this.systemManager.GetLinuxDistributionAsync(cancellationToken); + gccVersion = (string.IsNullOrEmpty(gccVersion)) ? string.Empty : gccVersion; + string installedVersion = await this.GetInstalledCompilerDumpVersionAsync("gcc", telemetryContext, cancellationToken); + switch (distro.LinuxDistribution) { case LinuxDistribution.Ubuntu: case LinuxDistribution.Debian: - // default to 10 - await this.RemoveAlternativesAsync(telemetryContext, cancellationToken); - gccVersion = (string.IsNullOrEmpty(gccVersion)) ? "10" : gccVersion; await this.ExecuteCommandAsync("add-apt-repository", $"ppa:ubuntu-toolchain-r/test -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); await this.ExecuteCommandAsync("apt", $"update", Environment.CurrentDirectory, telemetryContext, cancellationToken); - await this.ExecuteCommandAsync("apt", @$"install build-essential gcc-{gccVersion} g++-{gccVersion} gfortran-{gccVersion} -y --quiet", Environment.CurrentDirectory, telemetryContext, cancellationToken); - await this.SetGccPriorityAsync(gccVersion, telemetryContext, cancellationToken); + if (string.IsNullOrEmpty(gccVersion) && string.IsNullOrEmpty(installedVersion)) + { + await this.ExecuteCommandAsync("apt", "purge gcc -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("apt", "install build-essential gcc g++ gfortran make -y --quiet", Environment.CurrentDirectory, telemetryContext, cancellationToken); + } + else if (!string.IsNullOrEmpty(gccVersion)) + { + await this.RemoveAlternativesAsync(telemetryContext, cancellationToken); + + await this.ExecuteCommandAsync("apt", @$"install build-essential gcc-{gccVersion} g++-{gccVersion} gfortran-{gccVersion} -y --quiet", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.SetGccPriorityAsync(gccVersion, telemetryContext, cancellationToken); + } break; case LinuxDistribution.CentOS8: case LinuxDistribution.RHEL8: + if (string.IsNullOrEmpty(gccVersion) && string.IsNullOrEmpty(installedVersion)) + { + await this.ExecuteCommandAsync("dnf", "install kernel-headers kernel-devel -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install binutils -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install glibc-headers glibc-devel -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install git -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install libnsl -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install make gcc -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + } + else if (!string.IsNullOrEmpty(gccVersion) && string.IsNullOrEmpty(installedVersion)) + { + await this.RemoveAlternativesAsync(telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", @$"install make gcc-toolset-{gccVersion} gcc-toolset-{gccVersion}-gcc-gfortran -y --quiet", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.SetGccPriorityAsync(gccVersion, telemetryContext, cancellationToken); + } + + break; + case LinuxDistribution.AzLinux: - await this.RemoveAlternativesAsync(telemetryContext, cancellationToken); - await this.ExecuteCommandAsync("dnf", @$"install make gcc-toolset-{gccVersion} gcc-toolset-{gccVersion}-gcc-gfortran -y --quiet", Environment.CurrentDirectory, telemetryContext, cancellationToken); - await this.SetGccPriorityAsync(gccVersion, telemetryContext, cancellationToken); + if (!string.IsNullOrEmpty(gccVersion)) + { + throw new Exception($"gcc version must not be supplied for {distro.LinuxDistribution}"); + } + + await this.ExecuteCommandAsync("dnf", "install kernel-headers kernel-devel -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install binutils -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install glibc-headers glibc-devel -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install git -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("dnf", "install gcc gfortran -y", Environment.CurrentDirectory, telemetryContext, cancellationToken); break; @@ -263,7 +270,7 @@ private async Task RemoveAlternativesAsync(EventContext telemetryContext, Cancel } } } - + private async Task SetGccPriorityAsync(string gccVersion, EventContext telemetryContext, CancellationToken cancellationToken) { string updateAlternativeArgument = $"--install /usr/bin/gcc gcc /usr/bin/gcc-{gccVersion} {gccVersion}0 " + @@ -284,35 +291,6 @@ private async Task SetGccPriorityAsync(string gccVersion, EventContext telemetry await this.ExecuteCommandAsync("update-alternatives", updateAlternativeArgumentCpp, Environment.CurrentDirectory, telemetryContext, cancellationToken); } - private async Task InstallAoccAsync(string aoccVersion, EventContext telemetryContext, CancellationToken cancellationToken) - { - // default to 3.2.0 - aoccVersion = (string.IsNullOrEmpty(aoccVersion)) ? "3.2.0" : aoccVersion; - await this.ExecuteCommandAsync("wget", $"https://developer.amd.com/wordpress/media/files/aocc-compiler-{aoccVersion}.tar", Environment.CurrentDirectory, telemetryContext, cancellationToken); - await this.ExecuteCommandAsync("tar", $"-xvf aocc-compiler-{aoccVersion}.tar", Environment.CurrentDirectory, telemetryContext, cancellationToken); - await this.ExecuteCommandAsync("bash", @$"install.sh", Environment.CurrentDirectory, telemetryContext, cancellationToken); - } - - private async Task InstallCharmplusplusAsync(string charmplusplusVersion, EventContext telemetryContext, CancellationToken cancellationToken) - { - // default latest - charmplusplusVersion = (string.IsNullOrEmpty(charmplusplusVersion)) ? "latest" : charmplusplusVersion; - - await this.ExecuteCommandAsync("wget", $"https://charm.cs.illinois.edu/distrib/charm-{charmplusplusVersion}.tar.gz -O charm.tar.gz", Environment.CurrentDirectory, telemetryContext, cancellationToken); - await this.ExecuteCommandAsync("tar", $"-xzf charm.tar.gz", Environment.CurrentDirectory, telemetryContext, cancellationToken); - string charmPath = Directory.GetDirectories(Environment.CurrentDirectory, "charm-v*").FirstOrDefault(); - - if (this.CpuArchitecture == System.Runtime.InteropServices.Architecture.X64) - { - await this.ExecuteCommandAsync("./build", "charm++ netlrts-linux-x86_64 --with-production -j4", workingDirectory: charmPath, telemetryContext, cancellationToken); - } - - if (this.CpuArchitecture == System.Runtime.InteropServices.Architecture.Arm64) - { - await this.ExecuteCommandAsync("./build", "charm++ netlrts-linux-arm8 --with-production -j4", workingDirectory: charmPath, telemetryContext, cancellationToken); - } - } - private Task ExecuteCommandAsync(string pathToExe, string commandLineArguments, string workingDirectory, EventContext telemetryContext, CancellationToken cancellationToken, int[] successCodes = null) { return this.RetryPolicy.ExecuteAsync(async () => @@ -334,6 +312,35 @@ private Task ExecuteCommandAsync(string pathToExe, string commandLineArguments, } }); } + + private async Task GetInstalledCompilerDumpVersionAsync(string compilerName, EventContext telemetryContext, CancellationToken cancellationToken) + { + string command = compilerName; + string commandArguments = "-dumpversion"; + + string version = string.Empty; + + using (IProcessProxy process = this.systemManager.ProcessManager.CreateElevatedProcess(this.Platform, command, commandArguments)) + { + try + { + await process.StartAndWaitAsync(cancellationToken); + + if (!cancellationToken.IsCancellationRequested) + { + await this.LogProcessDetailsAsync(process, telemetryContext); + + version = process.StandardOutput.ToString().Trim().Split(".")[0]; + } + } + catch + { + version = string.Empty; + } + } + + return version; + } } /// diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-COMPRESSION-LZBENCH.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-COMPRESSION-LZBENCH.json index 46c38391d5..d8cd3ee786 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-COMPRESSION-LZBENCH.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-COMPRESSION-LZBENCH.json @@ -6,8 +6,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10" + "CompilerVersion": "" }, "Actions": [ { @@ -25,7 +24,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion" } }, diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-COREMARK.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-COREMARK.json index efc25b01ad..993ebacc3e 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-COREMARK.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-COREMARK.json @@ -7,8 +7,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10", + "CompilerVersion": "", "ThreadCount": null }, "Actions": [ @@ -18,43 +17,41 @@ "Scenario": "ExecuteCoremarkBenchmark", "PackageName": "coremark", "ThreadCount": "$.Parameters.ThreadCount", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion" } } ], - "Dependencies": [ - { - "Type": "ChocolateyInstallation", - "Parameters": { - "Scenario": "InstallChocolatey", - "PackageName": "chocolatey" - } - }, - { - "Type": "ChocolateyPackageInstallation", - "Parameters": { - "Scenario": "InstallCygwin", - "PackageName": "chocolatey", - "Packages": "cygwin,git" - } - }, - { - "Type": "CompilerInstallation", - "Parameters": { - "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", - "CompilerVersion": "$.Parameters.CompilerVersion", - "CygwinPackages": "gcc-g++,gcc,perl" - } - }, - { - "Type": "GitRepoClone", - "Parameters": { - "Scenario": "CloneRepo", - "RepoUri": "https://github.com/eembc/coremark.git", - "PackageName": "coremark" - } - } - ] + "Dependencies": [ + { + "Type": "ChocolateyInstallation", + "Parameters": { + "Scenario": "InstallChocolatey", + "PackageName": "chocolatey" + } + }, + { + "Type": "ChocolateyPackageInstallation", + "Parameters": { + "Scenario": "InstallCygwin", + "PackageName": "chocolatey", + "Packages": "cygwin,git" + } + }, + { + "Type": "CompilerInstallation", + "Parameters": { + "Scenario": "InstallCompiler", + "CompilerVersion": "$.Parameters.CompilerVersion", + "CygwinPackages": "gcc-g++,gcc,perl" + } + }, + { + "Type": "GitRepoClone", + "Parameters": { + "Scenario": "CloneRepo", + "RepoUri": "https://github.com/eembc/coremark.git", + "PackageName": "coremark" + } + } + ] } \ No newline at end of file diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-COREMARKPRO.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-COREMARKPRO.json index b4c6b1593a..7440197b53 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-COREMARKPRO.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-COREMARKPRO.json @@ -7,8 +7,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu,Windows" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10", + "CompilerVersion": "", "ThreadCount": null }, "Actions": [ @@ -17,7 +16,6 @@ "Parameters": { "Scenario": "ExecuteCoremarkProBenchmark", "ThreadCount": "$.Parameters.ThreadCount", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion", "PackageName": "coremarkpro" } @@ -43,7 +41,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion", "CygwinPackages": "gcc-g++,gcc,perl" } diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-HPCG.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-HPCG.json index 1107163fb1..0e4a7b130a 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-HPCG.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-HPCG.json @@ -7,8 +7,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10" + "CompilerVersion": "" }, "Actions": [ { @@ -27,7 +26,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion" } }, diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-HPLINPACK.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-HPLINPACK.json index 7690940371..5a77f782b9 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-HPLINPACK.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-HPLINPACK.json @@ -6,8 +6,7 @@ "SupportedOperatingSystems": "Ubuntu22" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "11", + "CompilerVersion": "", "ProblemSizeN": null, "BlockSizeNB": "256", "NumberOfProcesses": "{LogicalCoreCount}", @@ -32,7 +31,6 @@ { "Type": "CompilerInstallation", "Parameters": { - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion" } }, diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-LAPACK.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-LAPACK.json index 57ffc43c2a..3681ca0434 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-LAPACK.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-CPU-LAPACK.json @@ -6,8 +6,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10" + "CompilerVersion": "" }, "Actions": [ { @@ -38,7 +37,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion", "CygwinPackages": "gcc-fortran,python3" } diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-MEM-LMBENCH.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-MEM-LMBENCH.json index ac305ea34d..be3032aee8 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-MEM-LMBENCH.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-MEM-LMBENCH.json @@ -8,8 +8,7 @@ "Notes_Runtime": "The benchmark takes approximately 6 to 8 minutes per 1 GB of RAM targeted. The default profile uses 25% of the total RAM." }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10", + "CompilerVersion": "", "CompilerFlags": "CPPFLAGS=\"-I /usr/include/tirpc\"", "MemorySizeMB": "{calculate({SystemMemoryMegabytes} / 4)}" }, @@ -38,7 +37,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion" } }, diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-FPRATE.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-FPRATE.json index b194cc5077..f081515f67 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-FPRATE.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-FPRATE.json @@ -8,8 +8,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu,Windows" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10", + "CompilerVersion": "", "Iterations": 2, "SpecProfile": "fprate", "RunPeak": false, @@ -23,7 +22,6 @@ "Type": "SpecCpuExecutor", "Parameters": { "Scenario": "ExecuteSPECBenchmark", - "CompilerVersion": "$.Parameters.CompilerVersion", "Iterations": "$.Parameters.Iterations", "SpecProfile": "$.Parameters.SpecProfile", "PackageName": "speccpu2017", @@ -55,7 +53,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion", "CygwinPackages": "gcc-g++,gcc-fortran,gcc,libiconv-devel" } diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-FPSPEED.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-FPSPEED.json index 174f0a9f32..eadf588008 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-FPSPEED.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-FPSPEED.json @@ -8,8 +8,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu,Windows" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10", + "CompilerVersion": "", "Iterations": 2, "SpecProfile": "fpspeed", "RunPeak": false, @@ -23,7 +22,6 @@ "Type": "SpecCpuExecutor", "Parameters": { "Scenario": "ExecuteSPECBenchmark", - "CompilerVersion": "$.Parameters.CompilerVersion", "Iterations": "$.Parameters.Iterations", "SpecProfile": "$.Parameters.SpecProfile", "PackageName": "speccpu2017", @@ -55,7 +53,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion", "CygwinPackages": "gcc-g++,gcc-fortran,gcc,libiconv-devel" } diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-INTRATE.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-INTRATE.json index 567149ac48..3561a1caed 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-INTRATE.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-INTRATE.json @@ -8,8 +8,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu,Windows" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10", + "CompilerVersion": "", "Iterations": 2, "SpecProfile": "intrate", "RunPeak": false, @@ -23,7 +22,6 @@ "Type": "SpecCpuExecutor", "Parameters": { "Scenario": "ExecuteSPECBenchmark", - "CompilerVersion": "$.Parameters.CompilerVersion", "Iterations": "$.Parameters.Iterations", "SpecProfile": "$.Parameters.SpecProfile", "PackageName": "speccpu2017", @@ -55,7 +53,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion", "CygwinPackages": "gcc-g++,gcc-fortran,gcc,libiconv-devel" } diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-INTSPEED.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-INTSPEED.json index 6afcdff1e9..374bf4db27 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-INTSPEED.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-SPECCPU-INTSPEED.json @@ -8,8 +8,7 @@ "SupportedOperatingSystems": "CBL-Mariner,CentOS,Debian,RedHat,Suse,Ubuntu,Windows" }, "Parameters": { - "CompilerName": "gcc", - "CompilerVersion": "10", + "CompilerVersion": "", "Iterations": 2, "SpecProfile": "intspeed", "RunPeak": false, @@ -23,7 +22,6 @@ "Type": "SpecCpuExecutor", "Parameters": { "Scenario": "ExecuteSPECBenchmark", - "CompilerVersion": "$.Parameters.CompilerVersion", "Iterations": "$.Parameters.Iterations", "SpecProfile": "$.Parameters.SpecProfile", "PackageName": "speccpu2017", @@ -55,7 +53,6 @@ "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "$.Parameters.CompilerName", "CompilerVersion": "$.Parameters.CompilerVersion", "CygwinPackages": "gcc-g++,gcc-fortran,gcc,libiconv-devel" } diff --git a/website/docs/dependencies/0032-compiler-installation.md b/website/docs/dependencies/0032-compiler-installation.md index 82622b2a1e..148527328f 100644 --- a/website/docs/dependencies/0032-compiler-installation.md +++ b/website/docs/dependencies/0032-compiler-installation.md @@ -1,5 +1,5 @@ # Compiler Installation -This dependency provides support for installing either the GCC or AOCC compiler, along with any appropriate packages. +This dependency provides support for installing either the GCC compiler, along with any appropriate packages. ## Supported Platform/Architectures * linux-x64 @@ -12,7 +12,6 @@ The following section describes the parameters used by the individual component | **Parameter** | **Default Value** | **Description** | |---------------|--------------|------------------------------------------------------------------------| -| CompilerName | gcc | Optional. The name of the compiler to be installed (ie. "gcc" or "aocc") | | CompilerVersion | N/A | Optional. The version of the compiler to be installed (e.g. 10) | | CygwinPackages | N/A | Optional. Windows Only. Comma-delimited list of packages that needs to be installed with cygwin (e.g. gcc-fortran,python3). Note: VC automatically installs make & cmake with Cygwin. | @@ -21,9 +20,7 @@ Note: VC automatically installs make & cmake with Cygwin. | | **CompilerName** | **Supported Platform/Architectures** | |------------------|------------------------------------------------------------------------| -|gcc | linux-arm64,linux-x64,win-arm64,win-x64 | -|aocc | linux-arm64,linux-x64 | -|charm++ | linux-arm64,linux-x64 | +| gcc | linux-arm64,linux-x64,win-arm64,win-x64 | ## Example The following section describes the parameters used by the individual component in the profile. @@ -35,8 +32,7 @@ The following section describes the parameters used by the individual component "Type": "CompilerInstallation", "Parameters": { "Scenario": "InstallCompiler", - "CompilerName": "gcc", - "CompilerVersion": "10", + "CompilerVersion": "", "CygwinPackages": "gcc-g++,gcc-fortran,gcc,libiconv-devel" } }, diff --git a/website/docs/workloads/speccpu/speccpu-profiles.md b/website/docs/workloads/speccpu/speccpu-profiles.md index 243164f076..0ce6cf38c7 100644 --- a/website/docs/workloads/speccpu/speccpu-profiles.md +++ b/website/docs/workloads/speccpu/speccpu-profiles.md @@ -23,11 +23,6 @@ for evaluating the performance of the CPU for processing calculations. * **Supports Disconnected Scenarios** * No. Internet connection required. -* **Supported Compilers** - The following compilers are supported with the workload for this profile. See profile parameters and usage examples below. - - * GCC Compiler Versions = 8, 9, 10 - * **Dependencies** The dependencies defined in the 'Dependencies' section of the profile itself are required in order to run the workload operations effectively. * Internet connection. @@ -81,11 +76,6 @@ for evaluating the performance of the CPU for processing calculations. * **Supports Disconnected Scenarios** * No. Internet connection required. -* **Supported Compilers** - The following compilers are supported with the workload for this profile. See profile parameters and usage examples below. - - * GCC Compiler Versions = 8, 9, 10 - * **Dependencies** The dependencies defined in the 'Dependencies' section of the profile itself are required in order to run the workload operations effectively. * Internet connection. @@ -135,11 +125,6 @@ for evaluating the performance of the CPU for processing calculations. * **Supports Disconnected Scenarios** * No. Internet connection required. -* **Supported Compilers** - The following compilers are supported with the workload for this profile. See profile parameters and usage examples below. - - * GCC Compiler Versions = 8, 9, 10 - * **Dependencies** The dependencies defined in the 'Dependencies' section of the profile itself are required in order to run the workload operations effectively. * Internet connection. @@ -188,11 +173,6 @@ for evaluating the performance of the CPU for processing calculations. * **Supports Disconnected Scenarios** * No. Internet connection required. -* **Supported Compilers** - The following compilers are supported with the workload for this profile. See profile parameters and usage examples below. - - * GCC Compiler Versions = 8, 9, 10 - * **Dependencies** The dependencies defined in the 'Dependencies' section of the profile itself are required in order to run the workload operations effectively. * Internet connection.