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

Ninja build on Windows #934

Open
inakleinbottle opened this issue Oct 22, 2024 · 5 comments
Open

Ninja build on Windows #934

inakleinbottle opened this issue Oct 22, 2024 · 5 comments

Comments

@inakleinbottle
Copy link

Are there any plans to allow for Ninja builds on Windows? MSBuild is dreadfully slow - A simple package I build takes ~ 100 seconds to build a single wheel on Windows, whilst MacOS finishes all 6 of its builds in 125 seconds.

MSVC does have support for Ninja, and if I remember correctly SciKit-Build did once support Ninja builds on Windows, which as much faster.

What are the obstacles for supporting Ninja with MSVC builds? Can they be added in a vendored scikit-build-core for my larger complex builds?

@tikuma-lsuhsc
Copy link

tikuma-lsuhsc commented Oct 22, 2024

I cannot speak of the scikit-build-core's native support, but you can always add CMAKE_GENERATOR system environment variable and set it to Ninja and CMake will use it by default. This works fine with scikit-build-core.

https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR.html

@henryiii
Copy link
Collaborator

Are you sure it’s the build system is the problem and not the compiler? MSVC is very slow. But yes, you can set -GNinja in your CMake args or the envvar above and scikit-build-core will adapt.

@inakleinbottle
Copy link
Author

Actually the problem that I have is that I can set the generator to Ninja, but it doesn't find the correct compiler in GitHub actions. Honestly I'd like to use anything other than MSVC because of its many shortcomings, but I guess it is the only way to ensure compatibility with Windows users. I know the Numpy devs are considering using clang-cl instead, but AFAIK they haven't moved over yet for much the same reason.

@henryiii
Copy link
Collaborator

You need to setup msvc to get ninja to find it. Something like https://github.com/ilammy/msvc-dev-cmd should work.

@inakleinbottle
Copy link
Author

OK that's great, I'll take a look!

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

No branches or pull requests

3 participants