pytorch/tools/setup_helpers
Mark Harfouche 9d32aa9789 Help fix numpy detection in cross compiled layouts (#137084)
We had trouble at conda-forge getting numpy to get detected on aarch64 due to our splayed layout and cross compilation needs.

see:
* https://github.com/conda-forge/pytorch-cpu-feedstock/pull/256
* https://github.com/conda-forge/pytorch-cpu-feedstock/issues/266
* https://github.com/conda-forge/pytorch-cpu-feedstock/pull/267

This is my attempt at making an "upstreamable patch" that tries to follow your structure.

It could introduce a new environment variable `Python_NumPy_INCLUDE_DIR` if you want, but CMake doesn't use it as an environment variable, so I feel like that would be weird.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/137084
Approved by: https://github.com/atalman
2025-07-29 12:08:56 +00:00
..
__init__.py [build] remove cmake cache and reconfigure again if it is invalid (#156958) 2025-07-02 18:46:32 +00:00
BUILD.bazel
build.bzl Revert "[CI] update flake8 and mypy lint dependencies (#158720)" 2025-07-28 22:02:10 +00:00
cmake_utils.py Add scripts to check xrefs and urls (#151844) 2025-04-28 09:30:07 +00:00
cmake.py Help fix numpy detection in cross compiled layouts (#137084) 2025-07-29 12:08:56 +00:00
env.py [BE] add a linter to check consistency for cmake minimum version in requirements (#156961) 2025-07-09 10:44:17 +00:00
gen_unboxing.py [BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374) 2024-12-29 17:23:13 +00:00
gen_version_header.py [3/N] Apply py39 ruff fixes (#142115) 2024-12-11 17:50:10 +00:00
gen.py [BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374) 2024-12-29 17:23:13 +00:00
generate_code.py [BE][CI] bump ruff to 0.9.2: multiline assert statements (#144546) 2025-02-27 20:46:16 +00:00
generate_linker_script.py Allow users to overwrite ld with environment variable in linker optimization script (#137331) 2024-11-26 22:54:24 +00:00