sleef icon indicating copy to clipboard operation
sleef copied to clipboard

can not compile under Visual Studio 17 2022 / ARM64

Open savelov opened this issue 1 year ago • 6 comments

after mkdir build cd build cmake .. cmake --build . --config Release -- /maxcpucount:1

getting error

C:\Users\savel\sleef\build\src\libm\dispscalar.c(26,1): error C2065: 'Sleef_sind1_u35purec': undeclared identifier [C:
Users\savel\sleef\build\src\libm\dispscalar_obj.vcxproj] C:\Users\savel\sleef\build\src\libm\dispscalar.c(26,1): error C2065: 'Sleef_sind1_u35purecfma': undeclared identifier [ C:\Users\savel\sleef\build\src\libm\dispscalar_obj.vcxproj]

savelov avatar Jun 29 '24 18:06 savelov

fixed by forcing setting of aarch64 architecture

cmake -DSLEEF_ARCH_AARCH64=1 .. cmake --build . --clean-first --config Release -- /maxcpucount:1

savelov avatar Jun 29 '24 20:06 savelov

probably CMAKE_SYSTEM_PROCESSOR does not correctly match arm64 or aarch64? https://github.com/shibatch/sleef/blob/master/Configure.cmake#L115 I checked and it is ARM64 uppercase (equal to %PROCESSOR_ARCHITECTURE%)

savelov avatar Jun 29 '24 20:06 savelov

Thank you so much, for looking into this and letting us know. We will investigate on our side and keep you updated if we escalate it with a PR.

joanaxcruz avatar Jul 01 '24 08:07 joanaxcruz

@savelov At the moment Windows assumes x86, but as you observed we are actually not far off supporting Windows on Arm (ARM64). Happy to see that you managed to bypass the architecture detection and force your config, in order to solve your issue.

The more concerning issue we have on Windows (on x86 and Arm) is actually testing, that's only possible in a Cygwin/POSIX-compliant environment. So even though they can be compiled for ARM64, they cannot be tested (natively) yet.

I will try to merge a config.cmake fix so that at least you don't have to force your config and we can close this issue. But we will have to disable tests, so we cannot claim full support yet.

blapie avatar Jul 08 '24 09:07 blapie

actually after fixing Configure.cmake, I could not properly compile using AdvSIMD instructions, as these variables are being set: set(COMPILER_SUPPORTS_ADVSIMD 1) set(COMPILER_SUPPORTS_ADVSIMDNOFMA 1)

probably Microsoft compiler is not fully compatible - e.g. compare with this PR for llama for visual c++ support, especially re float32x4_t initializers https://github.com/ggerganov/llama.cpp/pull/7191/files

savelov avatar Jul 08 '24 20:07 savelov

Sorry for the late reply. Have you tried compiling with llvm/clang. We believe MSVC might not be fully compatible yet, however there was no issue compiling with clang.

blapie avatar Oct 04 '24 13:10 blapie