Skip to content

BUG: Build failure with Knights Landing CPUs #29560

@mgorny

Description

@mgorny

Describe the issue:

When building NumPy with baseline set to AVX512CD, it fails to build with the following error:

[131/405] Compiling C++ object numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o
FAILED: [code=1] numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o 
ccache c++ -Inumpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p -Inumpy/_core -I../numpy/_core -Inumpy/_core/include -I../numpy/_core/include -I../numpy/_core/src/common -I../numpy/_core/src/multiarray -I../numpy/_core/src/npymath -I../numpy/_core/src/umath -I../numpy/_core/src/highway -I/usr/include/python3.14 -I/home/mgorny/git/numpy/.mesonpy-6_bf1g_c/meson_cpu -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -maes -mpclmul -mbmi -mbmi2 -mno-mmx -mavx512f -mavx512cd -DNPY_HAVE_AVX512F -DNPY_HAVE_AVX512F_REDUCE -DNPY_HAVE_AVX512CD -fPIC -DNPY_INTERNAL_BUILD -DHAVE_NPY_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -fno-exceptions -fno-rtti -O3 -DNPY_HAVE_SSE2 -DNPY_HAVE_SSE -DNPY_HAVE_SSE3 -DNPY_HAVE_SSSE3 -DNPY_HAVE_SSE41 -DNPY_HAVE_POPCNT -DNPY_HAVE_SSE42 -DNPY_HAVE_AVX -DNPY_HAVE_F16C -DNPY_HAVE_FMA3 -DNPY_HAVE_AVX2 -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -maes -mpclmul -mbmi -mbmi2 -DNPY_MTARGETS_CURRENT=AVX2 -MD -MQ numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o -MF numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o.d -o numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o -c ../numpy/_core/src/npysort/x86_simd_argsort.dispatch.cpp
In file included from ../numpy/_core/src/npysort/x86_simd_argsort.dispatch.cpp:4:
../numpy/_core/src/npysort/x86-simd-sort/src/x86simdsort-static-incl.h:177:2: error: #error "x86simdsort requires AVX512DQ and AVX512VL to be enabled in addition to AVX512F to use AVX512"
  177 | #error "x86simdsort requires AVX512DQ and AVX512VL to be enabled in addition to AVX512F to use AVX512"
      |  ^~~~~

Reproduce the code example:

python -m build -w -Csetup-args=-Dcpu-baseline=AVX512CD

Error message:

* Creating isolated environment: virtualenv+pip...
* Installing packages in isolated environment:
  - Cython>=3.0.6
  - meson-python>=0.18.0
* Getting build dependencies for wheel...
* Building wheel...
+ /tmp/build-env-rj16suiq/bin/python /home/mgorny/git/numpy/vendored-meson/meson/meson.py setup /home/mgorny/git/numpy /home/mgorny/git/numpy/.mesonpy-6kqa_foz -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dcpu-baseline=AVX512CD --native-file=/home/mgorny/git/numpy/.mesonpy-6kqa_foz/meson-python-native-file.ini
The Meson build system
Version: 1.8.3
Source dir: /home/mgorny/git/numpy
Build dir: /home/mgorny/git/numpy/.mesonpy-6kqa_foz
Build type: native build
Project name: NumPy
Project version: 2.4.0.dev0+git20250814.87e208c
C compiler for the host machine: ccache cc (gcc 15.2.0 "cc (Gentoo 15.2.0 p5) 15.2.0")
C linker for the host machine: cc ld.bfd 2.45
C++ compiler for the host machine: ccache c++ (gcc 15.2.0 "c++ (Gentoo 15.2.0 p5) 15.2.0")
C++ linker for the host machine: c++ ld.bfd 2.45
Cython compiler for the host machine: cython (cython 3.1.3)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python found: YES (/tmp/build-env-rj16suiq/bin/python)
Found pkg-config: YES (/usr/bin/pkg-config) 2.5.1
Run-time dependency python found: YES 3.14
Has header "Python.h" with dependency python-3.14: YES 
Compiler for C supports arguments -fno-strict-aliasing: YES 
Test features "SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD" : Supported 
Test features "AVX512_KNL" : Unsupported due to Arguments "-msse, -msse2, -msse3, -mssse3, -msse4.1, -mpopcnt, -msse4.2, -mavx, -mf16c, -mfma, -mavx2, -maes, -mpclmul, -mbmi, -mbmi2, -mno-mmx, -mavx512f, -mavx512cd, -mavx512er, -mavx512pf" are not supported
Test features "AVX512_KNM" : Unsupported due to Implied feature "AVX512_KNL" is not supported
Test features "AVX512_SKX" : Supported 
Test features "AVX512_CLX" : Supported 
Test features "AVX512_CNL" : Supported 
Test features "AVX512_ICL" : Supported 
Test features "AVX512_SPR" : Supported 
Configuring npy_cpu_dispatch_config.h using configuration
Message: 
CPU Optimization Options
  baseline:
    Requested : AVX512CD
    Enabled   : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD
  dispatch:
    Requested : max -xop -fma4
    Enabled   : AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL AVX512_SPR

Library m found: YES
Run-time dependency scipy-openblas found: NO (tried pkgconfig)
Run-time dependency mkl found: NO (tried pkgconfig and system)
Run-time dependency mkl found: NO (tried pkgconfig and system)
Found CMake: /usr/bin/cmake (4.1.0)
Run-time dependency openblas found: NO (tried pkgconfig, pkgconfig, pkgconfig, system and cmake)
Run-time dependency flexiblas found: NO (tried pkgconfig and cmake)
Run-time dependency blis found: NO (tried pkgconfig and cmake)
Run-time dependency blas found: YES 3.12.0
Message: BLAS symbol suffix: 
Run-time dependency mkl found: NO (tried pkgconfig and system)
Run-time dependency openblas found: NO (tried pkgconfig, pkgconfig, pkgconfig, system and cmake)
Run-time dependency flexiblas found: NO (tried pkgconfig and cmake)
Run-time dependency lapack found: YES 3.12.0
Checking if "Check atomic builtins without -latomic" links: YES 
Program _build_utils/process_src_template.py found: YES (/tmp/build-env-rj16suiq/bin/python /home/mgorny/git/numpy/numpy/_build_utils/process_src_template.py)
Program _build_utils/tempita.py found: YES (/tmp/build-env-rj16suiq/bin/python /home/mgorny/git/numpy/numpy/_build_utils/tempita.py)
Configuring __config__.py using configuration
Checking for size of "short" : 2 
Checking for size of "int" : 4 
Checking for size of "long" : 8 
Checking for size of "long long" : 8 
Checking for size of "float" : 4 
Checking for size of "double" : 8 
Checking for size of "long double" : 16 
Checking for size of "size_t" : 8 
Checking for size of "size_t" : 8 (cached)
Checking for size of "wchar_t" : 4 
Checking for size of "off_t" : 8 
Checking for size of "Py_intptr_t" with dependency python-3.14: 8 
Checking for size of "PY_LONG_LONG" with dependency python-3.14: 8 
Has header "complex.h" : YES 
Checking for type "complex float" : YES 
Checking for size of "complex float" : 8 
Checking for type "complex double" : YES 
Checking for size of "complex double" : 16 
Checking for type "complex long double" : YES 
Checking for size of "complex long double" : 32 
Checking for function "sin" with dependency -lm: YES 
Checking for function "cos" with dependency -lm: YES 
Checking for function "tan" with dependency -lm: YES 
Checking for function "sinh" with dependency -lm: YES 
Checking for function "cosh" with dependency -lm: YES 
Checking for function "tanh" with dependency -lm: YES 
Checking for function "fabs" with dependency -lm: YES 
Checking for function "floor" with dependency -lm: YES 
Checking for function "ceil" with dependency -lm: YES 
Checking for function "sqrt" with dependency -lm: YES 
Checking for function "log10" with dependency -lm: YES 
Checking for function "log" with dependency -lm: YES 
Checking for function "exp" with dependency -lm: YES 
Checking for function "asin" with dependency -lm: YES 
Checking for function "acos" with dependency -lm: YES 
Checking for function "atan" with dependency -lm: YES 
Checking for function "fmod" with dependency -lm: YES 
Checking for function "modf" with dependency -lm: YES 
Checking for function "frexp" with dependency -lm: YES 
Checking for function "ldexp" with dependency -lm: YES 
Checking for function "expm1" with dependency -lm: YES 
Checking for function "log1p" with dependency -lm: YES 
Checking for function "acosh" with dependency -lm: YES 
Checking for function "asinh" with dependency -lm: YES 
Checking for function "atanh" with dependency -lm: YES 
Checking for function "rint" with dependency -lm: YES 
Checking for function "trunc" with dependency -lm: YES 
Checking for function "exp2" with dependency -lm: YES 
Checking for function "copysign" with dependency -lm: YES 
Checking for function "nextafter" with dependency -lm: YES 
Checking for function "cbrt" with dependency -lm: YES 
Checking for function "log2" with dependency -lm: YES 
Checking for function "pow" with dependency -lm: YES 
Checking for function "hypot" with dependency -lm: YES 
Checking for function "atan2" with dependency -lm: YES 
Checking for function "csin" with dependency -lm: YES 
Checking for function "csinh" with dependency -lm: YES 
Checking for function "ccos" with dependency -lm: YES 
Checking for function "ccosh" with dependency -lm: YES 
Checking for function "ctan" with dependency -lm: YES 
Checking for function "ctanh" with dependency -lm: YES 
Checking for function "creal" with dependency -lm: YES 
Checking for function "cimag" with dependency -lm: YES 
Checking for function "conj" with dependency -lm: YES 
Checking for function "strtoll" : YES 
Checking for function "strtoull" : YES 
Checking for function "cabs" with dependency -lm: YES 
Checking for function "cabsf" with dependency -lm: YES 
Checking for function "cabsl" with dependency -lm: YES 
Checking for function "cacos" with dependency -lm: YES 
Checking for function "cacosf" with dependency -lm: YES 
Checking for function "cacosl" with dependency -lm: YES 
Checking for function "cacosh" with dependency -lm: YES 
Checking for function "cacoshf" with dependency -lm: YES 
Checking for function "cacoshl" with dependency -lm: YES 
Checking for function "carg" with dependency -lm: YES 
Checking for function "cargf" with dependency -lm: YES 
Checking for function "cargl" with dependency -lm: YES 
Checking for function "casin" with dependency -lm: YES 
Checking for function "casinf" with dependency -lm: YES 
Checking for function "casinl" with dependency -lm: YES 
Checking for function "casinh" with dependency -lm: YES 
Checking for function "casinhf" with dependency -lm: YES 
Checking for function "casinhl" with dependency -lm: YES 
Checking for function "catan" with dependency -lm: YES 
Checking for function "catanf" with dependency -lm: YES 
Checking for function "catanl" with dependency -lm: YES 
Checking for function "catanh" with dependency -lm: YES 
Checking for function "catanhf" with dependency -lm: YES 
Checking for function "catanhl" with dependency -lm: YES 
Checking for function "cexp" with dependency -lm: YES 
Checking for function "cexpf" with dependency -lm: YES 
Checking for function "cexpl" with dependency -lm: YES 
Checking for function "clog" with dependency -lm: YES 
Checking for function "clogf" with dependency -lm: YES 
Checking for function "clogl" with dependency -lm: YES 
Checking for function "cpow" with dependency -lm: YES 
Checking for function "cpowf" with dependency -lm: YES 
Checking for function "cpowl" with dependency -lm: YES 
Checking for function "csqrt" with dependency -lm: YES 
Checking for function "csqrtf" with dependency -lm: YES 
Checking for function "csqrtl" with dependency -lm: YES 
Checking for function "csin" with dependency -lm: YES (cached)
Checking for function "csinf" with dependency -lm: YES 
Checking for function "csinl" with dependency -lm: YES 
Checking for function "csinh" with dependency -lm: YES (cached)
Checking for function "csinhf" with dependency -lm: YES 
Checking for function "csinhl" with dependency -lm: YES 
Checking for function "ccos" with dependency -lm: YES (cached)
Checking for function "ccosf" with dependency -lm: YES 
Checking for function "ccosl" with dependency -lm: YES 
Checking for function "ccosh" with dependency -lm: YES (cached)
Checking for function "ccoshf" with dependency -lm: YES 
Checking for function "ccoshl" with dependency -lm: YES 
Checking for function "ctan" with dependency -lm: YES (cached)
Checking for function "ctanf" with dependency -lm: YES 
Checking for function "ctanl" with dependency -lm: YES 
Checking for function "ctanh" with dependency -lm: YES (cached)
Checking for function "ctanhf" with dependency -lm: YES 
Checking for function "ctanhl" with dependency -lm: YES 
Checking for function "isfinite" with dependency -lm: YES 
Header "Python.h" has symbol "isfinite" with dependency python-3.14: YES 
Checking for function "isinf" with dependency -lm: YES 
Header "Python.h" has symbol "isinf" with dependency python-3.14: YES 
Checking for function "isnan" with dependency -lm: YES 
Header "Python.h" has symbol "isnan" with dependency python-3.14: YES 
Checking for function "signbit" with dependency -lm: YES 
Header "Python.h" has symbol "signbit" with dependency python-3.14: YES 
Checking if "thread_local" compiles: NO 
Checking if "_Thread_local" compiles: YES 
Checking if "__thread" compiles: YES 
Checking if "__declspec(thread)" compiles: NO 
Checking for function "fallocate" : YES 
Header "Python.h" has symbol "HAVE_FTELLO" with dependency python-3.14: YES 
Header "Python.h" has symbol "HAVE_FSEEKO" with dependency python-3.14: YES 
Checking for function "backtrace" : YES 
Checking for function "madvise" : YES 
Has header "features.h" : YES 
Has header "xlocale.h" : NO 
Has header "dlfcn.h" : YES 
Has header "execinfo.h" : YES 
Has header "libunwind.h" : YES 
Has header "sys/mman.h" : YES 
Checking for function "strtold_l" : YES 
Checking if "__attribute__((optimize("unroll-loops")))" compiles: YES 
Checking if "__attribute__((optimize("O3")))" compiles: YES 
Checking if "__attribute__((nonnull(1)))" compiles: YES 
Compiler for C supports arguments -O3: YES 
Message: Long double format: INTEL_EXTENDED_16_BYTES_LE
Has header "endian.h" : YES 
Has header "sys/endian.h" : NO 
Compiler for C supports function attribute visibility:hidden: YES 
Configuring config.h using configuration
Configuring _numpyconfig.h using configuration
Configuring npymath.ini using configuration
Configuring mlib.ini using configuration
Configuring numpy.pc using configuration
Generating multi-targets for "_umath_tests.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "argfunc.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "x86_simd_argsort.dispatch.h" 
  Enabled targets: AVX512_SKX, AVX2
Generating multi-targets for "x86_simd_qsort.dispatch.h" 
  Enabled targets: AVX512_SKX, AVX2
Generating multi-targets for "x86_simd_qsort_16bit.dispatch.h" 
  Enabled targets: AVX512_SPR, AVX512_ICL
Generating multi-targets for "highway_qsort.dispatch.h" 
  Enabled targets: 
Generating multi-targets for "highway_qsort_16bit.dispatch.h" 
  Enabled targets: 
Generating multi-targets for "loops_arithm_fp.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_arithmetic.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_comparison.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_exponent_log.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_hyperbolic.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_logical.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_minmax.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_modulo.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_trigonometric.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_umath_fp.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_unary.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Generating multi-targets for "loops_unary_fp.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_unary_fp_le.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_unary_complex.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_autovec.dispatch.h" 
  Enabled targets: baseline
Generating multi-targets for "loops_half.dispatch.h" 
  Enabled targets: AVX512_SPR, AVX512_SKX, baseline
WARNING: Project targets '>=1.8.3' but uses feature deprecated since '1.3.0': Source file src/umath/svml/linux/avx512/svml_z0_acos_d_la.s in the 'objects' kwarg is not an object..
Generating multi-targets for "_simd.dispatch.h" 
  Enabled targets: AVX512_SKX, baseline
Build targets in project: 82
WARNING: Deprecated features used:
 * 1.3.0: {'Source file src/umath/svml/linux/avx512/svml_z0_acos_d_la.s in the 'objects' kwarg is not an object.'}

NumPy 2.4.0.dev0+git20250814.87e208c

  User defined options
    Native files: /home/mgorny/git/numpy/.mesonpy-6kqa_foz/meson-python-native-file.ini
    b_ndebug    : if-release
    b_vscrt     : md
    buildtype   : release
    cpu-baseline: AVX512CD

Found ninja-1.13.1 at /usr/bin/ninja
+ /usr/bin/ninja
[129/405] Compiling C++ object numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o
FAILED: [code=1] numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o 
ccache c++ -Inumpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p -Inumpy/_core -I../numpy/_core -Inumpy/_core/include -I../numpy/_core/include -I../numpy/_core/src/common -I../numpy/_core/src/multiarray -I../numpy/_core/src/npymath -I../numpy/_core/src/umath -I../numpy/_core/src/highway -I/usr/include/python3.14 -I/home/mgorny/git/numpy/.mesonpy-6kqa_foz/meson_cpu -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -maes -mpclmul -mbmi -mbmi2 -mno-mmx -mavx512f -mavx512cd -DNPY_HAVE_AVX512F -DNPY_HAVE_AVX512F_REDUCE -DNPY_HAVE_AVX512CD -fPIC -DNPY_INTERNAL_BUILD -DHAVE_NPY_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -fno-exceptions -fno-rtti -O3 -DNPY_HAVE_SSE2 -DNPY_HAVE_SSE -DNPY_HAVE_SSE3 -DNPY_HAVE_SSSE3 -DNPY_HAVE_SSE41 -DNPY_HAVE_POPCNT -DNPY_HAVE_SSE42 -DNPY_HAVE_AVX -DNPY_HAVE_F16C -DNPY_HAVE_FMA3 -DNPY_HAVE_AVX2 -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -maes -mpclmul -mbmi -mbmi2 -DNPY_MTARGETS_CURRENT=AVX2 -MD -MQ numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o -MF numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o.d -o numpy/_core/libx86_simd_argsort.dispatch.h_AVX2.a.p/src_npysort_x86_simd_argsort.dispatch.cpp.o -c ../numpy/_core/src/npysort/x86_simd_argsort.dispatch.cpp
In file included from ../numpy/_core/src/npysort/x86_simd_argsort.dispatch.cpp:4:
../numpy/_core/src/npysort/x86-simd-sort/src/x86simdsort-static-incl.h:177:2: error: #error "x86simdsort requires AVX512DQ and AVX512VL to be enabled in addition to AVX512F to use AVX512"
  177 | #error "x86simdsort requires AVX512DQ and AVX512VL to be enabled in addition to AVX512F to use AVX512"
      |  ^~~~~
[…]

Python and NumPy Versions:

Confirmed with 87e208c.

Runtime Environment:

No response

Context for the issue:

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions