10000 BUG: Cannot build main on MacOS M1 · Issue #24450 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
BUG: Cannot build main on MacOS M1 #24450
Closed
@code-of-kpp

Description

@code-of-kpp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    00 - BugMesonItems related to the introduction of Meson as the new build system for NumPy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0