scipy: BLD: build failure with suspicious flag `-fopenmp`
Describe your issue.
I try to build scipy from source in order to run tests locally for PRs that I submit. But the build step fails - it worked before and I don’t know what changed.
The build option -fopenmp seems misplaced.
Reproducing Code Example
python dev.py build
Error message
ninja: Entering directory `.../scipy/build'
[1/1453] Compiling C object scipy/libdummy_g77_abi_wrappers.a.p/_build_utils_src_wrap_dummy_g77_abi.c.o
FAILED: scipy/libdummy_g77_abi_wrappers.a.p/_build_utils_src_wrap_dummy_g77_abi.c.o
cc -Iscipy/libdummy_g77_abi_wrappers.a.p -Iscipy -I../scipy -I../../python3_scipy/lib/python3.12/site-packages/numpy/_core/include -I/usr/local/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/include/python3.12 -I/usr/local/Cellar/openblas/0.3.29/include -fvisibility=hidden -fdiagnostics-color=always -Wall -Winvalid-pch -std=c17 -O0 -g -Wno-unused-but-set-variable -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION -fopenmp -MD -MQ scipy/libdummy_g77_abi_wrappers.a.p/_build_utils_src_wrap_dummy_g77_abi.c.o -MF scipy/libdummy_g77_abi_wrappers.a.p/_build_utils_src_wrap_dummy_g77_abi.c.o.d -o scipy/libdummy_g77_abi_wrappers.a.p/_build_utils_src_wrap_dummy_g77_abi.c.o -c ../scipy/_build_utils/src/wrap_dummy_g77_abi.c
clang: error: unsupported option '-fopenmp'
[4/1453] Generating 'scipy/_lib/_test_deprecation_call.cpython-312-darwin.so.p/_test_deprecation_call.c'
ninja: build stopped: subcommand failed.
Build failed!
SciPy/NumPy/Python version and system information
python 3.12.9
Python system: Darwin
The Meson build system
Version: 1.5.2
Source dir: XXX/scipy
Build dir: XXX/scipy/build
Build type: native build
Project name: scipy
Project version: 1.16.0.dev0+git20250401.af32ab3
C compiler for the host machine: cc (clang 17.0.0 "Apple clang version 17.0.0 (clang-1700.0.13.3)")
C linker for the host machine: cc ld64 1167.4.1
C++ compiler for the host machine: c++ (clang 17.0.0 "Apple clang version 17.0.0 (clang-1700.0.13.3)")
C++ linker for the host machine: c++ ld64 1167.4.1
Cython compiler for the host machine: cython (cython 3.0.11)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES
Found pkg-config: YES (/usr/local/bin/pkg-config) 2.3.0
Run-time dependency python found: YES 3.12
Program cython found: YES (XXX/python3_scipy/bin/cython)
Compiler for C supports arguments -Wno-unused-but-set-variable: YES
Compiler for C supports arguments -Wno-unused-function: YES
Compiler for C supports arguments -Wno-conversion: YES
Compiler for C supports arguments -Wno-misleading-indentation: YES
Library m found: YES
Fortran compiler for the host machine: gfortran (gcc 14.2.0 "GNU Fortran (Homebrew GCC 14.2.0_1) 14.2.0")
Fortran linker for the host machine: gfortran ld64 1167.4.1
meson.build:86: WARNING: Consider using the built-in option for language standard version instead of using "-std=legacy".
Compiler for Fortran supports arguments -Wno-conversion: YES
Compiler for C supports link arguments -Wl,-dead_strip: YES
Checking if "-Wl,--version-script" : links: NO
Program tools/generate_f2pymod.py found: YES
Program scipy/_build_utils/tempita.py found: YES
Program pythran found: YES 0.16.1 0.16.1
Run-time dependency xsimd found: YES 13.0.0
Run-time dependency threads found: YES
numpy-config found: YES 2.1.2
Run-time dependency numpy found: YES 2.1.2
Library npymath found: YES
pybind11-config found: YES 2.13.6
Run-time dependency pybind11 found: YES 2.13.6
Checking if "thread_local" compiles: NO
Checking if "_Thread_local" compiles: YES
Checking if "__thread" compiles: YES
Configuring scipy_config.h using configuration
Program f2py found: YES
Run-time dependency scipy-openblas found: NO (tried pkgconfig)
Run-time dependency openblas found: YES 0.3.29
Dependency openblas found: YES 0.3.29 (cached)
Compiler for C supports arguments -Wno-maybe-uninitialized: NO
Compiler for C supports arguments -Wno-discarded-qualifiers: NO
Compiler for C supports arguments -Wno-empty-body: YES
Compiler for C supports arguments -Wno-implicit-function-declaration: YES
Compiler for C supports arguments -Wno-parentheses: YES
Compiler for C supports arguments -Wno-switch: YES
Compiler for C supports arguments -Wno-unused-label: YES
Compiler for C supports arguments -Wno-unused-result: YES
Compiler for C supports arguments -Wno-unused-variable: YES
Compiler for C supports arguments -Wno-unused-but-set-variable: YES (cached)
Compiler for C++ supports arguments -Wno-bitwise-instead-of-logical: YES
Compiler for C++ supports arguments -Wno-cpp: YES
Compiler for C++ supports arguments -Wno-class-memaccess: NO
Compiler for C++ supports arguments -Wno-deprecated-declarations: YES
Compiler for C++ supports arguments -Wno-deprecated-builtins: YES
Compiler for C++ supports arguments -Wno-format-truncation: YES
Compiler for C++ supports arguments -Wno-non-virtual-dtor: YES
Compiler for C++ supports arguments -Wno-sign-compare: YES
Compiler for C++ supports arguments -Wno-switch: YES
Compiler for C++ supports arguments -Wno-terminate: NO
Compiler for C++ supports arguments -Wno-unused-but-set-variable: YES
Compiler for C++ supports arguments -Wno-unused-function: YES
Compiler for C++ supports arguments -Wno-unused-local-typedefs: YES
Compiler for C++ supports arguments -Wno-unused-variable: YES
Compiler for C++ supports arguments -Wno-int-in-bool-context: YES
Compiler for Fortran supports arguments -Wno-argument-mismatch: YES
Compiler for Fortran supports arguments -Wno-conversion: YES (cached)
Compiler for Fortran supports arguments -Wno-intrinsic-shadow: YES
Compiler for Fortran supports arguments -Wno-maybe-uninitialized: YES
Compiler for Fortran supports arguments -Wno-surprising: YES
Compiler for Fortran supports arguments -Wno-uninitialized: YES
Compiler for Fortran supports arguments -Wno-unused-dummy-argument: YES
Compiler for Fortran supports arguments -Wno-unused-label: YES
Compiler for Fortran supports arguments -Wno-unused-variable: YES
Compiler for Fortran supports arguments -Wno-tabs: YES
Compiler for Fortran supports arguments -Wno-argument-mismatch: YES (cached)
Compiler for Fortran supports arguments -Wno-conversion: YES (cached)
Compiler for Fortran supports arguments -Wno-maybe-uninitialized: YES (cached)
Compiler for Fortran supports arguments -Wno-unused-dummy-argument: YES (cached)
Compiler for Fortran supports arguments -Wno-unused-label: YES (cached)
Compiler for Fortran supports arguments -Wno-unused-variable: YES (cached)
Compiler for Fortran supports arguments -Wno-tabs: YES (cached)
Checking if "Check atomic builtins without -latomic" : links: YES
Configuring __config__.py using configuration
Checking for function "open_memstream" : YES
Configuring messagestream_config.h using configuration
scipy/_lib/meson.build:223:4: ERROR: File array_api_extra/src/array_api_extra/_lib/_utils/_typing.pyi does not exist.
Meson build setup failed!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (14 by maintainers)
Wow thanks for the super quick response! After
git cleaning my repo and rebuilding the venv, it worked (and got my laptop fans spinning)!Hmm, not sure what else it could be. Any chance you this in a fresh environment, and if it persists then share the reproducer including environment creation?