Skip to content
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

Add support for Windows ARM64 #2089

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

anthony-linaro
Copy link

@anthony-linaro anthony-linaro commented Nov 7, 2024

This adds proper support for building for Windows ARM64 devices. using MSVC.

It does actually work right now, but only by complete accident, and with no SIMD enabled - this enables everything properly.

As part of this, I updated the version of sse2neon used to one compatible with MSVC - the particular hash I used is the exact one that Blender uses, which is known working (there were some issues with the base 1.7.0 release).

Commands used:

mkdir build
cd build
cmake -G"Ninja" ..
cmake --build .
ctest

All tests pass. This is using VS2022, I wouldn't really use VS2019 for ARM64 platforms if I'm honest.

I didn't test any of the GPU things, although GLUT may work, as I added ARM64 support to FreeGLUT a few years ago.

Addresses #1859 (so probably of interest to @num3ric also)

Signed-off-by: Anthony Roberts <[email protected]>
Copy link

linux-foundation-easycla bot commented Nov 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@num3ric
Copy link
Contributor

num3ric commented Nov 7, 2024

Love it, thanks for the work! Hopefully the CLA & failing tests can be resolved.

@@ -16,7 +16,7 @@ include(FetchContent)
set(FETCHCONTENT_BASE_DIR "${CMAKE_BINARY_DIR}/ext/build/sse2neon")
FetchContent_Declare(sse2neon
GIT_REPOSITORY https://github.com/DLTcollab/sse2neon.git
GIT_TAG v1.6.0
GIT_TAG 227cc413fb2d50b2a10073087be96b59d5364aea
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you couldn't pick an official version number here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long story short, we uncovered some issues with 1.7.0 in Blender on various platforms, and needed to update to a non-versioned commit, as they only version sse2neon once a year - the issues may or may not affect OCIO, but this is at least a known working and tested version that Blender uses.

@anthony-linaro
Copy link
Author

I'll have a dig into those tests and try and figure it out - I don't have those platforms to hand, so will be some guesswork involved.

For the CLA, I'm trying to find out who our internal person is that is responsible for EasyCLA so thay can approve it under our corporate account - I'll find out at some point soon I'm sure

Signed-off-by: Anthony Roberts <[email protected]>
@anthony-linaro
Copy link
Author

Have fixed a small buildfile issue - I am hoping this may resolve the mac issues (sse2neon accidentally got disabled in some configurations).

I have also fixed some additional issues I encountered while debugging (namely it wasn't actually using sse2neon properly outside of the cmake test, oops).

I have been building with python off, there seems to be some sort of Access Violation Exception, but I'm not sure what it is caused by - for now, the rest of the test suite passes so it should be fine.

@anthony-linaro
Copy link
Author

CLA now done!

@num3ric
Copy link
Contributor

num3ric commented Nov 15, 2024

Have you tried (cross-)compiling -A ARM64 from an x64-based PC? Unfortunately #1859 isn't fully addressed here, since compiling this PR still fails for me unless I add:

    if(MSVC)
        set(CMAKE_SYSTEM_PROCESSOR ${MSVC_CXX_ARCHITECTURE_ID})
    endif()

If not, I get OCIO_ARCH_X86 1 and CpuInfo.cpp fails per issue.

PR looks good otherwise though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants