-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Document how to handle problems with CMake finding NumPy in cross-compilation #2260
Comments
Just a comment on a part of the commit message:
I totally understand why that message is confusing, but just to explain its rationale. Basically the singular variables ( |
By the way, a kind of related aspect is it may be possible to actually fix CMake and/or conda-forge infrastructure to make sure that all headers are found out of the box if the cmake minimum required is high enough, instead of specifying manually everywhere. However, I tried to investigate a bit on that and at at the moment I did not get a clear idea on this. Related recipes that use workarounds:
|
Yes another thing for numpy>=2, it seems that the right include dirs are:
while with numpy<2 they were:
|
Is this code no longer correct NUMPY_INC=$(python -c 'import numpy;print(numpy.get_include())') |
I guess it is still correct, but that point to the numpy in the build environment, not the one in the host, right? I do not know enough about numpy headers to know if the two are equivalent. |
I thought the whole point of the cross python stuff was that it actually tricked things into thinking it was the host environment. But maybe I was just assuming too much. I think at least today, you are correct:
It might be related to some recent cross compilation failures. One thing we should highlight is the huge difference between However, it took a while for packages to adopt in the source repos, often due to trying to ensure they targetted a wide range of python/cmake versions (e.g. scikit-build/scikit-build#1032). Without backward compatibility, it was hard to sell many developers on the "new style" flags. |
That's the wrong conclusion. The headers there are correct. Notice the venv there. |
Ah, good to know, this was never clear to me! |
I guess i had alot of trouble finding "numpy" in cross compilation in vigra, and i still can't figure it out xref: conda-forge/vigra-feedstock#139 |
Whatever the "right" way is to find the numpy and python, i would appreciate some help in |
Sorry, I missed the comment, see https://github.com/conda-forge/pytorch-cpu-feedstock/pull/256/files#r1781037695 . |
Based on what happened in conda-forge/idyntree-feedstock#109 and the input of this thread, I think I reached a clean enough strategy in conda-forge/idyntree-feedstock#109 . |
I made a proposal to document this in #2321, feel free to comment and suggest improvements. |
This is exacerbated by the fact that the error messages by CMake point at the wrong variables, so it can be quite frustrating to figure out. I wrote down my understanding of this in conda-forge/faiss-split-feedstock@80dab60, perhaps we can distill some of that into the knowledge base.
CC @traversaro
The text was updated successfully, but these errors were encountered: