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

BUG: Cannot build main on MacOS M1 #24450

Closed
code-of-kpp opened this issue Aug 18, 2023 · 9 comments · Fixed by #24468
Closed

BUG: Cannot build main on MacOS M1 #24450

code-of-kpp opened this issue Aug 18, 2023 · 9 comments · Fixed by #24468
Labels
00 - Bug Meson Items related to the introduction of Meson as the new build system for NumPy

Comments

@code-of-kpp
Copy link

code-of-kpp commented Aug 18, 2023

Describe the issue:

Most likely related to 4ec0182 by @seiko2plus and gh-23096.

Fresh install, git clone, submodules update

dependencies installed via pip install -r (I installed all the files, but when just build dependencies installed, the situation is the same).

I'm building with openblass installed from homebrew, and I do:
export PKG_CONFIG_PATH=/opt/homebrew/Cellar/openblas/0.3.23/lib/pkgconfig/
for it to get detected.

I tried to build with clang 16.0.6 from brew and 14.0.3 (coming with MacOs).

spin build fails.

Reproduce the code example:

Edit(Sayed): You have to build numpy using distutils with the in-place option enabled, followed by spin build --clean.

python setup.py build_ext -i
rm -rf ./build
spin build --clean

Error message:

...
Test features "NEON NEON_FP16 NEON_VFPV4 ASIMD" : Supported 
Test features "ASIMDHP" : Supported 
Test features "ASIMDFHM" : Supported 
Configuring npy_cpu_dispatch_config.h using configuration
Message: 
CPU Optimization Options
  baseline:
    Requested : min
    Enabled   : NEON NEON_FP16 NEON_VFPV4 ASIMD
  dispatch:
    Requested : max -xop -fma4
    Enabled   : ASIMDHP ASIMDFHM
...
[44/306] Compiling C object numpy/core/lib_uma...SIMDHP.a.p/src_umath__umath_tests.dispatch.c.
FAILED: numpy/core/lib_umath_tests.dispatch.h_ASIMDHP.a.p/src_umath__umath_tests.dispatch.c.o 
/usr/bin/clang -Inumpy/core/lib_umath_tests.dispatch.h_ASIMDHP.a.p -Inumpy/core -I../numpy/core -Inumpy/core/include -I../numpy/core/include -I../numpy/core/src/common -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I/opt/homebrew/opt/llvm/include -I/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu -fcolor-diagnostics -Wall -Winvalid-pch -std=c99 -O2 -g -fno-strict-aliasing -ftrapping-math -DNPY_HAVE_NEON_VFPV4 -DNPY_HAVE_NEON_FP16 -DNPY_HAVE_NEON -DNPY_HAVE_ASIMD -DNPY_HAVE_ASIMDHP -march=armv8.2-a+fp16 -DNPY_MTARGETS_CURRENT=ASIMDHP -MD -MQ numpy/core/lib_umath_tests.dispatch.h_ASIMDHP.a.p/src_umath__umath_tests.dispatch.c.o -MF numpy/core/lib_umath_tests.dispatch.h_ASIMDHP.a.p/src_umath__umath_tests.dispatch.c.o.d -o numpy/core/lib_umath_tests.dispatch.h_ASIMDHP.a.p/src_umath__umath_tests.dispatch.c.o -c ../numpy/core/src/umath/_umath_tests.dispatch.c
../numpy/core/src/umath/_umath_tests.dispatch.c:18:1: error: expected identifier or '('
NPY_CPU_DISPATCH_DECLARE(const char *_umath_tests_dispatch_func, (void))
^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:194:5: note: expanded from macro 'NPY_CPU_DISPATCH_DECLARE'
    NPY_MTARGETS_CONF_DISPATCH(NPY_CPU_DISPATCH_DECLARE_CHK_, NPY_CPU_DISPATCH_DECLARE_CB_, __VA_ARGS__) \
    ^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:94:10: note: expanded from macro 'NPY_MTARGETS_CONF_DISPATCH'
         &&"Expected config header that generated by mod_features.multi_targets()";
         ^
../numpy/core/src/umath/_umath_tests.dispatch.c:18:1: error: expected identifier or '('
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:195:5: note: expanded from macro 'NPY_CPU_DISPATCH_DECLARE'
    NPY_MTARGETS_CONF_BASELINE(NPY_CPU_DISPATCH_DECLARE_BASE_CB_, __VA_ARGS__)
    ^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:92:10: note: expanded from macro 'NPY_MTARGETS_CONF_BASELINE'
         &&"Expected config header that generated by mod_features.multi_targets()";
         ^
../numpy/core/src/umath/_umath_tests.dispatch.c:19:1: error: expected identifier or '('
NPY_CPU_DISPATCH_DECLARE(extern const char *_umath_tests_dispatch_var)
^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:194:5: note: expanded from macro 'NPY_CPU_DISPATCH_DECLARE'
    NPY_MTARGETS_CONF_DISPATCH(NPY_CPU_DISPATCH_DECLARE_CHK_, NPY_CPU_DISPATCH_DECLARE_CB_, __VA_ARGS__) \
    ^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:94:10: note: expanded from macro 'NPY_MTARGETS_CONF_DISPATCH'
         &&"Expected config header that generated by mod_features.multi_targets()";
         ^
../numpy/core/src/umath/_umath_tests.dispatch.c:19:1: error: expected identifier or '('
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:195:5: note: expanded from macro 'NPY_CPU_DISPATCH_DECLARE'
    NPY_MTARGETS_CONF_BASELINE(NPY_CPU_DISPATCH_DECLARE_BASE_CB_, __VA_ARGS__)
    ^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:92:10: note: expanded from macro 'NPY_MTARGETS_CONF_BASELINE'
         &&"Expected config header that generated by mod_features.multi_targets()";
         ^
../numpy/core/src/umath/_umath_tests.dispatch.c:20:1: error: expected identifier or '('
NPY_CPU_DISPATCH_DECLARE(void _umath_tests_dispatch_attach, (PyObject *list))
^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:194:5: note: expanded from macro 'NPY_CPU_DISPATCH_DECLARE'
    NPY_MTARGETS_CONF_DISPATCH(NPY_CPU_DISPATCH_DECLARE_CHK_, NPY_CPU_DISPATCH_DECLARE_CB_, __VA_ARGS__) \
    ^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:94:10: note: expanded from macro 'NPY_MTARGETS_CONF_DISPATCH'
         &&"Expected config header that generated by mod_features.multi_targets()";
         ^
../numpy/core/src/umath/_umath_tests.dispatch.c:20:1: error: expected identifier or '('
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:195:5: note: expanded from macro 'NPY_CPU_DISPATCH_DECLARE'
    NPY_MTARGETS_CONF_BASELINE(NPY_CPU_DISPATCH_DECLARE_BASE_CB_, __VA_ARGS__)
    ^
/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu/npy_cpu_dispatch_config.h:92:10: note: expanded from macro 'NPY_MTARGETS_CONF_BASELINE'
         &&"Expected config header that generated by mod_features.multi_targets()";
         ^
6 errors generated.
[45/306] Compiling C object numpy/core/lib_uma...seline.a.p/src_umath__umath_tests.dispatch.c.
FAILED: numpy/core/lib_umath_tests.dispatch.h_baseline.a.p/src_umath__umath_tests.dispatch.c.o 
/usr/bin/clang -Inumpy/core/lib_umath_tests.dispatch.h_baseline.a.p -Inumpy/core -I../numpy/core -Inumpy/core/include -I../numpy/core/include -I../numpy/core/src/common -I/opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -I/opt/homebrew/opt/llvm/include -I/Users/konstantin.ignatov/github.com/numpy/numpy/build/meson_cpu -fcolor-diagnostics -Wall -Winvalid-pch -std=c99 -O2 -g -fno-strict-aliasing -ftrapping-math -DNPY_HAVE_NEON_VFPV4 -DNPY_HAVE_NEON_FP16 -DNPY_HAVE_NEON -DNPY_HAVE_ASIMD -DNPY_MTARGETS_BASELINE -MD -MQ numpy/core/lib_umath_tests.dispatch.h_baseline.a.p/src_umath__umath_tests.dispatch.c.o -MF numpy/core/lib_umath_tests.dispatch.h_baseline.a.p/src_umath__umath_tests.dispatch.c.o.d -o numpy/core/lib_umath_tests.dispatch.h_baseline.a.p/src_umath__umath_tests.dispatch.c.o -c ../numpy/core/src/umath/_umath_tests.dispatch.c

Runtime information:

>>> # python setup.py build_ext -i # kinda works
>>> import sys, numpy; print(numpy.__version__); print(sys.version)
2.0.0.dev0+git20230817.bdcd1c8
3.11.4 (main, Jun 20 2023, 17:23:00) [Clang 14.0.3 (clang-1403.0.22.14.1)]
>>> import numpy
>>> numpy.show_runtime()
[{'numpy_version': '2.0.0.dev0+git20230817.bdcd1c8',
  'python': '3.11.4 (main, Jun 20 2023, 17:23:00) [Clang 14.0.3 '
            '(clang-1403.0.22.14.1)]',
  'uname': uname_result(system='Darwin', node='kpp-s1', release='22.6.0', version='Darwin Kernel Version 22.6.0: Wed Jul  5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000', machine='arm64')},
 {'simd_extensions': {'baseline': ['NEON', 'NEON_FP16', 'NEON_VFPV4', 'ASIMD'],
                      'found': ['ASIMDHP', 'ASIMDDP'],
                      'not_found': ['ASIMDFHM']}}]

Context for the issue:

I was working on numpy sprint at EuroSciPy and couldn't finish the setup.
/cc @seberg

@seiko2plus
Copy link
Member

Have you tried using spin build --clean? It seems that the configuration file for the _umath_tests.dispatch.h target is empty for some reason. Though I'm not certain why this occurred, could it be due to configuration process was interpreted during certain stage.

Could you provide the Meson log? You can find it at build/meson-logs/meson-log.txt. Sharing the generated config file at build/numpy/core/_umath_tests.dispatch.h would also help me better understand the issue. Thanks!

@rgommers rgommers added the Meson Items related to the introduction of Meson as the new build system for NumPy label Aug 18, 2023
@code-of-kpp
Copy link
Author

code-of-kpp commented Aug 20, 2023

Have you tried using spin build --clean?

Yes, sorry for not clarifying this. Absolutely fresh setup, starting with git/git clone has the same problem.

It seems that the configuration file for the _umath_tests.dispatch.h target is empty for some reason

$ cat build/numpy/core/_umath_tests.dispatch.h
/* Autogenerated by the Meson features module. */
/* Do not edit, your changes will be lost. */

#undef NPY__MTARGETS_EXPAND
#define NPY__MTARGETS_EXPAND(X) X

#undef NPY_MTARGETS_CONF_BASELINE
#define NPY_MTARGETS_CONF_BASELINE(EXEC_CB, ...) NPY__MTARGETS_EXPAND(EXEC_CB(__VA_ARGS__))

#undef NPY_MTARGETS_CONF_DISPATCH
#define NPY_MTARGETS_CONF_DISPATCH(TEST_CB, EXEC_CB, ...) \
NPY__MTARGETS_EXPAND(EXEC_CB((TEST_CB(ASIMD)&&TEST_CB(ASIMDHP)), ASIMDHP, __VA_ARGS__))

Could you provide the Meson log?

meson-log.txt

Sure, let me know if I missed something that could help

@seiko2plus
Copy link
Member

seiko2plus commented Aug 20, 2023

The configuration stage appears to be correct, and the auto-generated file is not empty and well-defined. However, an empty inclusion has somehow been included within the following code section:

#ifndef NPY_DISABLE_OPTIMIZATION
#include "_umath_tests.dispatch.h"
#endif
NPY_CPU_DISPATCH_DECLARE(const char *_umath_tests_dispatch_func, (void))

To address this issue, it's suggested that you apply the following patch to explicitly define the generated config macros and rebuild the code to determine if the build process passes:

diff --git a/numpy/core/src/umath/_umath_tests.dispatch.c b/numpy/core/src/umath/_umath_tests.dispatch.c
index 9d8df4c86..73a11a16d 100644
--- a/numpy/core/src/umath/_umath_tests.dispatch.c
+++ b/numpy/core/src/umath/_umath_tests.dispatch.c
@@ -13,6 +13,17 @@
 
 #ifndef NPY_DISABLE_OPTIMIZATION
     #include "_umath_tests.dispatch.h"
+    /* Autogenerated by the Meson features module. */
+    /* Do not edit, your changes will be lost. */
+    #undef NPY__MTARGETS_EXPAND
+    #define NPY__MTARGETS_EXPAND(X) X
+
+    #undef NPY_MTARGETS_CONF_BASELINE
+    #define NPY_MTARGETS_CONF_BASELINE(EXEC_CB, ...) NPY__MTARGETS_EXPAND(EXEC_CB(__VA_ARGS__))
+
+    #undef NPY_MTARGETS_CONF_DISPATCH
+    #define NPY_MTARGETS_CONF_DISPATCH(TEST_CB, EXEC_CB, ...) \
+    NPY__MTARGETS_EXPAND(EXEC_CB((TEST_CB(ASIMD)&&TEST_CB(ASIMDHP)), ASIMDHP, __VA_ARGS__))
 #endif
 
 NPY_CPU_DISPATCH_DECLARE(const char *_umath_tests_dispatch_func, (void))

However, before applying the patch, it would be helpful to provide the complete build log to gain better insights into the issue. You can generate the build log using the following command:

git clean -xdf
spin build --clean &> numpy_spin_build.txt

Then please attach the numpy_spin_build.txt file to assist in diagnosing the potential problem. Based on my understanding, it's possible that an empty header of _umath_tests.dispatch.h defined else where in the searched directories might be overriding the expected build/numpy/core/_umath_tests.dispatch.h

or maybe not empty header but likely the disutils configuration header been generated in place through the command:

python setup.py build_ext -i

so please make sure of cleaning the directory before using spin build through:

git clean -xdf

@code-of-kpp
Copy link
Author

or maybe not empty header but likely the disutils configuration header been generated in place through the command

Yes, this seems to be the issue. git clean -dx did the trick, it's working now.
I was removing build directory instead, apparently this isn't enough.

@code-of-kpp
Copy link
Author

Just in case, these are the files that were removed by git clean, probably spin's --clean flag should remove them too.

Removing .hypothesis/
Removing .pytest_cache/
Removing .spin/__pycache__/
Removing .vscode/
Removing build/
Removing cythonize.dat
Removing numpy/__config__.py
Removing numpy/__pycache__/
Removing numpy/_build_utils/__pycache__/
Removing numpy/_pyinstaller/__pycache__/
Removing numpy/_typing/__pycache__/
Removing numpy/_utils/__pycache__/
Removing numpy/array_api/__pycache__/
Removing numpy/array_api/tests/__pycache__/
Removing numpy/compat/__pycache__/
Removing numpy/compat/tests/__pycache__/
Removing numpy/core/__pycache__/
Removing numpy/core/_multiarray_tests.cpython-311-darwin.so
Removing numpy/core/_multiarray_umath.cpython-311-darwin.so
Removing numpy/core/_operand_flag_tests.cpython-311-darwin.so
Removing numpy/core/_rational_tests.cpython-311-darwin.so
Removing numpy/core/_simd.cpython-311-darwin.so
Removing numpy/core/_struct_ufunc_tests.cpython-311-darwin.so
Removing numpy/core/_umath_tests.cpython-311-darwin.so
Removing numpy/core/code_generators/__pycache__/
Removing numpy/core/include/numpy/__multiarray_api.c
Removing numpy/core/include/numpy/__multiarray_api.h
Removing numpy/core/include/numpy/__ufunc_api.c
Removing numpy/core/include/numpy/__ufunc_api.h
Removing numpy/core/include/numpy/__umath_generated.c
Removing numpy/core/include/numpy/_numpyconfig.h
Removing numpy/core/include/numpy/_umath_doc_generated.h
Removing numpy/core/include/numpy/config.h
Removing numpy/core/lib/
Removing numpy/core/src/_simd/_simd.dispatch.c
Removing numpy/core/src/_simd/_simd.dispatch.h
Removing numpy/core/src/_simd/_simd_data.inc
Removing numpy/core/src/_simd/_simd_inc.h
Removing numpy/core/src/common/npy_sort.h
Removing numpy/core/src/common/templ_common.h
Removing numpy/core/src/multiarray/_multiarray_tests.c
Removing numpy/core/src/multiarray/argfunc.dispatch.c
Removing numpy/core/src/multiarray/argfunc.dispatch.h
Removing numpy/core/src/multiarray/arraytypes.c
Removing numpy/core/src/multiarray/arraytypes.h
Removing numpy/core/src/multiarray/einsum.c
Removing numpy/core/src/multiarray/einsum_sumprod.c
Removing numpy/core/src/multiarray/lowlevel_strided_loops.c
Removing numpy/core/src/multiarray/nditer_templ.c
Removing numpy/core/src/multiarray/scalartypes.c
Removing numpy/core/src/npymath/ieee754.c
Removing numpy/core/src/npymath/npy_math_complex.c
Removing numpy/core/src/npymath/npy_math_internal.h
Removing numpy/core/src/npysort/simd_qsort.dispatch.h
Removing numpy/core/src/npysort/simd_qsort_16bit.dispatch.h
Removing numpy/core/src/umath/_umath_tests.c
Removing numpy/core/src/umath/_umath_tests.dispatch.asimdhp.c
Removing numpy/core/src/umath/_umath_tests.dispatch.h
Removing numpy/core/src/umath/funcs.inc
Removing numpy/core/src/umath/loops.c
Removing numpy/core/src/umath/loops.h
Removing numpy/core/src/umath/loops_arithm_fp.dispatch.c
Removing numpy/core/src/umath/loops_arithm_fp.dispatch.h
Removing numpy/core/src/umath/loops_arithmetic.dispatch.c
Removing numpy/core/src/umath/loops_arithmetic.dispatch.h
Removing numpy/core/src/umath/loops_autovec.dispatch.c
Removing numpy/core/src/umath/loops_autovec.dispatch.h
Removing numpy/core/src/umath/loops_comparison.dispatch.c
Removing numpy/core/src/umath/loops_comparison.dispatch.h
Removing numpy/core/src/umath/loops_exponent_log.dispatch.c
Removing numpy/core/src/umath/loops_exponent_log.dispatch.h
Removing numpy/core/src/umath/loops_hyperbolic.dispatch.c
Removing numpy/core/src/umath/loops_hyperbolic.dispatch.h
Removing numpy/core/src/umath/loops_logical.dispatch.c
Removing numpy/core/src/umath/loops_logical.dispatch.h
Removing numpy/core/src/umath/loops_minmax.dispatch.c
Removing numpy/core/src/umath/loops_minmax.dispatch.h
Removing numpy/core/src/umath/loops_modulo.dispatch.c
Removing numpy/core/src/umath/loops_modulo.dispatch.h
Removing numpy/core/src/umath/loops_trigonometric.dispatch.c
Removing numpy/core/src/umath/loops_trigonometric.dispatch.h
Removing numpy/core/src/umath/loops_umath_fp.dispatch.c
Removing numpy/core/src/umath/loops_umath_fp.dispatch.h
Removing numpy/core/src/umath/loops_unary.dispatch.c
Removing numpy/core/src/umath/loops_unary.dispatch.h
Removing numpy/core/src/umath/loops_unary_complex.dispatch.c
Removing numpy/core/src/umath/loops_unary_complex.dispatch.h
Removing numpy/core/src/umath/loops_unary_fp.dispatch.c
Removing numpy/core/src/umath/loops_unary_fp.dispatch.h
Removing numpy/core/src/umath/loops_unary_fp_le.dispatch.c
Removing numpy/core/src/umath/loops_unary_fp_le.dispatch.h
Removing numpy/core/src/umath/loops_utils.h
Removing numpy/core/src/umath/matmul.c
Removing numpy/core/src/umath/matmul.h
Removing numpy/core/src/umath/scalarmath.c
Removing numpy/core/tests/__pycache__/
Removing numpy/distutils/__config__.py
Removing numpy/distutils/__pycache__/
Removing numpy/distutils/command/__pycache__/
Removing numpy/distutils/fcompiler/__pycache__/
Removing numpy/distutils/tests/__pycache__/
Removing numpy/f2py/__pycache__/
Removing numpy/f2py/tests/__pycache__/
Removing numpy/fft/__pycache__/
Removing numpy/fft/_pocketfft_internal.cpython-311-darwin.so
Removing numpy/fft/tests/__pycache__/
Removing numpy/lib/__pycache__/
Removing numpy/lib/tests/__pycache__/
Removing numpy/linalg/__pycache__/
Removing numpy/linalg/_umath_linalg.cpython-311-darwin.so
Removing numpy/linalg/lapack_lite.cpython-311-darwin.so
Removing numpy/linalg/tests/__pycache__/
Removing numpy/ma/__pycache__/
Removing numpy/ma/tests/__pycache__/
Removing numpy/matrixlib/__pycache__/
Removing numpy/matrixlib/tests/__pycache__/
Removing numpy/polynomial/__pycache__/
Removing numpy/polynomial/tests/__pycache__/
Removing numpy/random/__pycache__/
Removing numpy/random/_bounded_integers.c
Removing numpy/random/_bounded_integers.cpython-311-darwin.so
Removing numpy/random/_bounded_integers.pxd
Removing numpy/random/_bounded_integers.pyx
Removing numpy/random/_common.c
Removing numpy/random/_common.cpython-311-darwin.so
Removing numpy/random/_examples/cffi/__pycache__/
Removing numpy/random/_generator.c
Removing numpy/random/_generator.cpython-311-darwin.so
Removing numpy/random/_mt19937.c
Removing numpy/random/_mt19937.cpython-311-darwin.so
Removing numpy/random/_pcg64.c
Removing numpy/random/_pcg64.cpython-311-darwin.so
Removing numpy/random/_philox.c
Removing numpy/random/_philox.cpython-311-darwin.so
Removing numpy/random/_sfc64.c
Removing numpy/random/_sfc64.cpython-311-darwin.so
Removing numpy/random/bit_generator.c
Removing numpy/random/bit_generator.cpython-311-darwin.so
Removing numpy/random/lib/
Removing numpy/random/mtrand.c
Removing numpy/random/mtrand.cpython-311-darwin.so
Removing numpy/random/tests/__pycache__/
Removing numpy/random/tests/data/__pycache__/
Removing numpy/testing/__pycache__/
Removing numpy/testing/_private/__pycache__/
Removing numpy/testing/tests/__pycache__/
Removing numpy/tests/__pycache__/
Removing numpy/typing/__pycache__/
Removing numpy/typing/tests/__pycache__/
Removing numpy/version.py
Removing tools/npy_tempita/__pycache__/
Removing var/

@mattip
Copy link
Member

mattip commented Aug 20, 2023

@stefanv is there a way to pass a list of files to extend spin clean?

@seiko2plus
Copy link
Member

@code-of-kpp Thank you for your assistance in investigating this bug. I've updated the reproducer code within the pull request description and have also opened a pull request that fixes this issue (#24468).

@mattip, It seems the easiest fix is to ensures that distutils generates these headers in the build directory, even with the inplace option enabled

@rgommers
Copy link
Member

@stefanv is there a way to pass a list of files to extend spin clean?

We don't have such a command, and I don't think we should add it. It's going to be inherently unreliable just like setup.py clean was not reliable. It's simply not possible to know what to delete I think, unless it's a simple alias for git clean -xdf. So better to continue to recommend to use git clean -xdf directly.

@code-of-kpp
Copy link
Author

Thank you all!

A couple of notes (and feel free to let me know, if they deserve an issue on their own):

  • build_ext succeeded, but tests were failing in a strange way, that's when @seberg suggested to switch to spin
  • git clean isn't normally an option for me, as I prefer to keep related virtual environments and IDE configuration in the same folder, if that wouldn't be the first time I cloned the repo to this laptop, I would lose a bunch of things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug Meson Items related to the introduction of Meson as the new build system for NumPy
Projects
None yet
4 participants