scipy: BLD: special: error for macOS 10.6 (seems to be MacPorts-specific)

Describe your issue.

There are quite a number of errors due to isnan and isinf not being consistently used with std::, but other than that, there is this failure:

In file included from ../scipy/special/special/specfun.h:4,
                 from ../scipy/special/special.h:6,
                 from ../scipy/special/_special_ufuncs.cpp:7:
../scipy/special/special/specfun/specfun.h: In instantiation of 'std::complex<_Tp> special::specfun::e1z(std::complex<_Tp>) [with T = float]':
../scipy/special/special/expint.h:17:40:   required from 'std::complex<_Tp> special::exp1(std::complex<_Tp>) [with T = float]'
   17 |     std::complex<T> outz = specfun::e1z(z);
      |                            ~~~~~~~~~~~~^~~
../scipy/special/_special_ufuncs.cpp:304:47:   required from here
  304 |          static_cast<func_F_F_t>(special::exp1), static_cast<func_D_D_t>(special::exp1)},
      |                                               ^
../scipy/special/special/specfun/specfun.h:2099:70: error: no match for 'operator*' (operand types are 'double' and 'std::complex<float>')
 2099 |             ce1 = -el - std::log(-z) + z*ce1 - copysign(pi, z.imag())*std::complex<T>(0.0, 1.0);
      |                                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc14/c++/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)'
  400 |     operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/opt/local/include/gcc14/c++/complex:400:5: note:   template argument deduction/substitution failed:
../scipy/special/special/specfun/specfun.h:2099:70: note:   mismatched types 'const std::complex<_Tp>' and 'double'
 2099 |             ce1 = -el - std::log(-z) + z*ce1 - copysign(pi, z.imag())*std::complex<T>(0.0, 1.0);
      |                                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc14/c++/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)'
  409 |     operator*(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/opt/local/include/gcc14/c++/complex:409:5: note:   template argument deduction/substitution failed:
../scipy/special/special/specfun/specfun.h:2099:70: note:   mismatched types 'const std::complex<_Tp>' and 'double'
 2099 |             ce1 = -el - std::log(-z) + z*ce1 - copysign(pi, z.imag())*std::complex<T>(0.0, 1.0);
      |                                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc14/c++/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)'
  418 |     operator*(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/opt/local/include/gcc14/c++/complex:418:5: note:   template argument deduction/substitution failed:
../scipy/special/special/specfun/specfun.h:2099:70: note:   deduced conflicting types for parameter '_Tp' ('double' and 'float')
 2099 |             ce1 = -el - std::log(-z) + z*ce1 - copysign(pi, z.imag())*std::complex<T>(0.0, 1.0);
      |                                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

Reproducing Code Example

--->  Building py311-scipy
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1" && /opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -m build --no-isolation --wheel --outdir /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work -Csetup-args=-Dblas=openblas -Csetup-args=-Dlapack=openblas -Csetup-args=-Dpkg_config_path=/opt/local/lib/pkgconfig 
* Getting build dependencies for wheel...
* Building wheel...
+ meson-3.11 setup /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/.mesonpy-otbgw66x -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dblas=openblas -Dlapack=openblas -Dpkg_config_path=/opt/local/lib/pkgconfig --native-file=/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/.mesonpy-otbgw66x/meson-python-native-file.ini
The Meson build system
Version: 1.6.0
Source dir: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1
Build dir: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/.mesonpy-otbgw66x
Build type: native build
Project name: scipy
Project version: 1.14.1
C compiler for the host machine: /opt/local/bin/gcc-mp-14 (gcc 14.2.0 "gcc-mp-14 (MacPorts gcc14 14.2.0_1+stdlib_flag) 14.2.0")
C linker for the host machine: /opt/local/bin/gcc-mp-14 ld64 97.17
C++ compiler for the host machine: /opt/local/bin/g++-mp-14 (gcc 14.2.0 "g++-mp-14 (MacPorts gcc14 14.2.0_1+stdlib_flag) 14.2.0")
C++ linker for the host machine: /opt/local/bin/g++-mp-14 ld64 97.17
Cython compiler for the host machine: cython (cython 3.0.11)
Host machine cpu family: ppc
Host machine cpu: power macintosh
Program python found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11)
Found pkg-config: YES (/opt/local/bin/pkg-config) 0.29.2
Run-time dependency python found: YES 3.11
Program cython found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/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: /opt/local/bin/gfortran-mp-14 (gcc 14.2.0 "GNU Fortran (MacPorts gcc14 14.2.0_1+stdlib_flag) 14.2.0")
Fortran linker for the host machine: /opt/local/bin/gfortran-mp-14 ld64 97.17
Compiler for Fortran supports arguments -Wno-conversion: YES 
Compiler for C supports link arguments -Wl,-ld_classic: NO 
Compiler for C supports link arguments -Wl,-dead_strip: NO 
Checking if "-Wl,--version-script" : links: NO 
Program tools/generate_f2pymod.py found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/tools/generate_f2pymod.py)
Program scipy/_build_utils/tempita.py found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/scipy/_build_utils/tempita.py)
Program pythran found: YES 0.17.0 0.17.0 (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/pythran)
Found CMake: /opt/local/bin/cmake (3.29.5)
WARNING: CMake Toolchain: Failed to determine CMake compilers state
Run-time dependency xsimd found: NO (tried pkgconfig, framework and cmake)
Run-time dependency threads found: YES
Library npymath found: YES
Run-time dependency pybind11 found: YES 2.13.6
Program f2py found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/f2py)
Run-time dependency scipy-openblas found: NO (tried pkgconfig)
Run-time dependency openblas found: YES 0.3.28
Dependency openblas found: YES 0.3.28 (cached)
Program ../tools/version_utils.py found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/scipy/../tools/version_utils.py)
Compiler for C supports arguments -Wno-maybe-uninitialized: YES 
Compiler for C supports arguments -Wno-discarded-qualifiers: YES 
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-bitwise-instead-of-logical: NO 
Compiler for C++ supports arguments -Wno-cpp: YES 
Compiler for C++ supports arguments -Wno-class-memaccess: YES 
Compiler for C++ supports arguments -Wno-deprecated-declarations: YES 
Compiler for C++ supports arguments -Wno-deprecated-builtins: NO 
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: YES 
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: NO 
Library atomic found: YES
Checking if "Check atomic builtins with -latomic" with dependency -latomic: links: YES 
Configuring __config__.py using configuration
Checking for function "open_memstream" : NO 
Configuring messagestream_config.h using configuration
Program _generate_pyx.py found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/scipy/special/_generate_pyx.py)
Program _generate_pyx.py found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/scipy/linalg/_generate_pyx.py)
Program ../_build_utils/echo.py found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/scipy/linalg/../_build_utils/echo.py)
Compiler for Fortran supports arguments -w: YES 
Program ../_generate_sparsetools.py found: YES (/opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/scipy/sparse/sparsetools/../_generate_sparsetools.py)
Checking for size of "void*" : 4 
Compiler for Fortran supports arguments -w: YES (cached)
Build targets in project: 197

scipy 1.14.1

  User defined options
    Native files   : /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-scipy/py311-scipy/work/scipy-1.14.1/.mesonpy-otbgw66x/meson-python-native-file.ini
    b_ndebug       : if-release
    b_vscrt        : md
    blas           : openblas
    buildtype      : release
    lapack         : openblas
    pkg_config_path: /opt/local/lib/pkgconfig

Found ninja-1.12.1 at /opt/local/bin/ninja
+ /opt/local/bin/ninja

Error message

FAILED: scipy/special/_special_ufuncs.cpython-311-darwin.so.p/_special_ufuncs.cpp.o 
/opt/local/bin/g++-mp-14 -Iscipy/special/_special_ufuncs.cpython-311-darwin.so.p -Iscipy/special -I../scipy/special -Iscipy/_lib -I../scipy/_lib -I../scipy/_build_utils/src -I../../../../../../../../Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/core/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -D_GLIBCXX_USE_CXX11_ABI=0 -isysroot/ -DSP_SPECFUN_ERROR -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION -MD -MQ scipy/special/_special_ufuncs.cpython-311-darwin.so.p/_special_ufuncs.cpp.o -MF scipy/special/_special_ufuncs.cpython-311-darwin.so.p/_special_ufuncs.cpp.o.d -o scipy/special/_special_ufuncs.cpython-311-darwin.so.p/_special_ufuncs.cpp.o -c ../scipy/special/_special_ufuncs.cpp
In file included from ../scipy/special/_special_ufuncs.cpp:10:
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_bessel_je(double, std::complex<double>)':
../scipy/special/special/bessel.h:603:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  603 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
In file included from /opt/local/include/LegacySupport/cmath:54,
                 from /opt/local/include/gcc14/c++/complex:44,
                 from ../scipy/special/special/error.h:27,
                 from ../scipy/special/sf_error_state.h:4,
                 from ../scipy/special/sf_error.h:3,
                 from ../scipy/special/ufunc.h:17,
                 from ../scipy/special/_special_ufuncs.cpp:1:
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_bessel_ye(double, std::complex<double>)':
../scipy/special/special/bessel.h:648:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  648 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_bessel_ie(double, std::complex<double>)':
../scipy/special/special/bessel.h:701:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  701 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_bessel_ke(double, std::complex<double>)':
../scipy/special/special/bessel.h:745:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  745 |     if (isnan(v) || isnan(std::real(z)) || isnan(std::imag(z))) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_hankel_1e(double, std::complex<double>)':
../scipy/special/special/bessel.h:798:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  798 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_hankel_2e(double, std::complex<double>)':
../scipy/special/special/bessel.h:826:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  826 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_bessel_j(double, std::complex<double>)':
../scipy/special/special/bessel.h:859:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  859 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_bessel_y(double, std::complex<double>)':
../scipy/special/special/bessel.h:917:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  917 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_bessel_i(double, std::complex<double>)':
../scipy/special/special/bessel.h:988:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
  988 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_bessel_k(double, std::complex<double>)':
../scipy/special/special/bessel.h:1029:54: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
 1029 |     if (std::isnan(v) || std::isnan(std::real(z)) || isnan(std::imag(z))) {
      |                                                      ^~~~~
      |                                                      std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_hankel_1(double, std::complex<double>)':
../scipy/special/special/bessel.h:1089:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
 1089 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/bessel.h: In function 'std::complex<double> special::cyl_hankel_2(double, std::complex<double>)':
../scipy/special/special/bessel.h:1119:9: error: 'isnan' was not declared in this scope; did you mean 'std::isnan'?
 1119 |     if (isnan(v) || isnan(z.real()) || isnan(z.imag())) {
      |         ^~~~~
      |         std::isnan
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'std::isnan' declared here
 1196 |     isnan(_Tp)
      |     ^~~~~
In file included from ../scipy/special/_special_ufuncs.cpp:25:
../scipy/special/special/sph_bessel.h: In instantiation of 'T special::sph_bessel_y(long int, T) [with T = double]':
../scipy/special/special/sph_bessel.h:191:65:   required from here
  191 | inline float sph_bessel_y(long n, float x) { return sph_bessel_y(n, static_cast<double>(x)); }
      |                                                     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
../scipy/special/special/sph_bessel.h:147:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  147 |     if (isnan(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h:182:18: error: 'isinf' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  182 |         if (isinf(sn)) {
      |             ~~~~~^~~~
/opt/local/include/gcc14/c++/cmath:1169:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isinf(_Tp)' declared here, later in the translation unit
 1169 |     isinf(_Tp)
      |     ^~~~~
In file included from ../scipy/special/_special_ufuncs.cpp:23:
../scipy/special/special/par_cyl.h: In instantiation of 'void special::pbdv(T, T, T&, T&) [with T = float]':
../scipy/special/_special_ufuncs.cpp:628:49:   required from here
  628 |         {static_cast<func_ff_ff_t>(special::pbdv), static_cast<func_dd_dd_t>(special::pbdv)}, 2, "pbdv", pbdv_doc
      |                                                 ^
../scipy/special/special/par_cyl.h:623:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  623 |     if (isnan(v) || isnan(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/par_cyl.h:623:26: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  623 |     if (isnan(v) || isnan(x)) {
      |                     ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/par_cyl.h: In instantiation of 'void special::pbdv(T, T, T&, T&) [with T = double]':
../scipy/special/_special_ufuncs.cpp:628:91:   required from here
  628 |         {static_cast<func_ff_ff_t>(special::pbdv), static_cast<func_dd_dd_t>(special::pbdv)}, 2, "pbdv", pbdv_doc
      |                                                                                           ^
../scipy/special/special/par_cyl.h:623:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  623 |     if (isnan(v) || isnan(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/par_cyl.h:623:26: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  623 |     if (isnan(v) || isnan(x)) {
      |                     ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/par_cyl.h: In instantiation of 'void special::pbvv(T, T, T&, T&) [with T = float]':
../scipy/special/_special_ufuncs.cpp:633:49:   required from here
  633 |         {static_cast<func_ff_ff_t>(special::pbvv), static_cast<func_dd_dd_t>(special::pbvv)}, 2, "pbvv", pbvv_doc
      |                                                 ^
../scipy/special/special/par_cyl.h:648:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  648 |     if (isnan(v) || isnan(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/par_cyl.h:648:26: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  648 |     if (isnan(v) || isnan(x)) {
      |                     ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/par_cyl.h: In instantiation of 'void special::pbvv(T, T, T&, T&) [with T = double]':
../scipy/special/_special_ufuncs.cpp:633:91:   required from here
  633 |         {static_cast<func_ff_ff_t>(special::pbvv), static_cast<func_dd_dd_t>(special::pbvv)}, 2, "pbvv", pbvv_doc
      |                                                                                           ^
../scipy/special/special/par_cyl.h:648:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  648 |     if (isnan(v) || isnan(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/par_cyl.h:648:26: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  648 |     if (isnan(v) || isnan(x)) {
      |                     ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h: In instantiation of 'T special::sph_bessel_i(long int, T) [with T = double]':
../scipy/special/_special_ufuncs.cpp:732:56:   required from here
  732 |         {static_cast<func_ld_d_t>(special::sph_bessel_i), static_cast<func_lD_D_t>(special::sph_bessel_i),
      |                                                        ^
../scipy/special/special/sph_bessel.h:232:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  232 |     if (isnan(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h:249:14: error: 'isinf' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  249 |     if (isinf(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1169:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isinf(_Tp)' declared here, later in the translation unit
 1169 |     isinf(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h: In instantiation of 'T special::sph_bessel_i(long int, T) [with T = float]':
../scipy/special/_special_ufuncs.cpp:733:56:   required from here
  733 |          static_cast<func_lf_f_t>(special::sph_bessel_i), static_cast<func_lF_F_t>(special::sph_bessel_i)},
      |                                                        ^
../scipy/special/special/sph_bessel.h:232:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  232 |     if (isnan(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h:249:14: error: 'isinf' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  249 |     if (isinf(x)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1169:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isinf(_Tp)' declared here, later in the translation unit
 1169 |     isinf(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h: In instantiation of 'T special::sph_bessel_k(long int, T) [with T = double]':
../scipy/special/_special_ufuncs.cpp:746:56:   required from here
  746 |         {static_cast<func_ld_d_t>(special::sph_bessel_k), static_cast<func_lD_D_t>(special::sph_bessel_k),
      |                                                        ^
../scipy/special/special/sph_bessel.h:317:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  317 |     if (isnan(z)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h:330:14: error: 'isinf' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  330 |     if (isinf(z)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1169:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isinf(_Tp)' declared here, later in the translation unit
 1169 |     isinf(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h: In instantiation of 'T special::sph_bessel_k(long int, T) [with T = float]':
../scipy/special/_special_ufuncs.cpp:747:56:   required from here
  747 |          static_cast<func_lf_f_t>(special::sph_bessel_k), static_cast<func_lF_F_t>(special::sph_bessel_k)},
      |                                                        ^
../scipy/special/special/sph_bessel.h:317:14: error: 'isnan' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  317 |     if (isnan(z)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1196:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isnan(_Tp)' declared here, later in the translation unit
 1196 |     isnan(_Tp)
      |     ^~~~~
../scipy/special/special/sph_bessel.h:330:14: error: 'isinf' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
  330 |     if (isinf(z)) {
      |         ~~~~~^~~
/opt/local/include/gcc14/c++/cmath:1169:5: note: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, bool>::__type std::isinf(_Tp)' declared here, later in the translation unit
 1169 |     isinf(_Tp)
      |     ^~~~~
In file included from ../scipy/special/special/specfun.h:4,
                 from ../scipy/special/special.h:6,
                 from ../scipy/special/_special_ufuncs.cpp:7:
../scipy/special/special/specfun/specfun.h: In instantiation of 'std::complex<_Tp> special::specfun::e1z(std::complex<_Tp>) [with T = float]':
../scipy/special/special/expint.h:17:40:   required from 'std::complex<_Tp> special::exp1(std::complex<_Tp>) [with T = float]'
   17 |     std::complex<T> outz = specfun::e1z(z);
      |                            ~~~~~~~~~~~~^~~
../scipy/special/_special_ufuncs.cpp:304:47:   required from here
  304 |          static_cast<func_F_F_t>(special::exp1), static_cast<func_D_D_t>(special::exp1)},
      |                                               ^
../scipy/special/special/specfun/specfun.h:2099:70: error: no match for 'operator*' (operand types are 'double' and 'std::complex<float>')
 2099 |             ce1 = -el - std::log(-z) + z*ce1 - copysign(pi, z.imag())*std::complex<T>(0.0, 1.0);
      |                                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc14/c++/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)'
  400 |     operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/opt/local/include/gcc14/c++/complex:400:5: note:   template argument deduction/substitution failed:
../scipy/special/special/specfun/specfun.h:2099:70: note:   mismatched types 'const std::complex<_Tp>' and 'double'
 2099 |             ce1 = -el - std::log(-z) + z*ce1 - copysign(pi, z.imag())*std::complex<T>(0.0, 1.0);
      |                                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc14/c++/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)'
  409 |     operator*(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/opt/local/include/gcc14/c++/complex:409:5: note:   template argument deduction/substitution failed:
../scipy/special/special/specfun/specfun.h:2099:70: note:   mismatched types 'const std::complex<_Tp>' and 'double'
 2099 |             ce1 = -el - std::log(-z) + z*ce1 - copysign(pi, z.imag())*std::complex<T>(0.0, 1.0);
      |                                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc14/c++/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)'
  418 |     operator*(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/opt/local/include/gcc14/c++/complex:418:5: note:   template argument deduction/substitution failed:
../scipy/special/special/specfun/specfun.h:2099:70: note:   deduced conflicting types for parameter '_Tp' ('double' and 'float')
 2099 |             ce1 = -el - std::log(-z) + z*ce1 - copysign(pi, z.imag())*std::complex<T>(0.0, 1.0);
      |                                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

SciPy/NumPy/Python version and system information

macOS 10.6
gcc 14.2.0 with libstdc++
python 3.11.10
numpy 1.26.4
scipy 1.14.1

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 23 (23 by maintainers)

Most upvoted comments

Ok, for the record I also tried gcc master branch on Ubuntu Linux with v1.14.1:

C++ compiler for the host machine: ccache c++ (gcc 15.0.0 “c++ (Spack GCC) 15.0.0 20241109 (experimental)”)

and still no problems. As you say, I’ll move on for now. If you find us a tractable reproducer and the fixes aren’t too invasive we do typically accept patches for more exotic situations if they don’t interfere with the usual ones as noted above.

Wow, I haven’t seen anyone on such an old macOS for years. Conda-forge has been on 10.9 since 7 years, until we recently moved to 10.13 as a baseline.

I mention this because it comes with a lot of nontrivial complexity (e.g. downloading old SDKs in CI and ensuring the compilers point there), so supporting anything below what we regularly test in conda-forge is probably going to be a tall order…

More to the point, if you’re also using the C++ stdlib from the 10.6 SDK, I think this may run afoul our our C++17 requirement (perhaps not explicitly, but there could be bugs in such old SDKs).

I don’t think we have an explicit policy for the deployment target currently, but we could write something up. Anything below what conda-forge does (which already extends support way beyond what many projects do, e.g. 10.13 is already EOL for 3 years) will probably have to be on a “untested, but we will consider patches that are useful” basis

After considerable diversions related to GNU toolchain + MacOS in the cross-listed issues above, I was able to successfully build SciPy 1.14.1 (and latest main) with gcc 14.2.0 toolchain.

I’m using a much newer MacOS than you though (14.7 vs. 10.6).