I am trying to cross compile Unreal Engine 5.5.4 dedicated server to linux from Windows. I have code that relies on AVX2 so I figured it would just work, but I am unable to get it to compile, I get these errors:
UATHelper: Packaging (Linux): error: current translation unit is compiled with the target feature '+avx' but the AST file was not
UATHelper: Packaging (Linux): error: current translation unit is compiled with the target feature '+avx2' but the AST file was not
UATHelper: Packaging (Linux): error: current translation unit is compiled with the target feature '+bmi' but the AST file was not
I am at a loss as to how to fix this, I have tried going into Game.Build.cs and adding MinCpuArchX64 = MinimumCpuArchitectureX64.AVX2;
but that didn’t change anything
I went into VCToolChain.cs and at the top of the function protected virtual void AppendCLArguments_Global(CppCompileEnvironment CompileEnvironment, List<string> Arguments)
I added
Arguments.Add("/arch:AVX2");
Arguments.Add("-mavx2");
Afterwards, recompiled the engine, also regenerated my project files. Deleted the intermediate and binaries folder for my project, recompiled. Then when going to package the server for linux, I get those errors, what else can I do to force the compilation of the AST files to be compiled with AVX2