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

DOC: building on Windows uses GCC with Meson, not MSVC #16322

Closed
mattip opened this issue May 30, 2022 · 7 comments · Fixed by #18429
Closed

DOC: building on Windows uses GCC with Meson, not MSVC #16322

mattip opened this issue May 30, 2022 · 7 comments · Fixed by #18429
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org Meson Items related to the introduction of Meson as the new build system for SciPy
Milestone

Comments

@mattip
Copy link
Contributor

mattip commented May 30, 2022

When looking at the meson-generated build.ninja on windows, on a machine that is duplicating the CI build, it seems there is no use of msvc only gcc. Is this correct? If so it might be nice to document this in the meson build faq. Also I think the build requires the rtools gcc compiler, I have had problems with standard mingw.

Another niggle: meson build --debug on windows sets the gcc flags to "-O2" "-g". Is using -O2 intentional for the debug builds?

@tylerjereddy tylerjereddy added Meson Items related to the introduction of Meson as the new build system for SciPy Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org labels May 30, 2022
@eli-schwartz
Copy link
Contributor

eli-schwartz commented May 31, 2022

Another niggle: meson build --debug on windows sets the gcc flags to "-O2" "-g". Is using -O2 intentional for the debug builds?

Meson has a "buildtype" option, which can be set to release/debug/debugoptimized/minsize etc. This is described at https://mesonbuild.com/Builtin-options.html#core-options

It will bidirectionally map to the individual options "debug" and "optimization" which are separately toggleable -- one sets -g, the other sets -O. Please check what your current setting is there.

Per the listed table -- debugoptimized maps to debug=true optimization=2, and SciPy sets the default buildtype to debugoptimized in the project options.

So, what I think happens is that first the buildtype gets set to debugoptimized, which maps debug to true and optimization to 2, and then you override the individual debug option to true (which it already is, FWIW). What you actually want to do is override the buildtype to debug, which can be done with:

meson setup build/ --buildtype=debug

@mattip
Copy link
Contributor Author

mattip commented May 31, 2022

Thanks.

What you actually want to do is override the buildtype to debug ... meson setup build/ --buildtype=debug

This should probably be in the scipy developer documentation as well.

Edit: add "scipy" to make it clear which developer documentation needs to mention the option.

@rgommers
Copy link
Member

When looking at the meson-generated build.ninja on windows, on a machine that is duplicating the CI build, it seems there is no use of msvc only gcc.

Yes, that is correct. Well, more or less - you can use MSVC just fine if you have a matching Fortran compiler - i.e. Intel Fortran. The MSVC + gfortran hack is not available.

@carlkl
Copy link
Member

carlkl commented May 31, 2022

@mattip
Copy link
Contributor Author

mattip commented May 31, 2022

The windows 10 wiki page, maintained by @mckib2, will need updating.

@rgommers rgommers changed the title BLD: windows, meson, and gcc DOC: building on Windows uses GCC with Meson, not MSVC May 31, 2022
@mckib2
Copy link
Contributor

mckib2 commented Jun 1, 2022

The windows 10 wiki page, maintained by @mckib2, will need updating.

This was from a while ago (pre-Pythran) building via venv/pip and can be considered unmaintained as changes with clang/Pythran broke the environment described in that page. Meson should hopefully be easier to setup. Best course of action is to delete/archive?

@rgommers
Copy link
Member

rgommers commented Jun 1, 2022

There's no such thing as archiving wiki pages I think, so either deleting or adding a prominent note at the top saying this may be outdated is likely the way to go.

That said, I can see a case for updating it. The main pain points there are things like installing the right compiler and downloading the right OpenBLAS, dealing with PowerShell and Chocolatey. Those are probably not things to include in the contributor docs. I'd probably reference .github/workflows/windows.yml for those. The tl;dr is that that remains a pain, and Windows users are best served using WSL unless they want to work on Windows-specific things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org Meson Items related to the introduction of Meson as the new build system for SciPy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants