oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

[Question] Build instructions for Windows? #56

Open jjfumero opened 3 years ago

jjfumero commented 3 years ago

Is there any documentation about how to build level-zero from source on Windows 10? The documentation only specifies for Linux.

Jemale commented 3 years ago

Thanks for pointing out this gap @jjfumero, the README should be updated to include instructions for building on Windows in addition to Linux.

The tested/recommended compiler is MSVC including the Spectre-mitigation libraries. CMAKE (tested with version 3.14.0-rc2) can then be used as on Linux:

mkdir build cd build cmake .. cmake --build . --config Release

jjfumero commented 3 years ago

Thank you @Jemale . Can you expand on the configuration to be done for enabling Spectre-mitigation? I guess it is the /Qspectre option.

Jemale commented 3 years ago

That configuration is done already in https://github.com/oneapi-src/level-zero/blob/284ccb089184180e34864a9f1e23971d3d736bd8/CMakeLists.txt#L77

The required libraries should be installed with the Visual Studio installer. Under the 'Compilers' section in the 'Individual Components' tab it should look something like this:

image

and under the 'SDKs' section:

image

jjfumero commented 3 years ago

Thank you @Jemale. It worked. I had to install the missing packages for the Spectre mitigation.

If you think it is useful, I can open a PR with the documentation for the windows build.

Jemale commented 3 years ago

@jjfumero Yes, feel free to do that :)