Open xengpro opened 2 months ago
Hi @xengpro
This seems to be a toolchain problem, could you please try with Clang 16 and let us know if that works?
Hope this helps.
Hi @xengpro
This seems to be a toolchain problem, could you please try with Clang 16 and let us know if that works?
Hope this helps.
Hi @morgolock , I tried clang15 earlier, but vs2022 requires clang 17+: "Unexpected compiler version, expected Clang 17.0.0 or newer."
Hi @xengpro
There seems to be a problem with the Clang toolchain in VS. In order to compile ACL you have to download the external Clang toolchain I mentioned above. Try downloading https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.6 and building ACL with it. That's what we use in the team to build ACL natively on Windows.
Hope this helps.
Hi @morgolock, Thanks for you help. But I've tried llvmorg-16.0.6 a few minutes earlier, and get same error.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\yvals_core.h(898,1): error:
static assertion failed: error STL1000: Unexpected compiler version, expected Clang 17.0.0 or newer.
_EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 17.0.0 or newer.");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include\yvals_core.h(519,44): note:
expanded from macro '_EMIT_STL_ERROR'
#define _EMIT_STL_ERROR(NUMBER, MESSAGE) static_assert(false, "error " #NUMBER ": " MESSAGE)
^ ~~~~~
1 error generated.
scons: *** [build\src\common\cpuinfo\CpuInfo.obj] Error 1
scons: building terminated because of errors.
C:\xeng\ACL>clang-cl -v
clang version 16.0.6
Target: aarch64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
So it seems still not possible for ACL to build completely natively (with Visual Studio 2022 Arm64 build, which is 17.4 and newer ) on windows at the moment?
Hi @xengpro
It's possible to build ACL natively using the toolchain I mentioned above, we have jobs building ACL every day natively on Windows. The problem with VS22 is that it does not support inline assembly for arm64 targets.
From what I see in the logs you shared there is a problem with your environment. In the error you shared above I see mention to Clang 17.0.0
. It's likely your devenv is not properly setup. If you use the standalone Clang 16 toolchain you should see no references to Clang 17.
Hi @morgolock ,
I'm using standalone clang.
In the error you shared above I see mention to Clang 17.0.0.
It mentions Clang 17 because it detects that Clang 16.0.6 doesn't meet its expectations. So I tried standalone version Clang 18.1.8 and 17.0.6 which can build but get stuck in CpuElementwiseUnaryKernel.cpp
. Comments out a few lines in it can let the build proceed, but still stuck somewhere else like framework.cpp.
The problem with VS22 is that it does not support inline assembly for arm64 targets.
That's true. And the Clang (17.0.3) that comes with vs2022 also fails anyway. So on a X Elite Laptop, I'm using the following setup :
It's possible to build ACL natively using the toolchain I mentioned above
Could you share the version of your vs2022 and msvc/winsdk workloads?
Hi @xengpro
Snapdragon (TM) 8cx Gen 2 @ 3.15 GHz 3.15 GHz Windows 11 Enterprise Microsoft Visual Studio Community 2022 (ARM 64-bit) - Current Version 17.9.0
That's true. And the Clang (17.0.3) that comes with vs2022 also fails anyway.
It sounds like there is a problem with development environment and it is not properly setup.
Hi @morgolock ,
It sounds like there is a problem with development environment and it is not properly setup.
The setup is supposed to be very straight forward, so I couldn't mess it up:
then for my setup, llvm fails be like:
But thanks to you information, I changed the VS2022 to 17.9.7 and compilation succeeded with 'standalone=0'.
However, when build with with 'standalone=1', the arm_compute.dll
is linked but arm_compute.lib
not produced:
LINK : fatal error LNK1181: cannot open input file 'arm_compute.lib'
scons: *** [build\arm_compute_graph.dll] Error 1181
Hi @xengpro
If you want to build a program that uses ACL you will have to link statically against arm_compute-static-lib
.
However, when build with with 'standalone=1', the arm_compute.dll is linked but arm_compute.lib not produced:
Could you please share you full build command? It should build without errors with standalone=1
. I'm building with VS22 version 17.9.0 + Clang 16.0.6
Hope this helps,
However, when build with with 'standalone=1', the arm_compute.dll is linked but arm_compute.lib not produced:
Could you please share you full build command? It should build without errors with
standalone=1
. I'm building with VS22 version 17.9.0 + Clang 16.0.6
Really sorry for the typo. I was using 'standalone=0' when I was trying to get .dll files.
scons opencl=0 neon=1 os=windows examples=0 validation_tests=0 benchmark_examples=0 build=native Werror=0 exceptions=1 standalone=0 -j8 arch=arm64-v8.2-a
Hi @xengpro
That's right, we only support building with standalone=1
. This means that arm_compute_validation
will link statically with arm_compute-static-lib
. If you want to write a program that uses ACL you will have to also link statically with arm_compute-static-lib
Hope this helps.
Hi @xengpro
I tried to compile ACL with clang 17 or later and I got the same error you reported. This is a problem in the compiler crashing. I've raised a bug in LLVM as the see: https://github.com/llvm/llvm-project/issues/108976
I tried to compile ACL with clang 17 or later and I got the same error you reported. This is a problem in the compiler crashing. I've raised a bug in LLVM as the see: llvm/llvm-project#108976
Cool, thanks~!
That's right, we only support building with
standalone=1
.
Any plan to add standalone=0
support? Some program, such as onnx runtime, needs to change a lot to use static load.
Hi @xengpro
Any plan to add standalone=0 support? Some program, such as onnx runtime, needs to change a lot to use static load.
No plans in the short term, we have more important things like multi_isa support for Windows. I'll have a look into it and see how much effort will be require to produce the DLLs that can be used from a standalone program.
The following patch will fix the problems you had when you tried to build ACL with clang17 and the latest version of VS22. I had to disable optimizations when building with clang 17 or later because the compilers would crash otherwise. We'll enable this again once the toolchain gets fixed.
Hope this helps
Output of 'strings libarm_compute.so | grep arm_compute_version':
Platform: Snapdragon 8cx Gen 3/ X Elite X1E78100
Operating System: Windows 11 (23h2/24h2)
Problem description: I've tried to build by following the guide from: https://arm-software.github.io/ComputeLibrary/latest/how_to_build.xhtml#S1_6_windows_host, but failed with error like:
I've tried code base v23.x and v24.07/08, all failed. The toolchain I used:
logs attached: v24.08_xelite.zip