New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build NativeAOT 8.0 on Arch Linux #2548
Comments
LANG=C lscpu | grep 512
Flags: ... invpcid avx512f avx512dq rdseed adx smap avx512ifma ... If I remove all |
Hello @Jisu-Woniu Could you please go to It should be just |
I build it again and this is the content of <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<RuntimeFrameworkVersion></RuntimeFrameworkVersion>
<AssemblyName>f58553a8-0c73-499a-98cc-5ad358f5fe53</AssemblyName>
<AssemblyTitle>f58553a8-0c73-499a-98cc-5ad358f5fe53</AssemblyTitle>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugSymbols>false</DebugSymbols>
<UseSharedCompilation>false</UseSharedCompilation>
<Deterministic>true</Deterministic>
<RunAnalyzers>false</RunAnalyzers>
<PublishAot Condition=" '$(TargetFramework)' != 'net6.0' ">true</PublishAot>
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
<TrimMode>link</TrimMode><TrimmerDefaultAction>link</TrimmerDefaultAction>
<IlcGenerateCompleteTypeMetadata>True</IlcGenerateCompleteTypeMetadata>
<IlcGenerateStackTraceData>True</IlcGenerateStackTraceData>
<EnsureNETCoreAppRuntime>false</EnsureNETCoreAppRuntime> <!-- workaround for 'This runtime may not be supported by.NET Core.' error -->
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> <!-- workaround for 'Found multiple publish output files with the same relative path.' error -->
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>
<IlcInstructionSet>base,sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,avx-512f,avx-512bw,avx-512cd,avx-512dq,avx-512vbmi,aes,bmi,bmi2,fma,lzcnt,pclmul,popcnt</IlcInstructionSet>
</PropertyGroup>
<PropertyGroup>
<ServerGarbageCollection>false</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
</PropertyGroup>
<ItemGroup>
<Compile Include="f58553a8-0c73-499a-98cc-5ad358f5fe53.notcs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="<PROJECT_DIR>/Bench.csproj" />
</ItemGroup>
<ItemGroup>
<RdXmlFile Include="bdn_generated.rd.xml" />
</ItemGroup>
</Project> Maybe because the Instruction set should be |
I could set the using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Toolchains.NativeAot;
ManualConfig config = DefaultConfig.Instance.AddJob(
Job.Default.WithToolchain(
NativeAotToolchain.CreateBuilder().UseNuGet().IlcInstructionSet("native").ToToolchain()
)
);
BenchmarkRunner.Run<MyBench>(config);
// Use custom runtime instead of the built-in one:
// [SimpleJob(RuntimeMoniker.NativeAot80)]
public class MyBench
{
[Benchmark]
public void Bench() { }
} Generated <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<RuntimeFrameworkVersion></RuntimeFrameworkVersion>
<AssemblyName>6bb876b0-44dd-4195-9707-766e8b87018a</AssemblyName>
<AssemblyTitle>6bb876b0-44dd-4195-9707-766e8b87018a</AssemblyTitle>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugSymbols>false</DebugSymbols>
<UseSharedCompilation>false</UseSharedCompilation>
<Deterministic>true</Deterministic>
<RunAnalyzers>false</RunAnalyzers>
<PublishAot Condition=" '$(TargetFramework)' != 'net6.0' ">true</PublishAot>
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
<TrimMode>link</TrimMode><TrimmerDefaultAction>link</TrimmerDefaultAction>
<IlcGenerateCompleteTypeMetadata>True</IlcGenerateCompleteTypeMetadata>
<IlcGenerateStackTraceData>True</IlcGenerateStackTraceData>
<EnsureNETCoreAppRuntime>false</EnsureNETCoreAppRuntime> <!-- workaround for 'This runtime may not be supported by.NET Core.' error -->
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> <!-- workaround for 'Found multiple publish output files with the same relative path.' error -->
<ValidateExecutableReferencesMatchSelfContained>false</ValidateExecutableReferencesMatchSelfContained>
<IlcInstructionSet>native</IlcInstructionSet>
</PropertyGroup>
<PropertyGroup>
<ServerGarbageCollection>false</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
</PropertyGroup>
<ItemGroup>
<Compile Include="6bb876b0-44dd-4195-9707-766e8b87018a.notcs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="<PROJECT_DIR>/Bench.csproj" />
</ItemGroup>
<ItemGroup>
<RdXmlFile Include="bdn_generated.rd.xml" />
</ItemGroup>
</Project> It can compile and produce correct result. |
Big thanks for letting me know! There must be some kind of bug here: BenchmarkDotNet/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs Lines 231 to 234 in 4ab69be
I'll try to fix it after the weekend, I am glad you are unblocked for now. |
And maybe these should be replaced with BenchmarkDotNet/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs Lines 251 to 255 in 4ab69be
|
I wrote a simple benchmark, with NativeAOT enabled:
But when I run
dotnet run -c Release
, it fails with:My
dotnet --info
output:It was installed from Arch Linux repository.
And my
.csproj
file:The text was updated successfully, but these errors were encountered: