-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
DOC: Add instructions to build NumPy on WoA #28141
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
Conversation
I'm a little unclear why the NumPy docs need to talk about installing a Fortran compiler? Shouldn't that information be in e.g. the OpenBLAS docs. Glad you got your NumPy install figured out. |
Hi @ngoldbaum
Thanks! |
Sorry, I missed that the surrounding text was already describing how to set up fortran compilers. I don't have time right now to follow these instructions and verify that they're correct, but it looks like an improvement to me. I agree changing the command to not install It seems like there aren't any more blockers to setting up Windows Arm64 CI - maybe we should to that? |
I added the triage review label which should hopefully get the attention of another reviewer with more context about Windows packaging to hit the merge button or give you more comments. |
doc/source/building/index.rst
Outdated
tests, simply using MSVC is easiest. Otherwise, you will need the following | ||
set of compilers: | ||
|
||
1. MSVC + Flang-new (``flang-new``) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the ifx
compiler and lfortran
? Perhaps @certik knows better about ARM64 support (don't have a machine to test).
Otherwise this looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think currently the above is correct. If there is interest from anybody, we are open to collaborate with NumPy on LFortran support. Otherwise I recommend to wait until we reach beta quality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in LLVM 20 (release imminent I think, it's at 20.1.0rc3 now), flang-new
becomes simply flang
. That would be good to include here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @Mugundanmcw!
On a second read-through, I think most of this is probably better situated in the context of the f2py/windows/
folder. However, there's plenty of duplication as is, so I'm changing this to a comment instead of a requested change.
Since a bunch of windows + fortran compiler toolchains are discussed there, adding these instructions in a new file, say arm64.rst
then to the f2py/windows/index.rst
and finally linking to that file from the building
document makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, perhaps a follow up de-duplicating information in the F2PY documentation would be nice.
EDIT: Now tracked in #28187
|
||
.. tab-item:: MSVC | ||
|
||
The MSVC installer does not put the compilers on the system path, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth specifying a .config
file for a minimal Visual Studio install that will support the build? As in the one that used to be at https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/native-clang-for-windows-on-arm - you can find an intact woa.config
file at https://web.archive.org/web/20200915005824/https://s3armawstosg.s3-us-west-2.amazonaws.com/clang/10.0.1/woa.vsconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking to a gist like that with a stable URL would be useful - it's too long to include verbatim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rgommers It is necessary to link VS config file for MSVC, I have a minimal VS config that supports building NumPy on WoA, but how that could be linked over here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between from VS installer, installing Desktop development with C++ workload is more enough to build NumPy on WoA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but how that could be linked over here?
My suggestion was a gist, meaning you put it at https://gist.github.com/ as a new gist under your username and link to that.
doc/source/building/index.rst
Outdated
In Windows on ARM64, the set of a compiler options that are available for | ||
building NumPy are limited. Compilers such as GCC and GFortran are not yet | ||
supported for Windows on ARM64. Currently, the NumPy build for Windows on ARM64 | ||
is supported with MSVC toolchain only. The use of a Fortran compiler is more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this limitation is fixed now that #28234 is merged - would you mind pushing a quick edit of this text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty close. A few comments.
doc/source/building/index.rst
Outdated
tests, simply using MSVC is easiest. Otherwise, you will need the following | ||
set of compilers: | ||
|
||
1. MSVC + Flang-new (``flang-new``) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that in LLVM 20 (release imminent I think, it's at 20.1.0rc3 now), flang-new
becomes simply flang
. That would be good to include here.
doc/source/building/index.rst
Outdated
1. MSVC + Flang-new (``flang-new``) | ||
|
||
First, install Microsoft Visual Studio - the 2022 Community Edition will | ||
work(see the `Visual Studio download site <https://visualstudio.microsoft.com/downloads/>`__). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: space after "work"
doc/source/building/index.rst
Outdated
of Visual Studio can be deselected if desired, to save disk space). The | ||
recommended version of the UCRT is >= 10.0.22621.0. | ||
|
||
To use flang-new fortran compiler for Windows on ARM64, install Latest LLVM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here better to call it "the Flang compiler"
|
||
.. tab-item:: MSVC | ||
|
||
The MSVC installer does not put the compilers on the system path, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking to a gist like that with a stable URL would be useful - it's too long to include verbatim.
doc/source/building/index.rst
Outdated
Building NumPy with BLAS and LAPACK functions requires OpenBLAS | ||
library at Runtime. In Windows on ARM64, this can be done by setting | ||
up pkg-config for OpenBLAS dependency. The build steps for OpenBLAS | ||
for Windows on ARM64 can be found `here <https://github.com/OpenMathLib/OpenBLAS/blob/develop/docs/install.md#windows-on-arm>`__. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to link to the actual html docs here: http://www.openmathlib.org/OpenBLAS/docs/install/#windows-on-arm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rgommers yeah sure, would make the appropriate changes and edit the PR
@rgommers, @matthew-brett, and @ngoldbaum, could you please review the latest commit which includes the necessary changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no Windows expert but this definitely looks like an improvement and I don't see any issues.
Test failures are unrelated and will likely go away if you merge with main or push a commit with annotations that it doesn't need actions, cirrus, or azp CI: https://numpy.org/doc/stable/dev/development_workflow.html#commands-to-skip-continuous-integration
The docs build runs on circleci so you do need that.
Thanks @Mugundanmcw . |
This pull request introduces documentation to guide users for building NumPy from source on Windows on Arm64(WoA).