CMake fixes for building ArrayFire oneAPI backend in windows #3610
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement CMake changes to fix building oneAPI in Windows
Description
Fixes: #3609
Changes:
CMAKE_MSVC_RUNTIME_LIBRARY=""
and added manually the correct MSVC Runtime Library compile flag(
-MT/MD/MTd/MDd
) for the icx when building oneAPIConsequences:
Using the Intel oneAPI DPC++ Compiler Reference as a baseline, the correct way to build the oneAPI backend in windows is as follows (using MSVC2022 and oneapi 2025 for example):
In command prompt use:
In powershell use
In command prompt use:
In powershell use:
Ninja
generator with the C and C++ compilers set tocl
and the SYCL compiler set toicx
:cmake --build build --target afoneapi -j 4
(From testing it seems that the
icx
compiler tends to use a lot of memory and crash if there are lots of jobs being executed. I recommend-j 4
for an 8-core machine specifically for building theafoneapi
target. Furthermore, the linking step forafoneapi.lib
takes a significant amount of time).Changes to Users
Checklist