-
Notifications
You must be signed in to change notification settings - Fork 283
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
FortranPythonPackage ignores use_pip #2518
Comments
Indeed
I don't think it reuses anything, it looks like we could put the at least the Additionally, when actually trying to use a different compiler with |
I'm not sure under which conditions it reuses the build. For example for PyTorch, which we now install with
I have found this report in PIP upstream: pypa/pip#6379 (comment)
I also found QML docs
During the search I found some references that this only works for setup.py build backends but with that new PEP517 (or so) it might need something different. No idea there. |
Yeah, when building numpy 1.25.1, I get I read somewhere that |
I asked about how to properly set the Fortran compiler for numpy and the answer was:
Are we doing something very superflous here and the numpy easyblock could just be (or derived from) PythonPackage? Spack only uses the
What do you mean by "does work"? I tried to purposely break the "correct" build by exporting |
I'm using the fujitsu compiler on a64fx. Without setting fcompiler to fujitsu, building numpy fails almost immediately when it tries to determine the version of the Fortran compiler with numpy/distutils/fcompiler/gnu.py instead of numpy/distutils/fcompiler/fujitsu.py (i.e., it does try to use the fujitsu compiler because the environment variable points to it, but it fails simply because it uses the wrong command line option to get the version) Since numpy.distutils is deprecated and will be removed, I suppose these checks could be superfluous, but they are still being executed... |
I just checked the logs and it seems it does:
From what I can tell
I found this https://github.com/numpy/numpy/blob/aad6c9cd1958309110f9892d10b28b1beea9c670/numpy/distutils/fcompiler/gnu.py#L74 which is where it fails for you isn't it? The |
I suppose it shouldn't, and I guess at some point it won't, but it still (as of 1.25.1 at least, haven't tried with 1.26 yet) does...
with older versions of numpy (e.g. 1.20) setting
at least on 1.25.1 (from Scipy-bundle 2023.07), no, it fails on that version check with gnu.py instead of fujitsu.py. To be clear, I'm not asking for anything here, I have a customized fortranpythonpackage.py that works (by changing |
I tested 1.26 and the code isn't called using
Interesting PR. I guess it is WIP because of this issue? And it looks like it really was the intention to always use setup.py for building and pip for installation...
Do you have a backtrace of that? I created a PR for upstream but it likely won't get accepted. But we could use it as a patch for affected numpy versions
By using the spack method?
I'm just trying to understand the problem and how to solve it. E.g. I'm surprised that Spack only needs this for scipy not numpy. And partially why the extra args for pip are required only for Fujitsu but not e.g. Intel |
let me answer first the questions that don't require (re)running anything, I'll answer the ones that do when I get a chance
long story :) (I'm basically coming back to this now, after 3 years: easybuilders/easybuild#704)
I'm fine with clocking the build time in the build step when both methods work, and indeed I didn't stop doing that, but it did bother me when the build with setup.py succeeded and then installation with pip failed, at identifying a compiler (that's why I said "I don't think it reuses anything"; I didn't look at the time it took when it did run, you're right, the install with pip is faster after the build with setup.py) like you said originally, it's odd at least
I suppose so, I've been sticking with the combinations in our common toolchains
I think the error I get is even before that, as soon as
Yes, setting
Yeah, it could be that I'm hitting a corner case, I'll try some different things
I see now that we do have SciPy-bundle-2023.07-iimkl-2023a.eb so that didn't fail. I guess it could be that numpy is somehow auto-detecting the Intel compiler during the install step with pip... |
Or maybe intels version interface is compatible enough with GCC. Given that is a fairly new numpy it is also possible |
I had mentioned SciPy-bundle-2023.07 specifically because that's where I ran into the issues with the Fujitsu compiler, same versions of everything. Ran some tests building SciPy-bundle-2023.07-iimkl-2023a.eb (numpy 1.25.1) the install with pip does still import
yes, your patch does allow installing numpy 1.25.1 with pip, using the Fujitsu compiler, without changing
indeed, tested with SciPy-bundle-2023.11 (numpy 1.26.2), that but it is still called via I suppose for numpy >= 1.26 we should have already added something similar to easybuild-easyblocks/easybuild/easyblocks/s/scipy.py Lines 156 to 161 in 743662d
|
NumPy doesn't need Fortran for building but still initializes the Fortran compiler which fails when the compiler requires a different commandline argument than GCC, e.g. the Fujitsu compiler. Failure message starts with > A valid Fortran version was not found in this string: See easybuilders/easybuild-easyblocks#2518 Patch is from numpy/numpy#26502 which won't get merged but isn't necessary in numpy 1.26+
Added to relevant ECs: easybuilders/easybuild-easyconfigs#20817
Does that mean SciPy-bundle-2023.11 without any changes for Fujitsu fails to build? That would still require the patch to be added.
Looks like that would be possible. However the numpy docs state to use However the official procedure is the same for scipy: https://docs.scipy.org/doc/scipy/building/index.html#building-scipy-from-source. So to me it looks like we need an |
E.g. EB_scipy uses FortranPythonPackage which ignores
use_pip
and always builds with setup.pyIt then uses pip to build the package again (this time without the Fortran settings) and installs that.
Not fully sure if that 2nd step reuses the stuff from the build step, but it looks odd at least
The text was updated successfully, but these errors were encountered: