scipy: BUG: After updating to numpy 2.0.0, scipy fails to build with LTO errors.

Describe your issue.

Discovered in https://bugs.gentoo.org/932721

Originally discovered with scipy 1.13.0, reproduced with 1.14.0. This bug report was generated after I tried building from git to triple-check it hasn’t been fixed yet.

After updating to numpy 2.0.0, I tried to recompile scipy with the following *FLAGS to optimize the build: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing

Note the -Werror=* flags are used to help detect cases where the compiler tries to optimize by assuming UB cannot exist in the source code – if it does exist, ordinarily the code would be miscompiled, and this says to make the miscompilation a fatal error.

I got the error in this exhaustive build log: build.log

(and reproduced below)

Reproducing Code Example

pip install

# or

emerge -1 scipy

Error message

[3/4] g++-14  -o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/meson-generated__ufuncs.c.o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/_cosine.c.o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/special_wrappers.cpp.o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/sf_error.cc.o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/dd_real_wrappers.cpp.o -flto -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 '-Wl,-rpath,$ORIGIN/' -Wl,-rpath-link,/var/tmp/portage/dev-python/scipy-9999/work/scipy-9999-python3_12/scipy/special -Wl,--start-group scipy/special/libcdflib.a scipy/libdummy_g77_abi_wrappers.a scipy/special/libsf_error_state.so -Wl,--version-script=/var/tmp/portage/dev-python/scipy-9999/work/scipy-9999/scipy/_build_utils/link-version-pyinit.map /usr/lib64/liblapack.so /usr/lib/python3.12/site-packages/numpy/_core/include/../lib/libnpymath.a /usr/lib64/libblas.so -Wl,--end-group
FAILED: scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so 
g++-14  -o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/meson-generated__ufuncs.c.o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/_cosine.c.o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/special_wrappers.cpp.o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/sf_error.cc.o scipy/special/_ufuncs.cpython-312-x86_64-linux-gnu.so.p/dd_real_wrappers.cpp.o -flto -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 '-Wl,-rpath,$ORIGIN/' -Wl,-rpath-link,/var/tmp/portage/dev-python/scipy-9999/work/scipy-9999-python3_12/scipy/special -Wl,--start-group scipy/special/libcdflib.a scipy/libdummy_g77_abi_wrappers.a scipy/special/libsf_error_state.so -Wl,--version-script=/var/tmp/portage/dev-python/scipy-9999/work/scipy-9999/scipy/_build_utils/link-version-pyinit.map /usr/lib64/liblapack.so /usr/lib/python3.12/site-packages/numpy/_core/include/../lib/libnpymath.a /usr/lib64/libblas.so -Wl,--end-group
../scipy-9999/scipy/special/special_wrappers.h:111:13: error: type of ‘special_ccyl_bessel_i’ does not match original declaration [-Werror=lto-type-mismatch]
  111 | npy_cdouble special_ccyl_bessel_i(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:361:13: note: return value type mismatch
  361 | npy_cdouble special_ccyl_bessel_i(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:361:13: note: ‘special_ccyl_bessel_i’ was previously declared here
  361 | npy_cdouble special_ccyl_bessel_i(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:361:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:99:13: error: type of ‘special_ccyl_bessel_j’ does not match original declaration [-Werror=lto-type-mismatch]
   99 | npy_cdouble special_ccyl_bessel_j(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:337:13: note: return value type mismatch
  337 | npy_cdouble special_ccyl_bessel_j(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:337:13: note: ‘special_ccyl_bessel_j’ was previously declared here
  337 | npy_cdouble special_ccyl_bessel_j(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:337:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:178:13: error: type of ‘hyp2f1_complex_wrap’ does not match original declaration [-Werror=lto-type-mismatch]
  178 | npy_cdouble hyp2f1_complex_wrap(double a, double b, double c, npy_cdouble zp);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:184:13: note: return value type mismatch
  184 | npy_cdouble hyp2f1_complex_wrap(double a, double b, double c, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:184:13: note: ‘hyp2f1_complex_wrap’ was previously declared here
  184 | npy_cdouble hyp2f1_complex_wrap(double a, double b, double c, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:184:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:33:13: error: type of ‘special_cexpi’ does not match original declaration [-Werror=lto-type-mismatch]
   33 | npy_cdouble special_cexpi(npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:149:13: note: return value type mismatch
  149 | npy_cdouble special_cexpi(npy_cdouble z) { return to_ccomplex(special::expi(to_complex(z))); }
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:149:13: note: ‘special_cexpi’ was previously declared here
  149 | npy_cdouble special_cexpi(npy_cdouble z) { return to_ccomplex(special::expi(to_complex(z))); }
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:149:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
scipy/special/_ufuncs_defs.h:61:13: error: type of ‘chyp1f1_wrap’ does not match original declaration [-Werror=lto-type-mismatch]
   61 | npy_cdouble chyp1f1_wrap(npy_double, npy_double, npy_cdouble);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:131:13: note: return value type mismatch
  131 | npy_cdouble chyp1f1_wrap(double a, double b, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:131:13: note: ‘chyp1f1_wrap’ was previously declared here
  131 | npy_cdouble chyp1f1_wrap(double a, double b, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:131:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
scipy/special/_ufuncs_defs.h:53:9: error: type of ‘cfresnl_wrap’ does not match original declaration [-Werror=lto-type-mismatch]
   53 | npy_int cfresnl_wrap(npy_cdouble, npy_cdouble *, npy_cdouble *);
      |         ^
../scipy-9999/scipy/special/special_wrappers.cpp:196:5: note: type mismatch in parameter 1
  196 | int cfresnl_wrap(npy_cdouble z, npy_cdouble *zfs, npy_cdouble *zfc) {
      |     ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘complex double’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:196:5: note: ‘cfresnl_wrap’ was previously declared here
  196 | int cfresnl_wrap(npy_cdouble z, npy_cdouble *zfs, npy_cdouble *zfc) {
      |     ^
../scipy-9999/scipy/special/special_wrappers.cpp:196:5: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto1: some warnings being treated as errors
lto-wrapper: fatal error: g++-14 returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
[4/4] g++-14  -o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/meson-generated_cython_special.c.o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/_cosine.c.o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/special_wrappers.cpp.o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/sf_error.cc.o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/dd_real_wrappers.cpp.o -flto -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 '-Wl,-rpath,$ORIGIN/' -Wl,-rpath-link,/var/tmp/portage/dev-python/scipy-9999/work/scipy-9999-python3_12/scipy/special -Wl,--start-group scipy/special/libcdflib.a scipy/special/libsf_error_state.so -Wl,--version-script=/var/tmp/portage/dev-python/scipy-9999/work/scipy-9999/scipy/_build_utils/link-version-pyinit.map /usr/lib/python3.12/site-packages/numpy/_core/include/../lib/libnpymath.a -Wl,--end-group
FAILED: scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so 
g++-14  -o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/meson-generated_cython_special.c.o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/_cosine.c.o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/special_wrappers.cpp.o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/sf_error.cc.o scipy/special/cython_special.cpython-312-x86_64-linux-gnu.so.p/dd_real_wrappers.cpp.o -flto -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 '-Wl,-rpath,$ORIGIN/' -Wl,-rpath-link,/var/tmp/portage/dev-python/scipy-9999/work/scipy-9999-python3_12/scipy/special -Wl,--start-group scipy/special/libcdflib.a scipy/special/libsf_error_state.so -Wl,--version-script=/var/tmp/portage/dev-python/scipy-9999/work/scipy-9999/scipy/_build_utils/link-version-pyinit.map /usr/lib/python3.12/site-packages/numpy/_core/include/../lib/libnpymath.a -Wl,--end-group
../scipy-9999/scipy/special/special_wrappers.h:178:13: error: type of ‘hyp2f1_complex_wrap’ does not match original declaration [-Werror=lto-type-mismatch]
  178 | npy_cdouble hyp2f1_complex_wrap(double a, double b, double c, npy_cdouble zp);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:184:13: note: return value type mismatch
  184 | npy_cdouble hyp2f1_complex_wrap(double a, double b, double c, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:184:13: note: ‘hyp2f1_complex_wrap’ was previously declared here
  184 | npy_cdouble hyp2f1_complex_wrap(double a, double b, double c, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:184:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:94:6: error: type of ‘special_cairye’ does not match original declaration [-Werror=lto-type-mismatch]
   94 | void special_cairye(npy_cdouble z, npy_cdouble *ai, npy_cdouble *aip, npy_cdouble *bi, npy_cdouble *bip);
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:328:6: note: type mismatch in parameter 1
  328 | void special_cairye(npy_cdouble z, npy_cdouble *ai, npy_cdouble *aip, npy_cdouble *bi, npy_cdouble *bip) {
      |      ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:328:6: note: ‘special_cairye’ was previously declared here
  328 | void special_cairye(npy_cdouble z, npy_cdouble *ai, npy_cdouble *aip, npy_cdouble *bi, npy_cdouble *bip) {
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:328:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:30:13: error: type of ‘special_cexp1’ does not match original declaration [-Werror=lto-type-mismatch]
   30 | npy_cdouble special_cexp1(npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:145:13: note: return value type mismatch
  145 | npy_cdouble special_cexp1(npy_cdouble z) { return to_ccomplex(special::exp1(to_complex(z))); }
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:145:13: note: ‘special_cexp1’ was previously declared here
  145 | npy_cdouble special_cexp1(npy_cdouble z) { return to_ccomplex(special::exp1(to_complex(z))); }
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:145:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:33:13: error: type of ‘special_cexpi’ does not match original declaration [-Werror=lto-type-mismatch]
   33 | npy_cdouble special_cexpi(npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:149:13: note: return value type mismatch
  149 | npy_cdouble special_cexpi(npy_cdouble z) { return to_ccomplex(special::expi(to_complex(z))); }
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:149:13: note: ‘special_cexpi’ was previously declared here
  149 | npy_cdouble special_cexpi(npy_cdouble z) { return to_ccomplex(special::expi(to_complex(z))); }
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:149:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
scipy/special/_ufuncs_defs.h:53:9: error: type of ‘cfresnl_wrap’ does not match original declaration [-Werror=lto-type-mismatch]
   53 | npy_int cfresnl_wrap(npy_cdouble, npy_cdouble *, npy_cdouble *);
      |         ^
../scipy-9999/scipy/special/special_wrappers.cpp:196:5: note: type mismatch in parameter 1
  196 | int cfresnl_wrap(npy_cdouble z, npy_cdouble *zfs, npy_cdouble *zfc) {
      |     ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘complex double’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:196:5: note: ‘cfresnl_wrap’ was previously declared here
  196 | int cfresnl_wrap(npy_cdouble z, npy_cdouble *zfs, npy_cdouble *zfc) {
      |     ^
../scipy-9999/scipy/special/special_wrappers.cpp:196:5: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:123:13: error: type of ‘special_ccyl_hankel_1’ does not match original declaration [-Werror=lto-type-mismatch]
  123 | npy_cdouble special_ccyl_hankel_1(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:385:13: note: return value type mismatch
  385 | npy_cdouble special_ccyl_hankel_1(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:385:13: note: ‘special_ccyl_hankel_1’ was previously declared here
  385 | npy_cdouble special_ccyl_hankel_1(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:385:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:125:13: error: type of ‘special_ccyl_hankel_1e’ does not match original declaration [-Werror=lto-type-mismatch]
  125 | npy_cdouble special_ccyl_hankel_1e(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:389:13: note: return value type mismatch
  389 | npy_cdouble special_ccyl_hankel_1e(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:389:13: note: ‘special_ccyl_hankel_1e’ was previously declared here
  389 | npy_cdouble special_ccyl_hankel_1e(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:389:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:124:13: error: type of ‘special_ccyl_hankel_2’ does not match original declaration [-Werror=lto-type-mismatch]
  124 | npy_cdouble special_ccyl_hankel_2(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:393:13: note: return value type mismatch
  393 | npy_cdouble special_ccyl_hankel_2(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:393:13: note: ‘special_ccyl_hankel_2’ was previously declared here
  393 | npy_cdouble special_ccyl_hankel_2(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:393:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:126:13: error: type of ‘special_ccyl_hankel_2e’ does not match original declaration [-Werror=lto-type-mismatch]
  126 | npy_cdouble special_ccyl_hankel_2e(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:397:13: note: return value type mismatch
  397 | npy_cdouble special_ccyl_hankel_2e(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:397:13: note: ‘special_ccyl_hankel_2e’ was previously declared here
  397 | npy_cdouble special_ccyl_hankel_2e(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:397:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
scipy/special/_ufuncs_defs.h:61:13: error: type of ‘chyp1f1_wrap’ does not match original declaration [-Werror=lto-type-mismatch]
   61 | npy_cdouble chyp1f1_wrap(npy_double, npy_double, npy_cdouble);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:131:13: note: return value type mismatch
  131 | npy_cdouble chyp1f1_wrap(double a, double b, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:131:13: note: ‘chyp1f1_wrap’ was previously declared here
  131 | npy_cdouble chyp1f1_wrap(double a, double b, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:131:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:165:13: error: type of ‘special_chyp2f1’ does not match original declaration [-Werror=lto-type-mismatch]
  165 | npy_cdouble special_chyp2f1(double a, double b, double c, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:441:13: note: return value type mismatch
  441 | npy_cdouble special_chyp2f1(double a, double b, double c, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:441:13: note: ‘special_chyp2f1’ was previously declared here
  441 | npy_cdouble special_chyp2f1(double a, double b, double c, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:441:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:111:13: error: type of ‘special_ccyl_bessel_i’ does not match original declaration [-Werror=lto-type-mismatch]
  111 | npy_cdouble special_ccyl_bessel_i(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:361:13: note: return value type mismatch
  361 | npy_cdouble special_ccyl_bessel_i(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:361:13: note: ‘special_ccyl_bessel_i’ was previously declared here
  361 | npy_cdouble special_ccyl_bessel_i(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:361:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:114:13: error: type of ‘special_ccyl_bessel_ie’ does not match original declaration [-Werror=lto-type-mismatch]
  114 | npy_cdouble special_ccyl_bessel_ie(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:367:13: note: return value type mismatch
  367 | npy_cdouble special_ccyl_bessel_ie(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:367:13: note: ‘special_ccyl_bessel_ie’ was previously declared here
  367 | npy_cdouble special_ccyl_bessel_ie(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:367:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:102:13: error: type of ‘special_ccyl_bessel_je’ does not match original declaration [-Werror=lto-type-mismatch]
  102 | npy_cdouble special_ccyl_bessel_je(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:343:13: note: return value type mismatch
  343 | npy_cdouble special_ccyl_bessel_je(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:343:13: note: ‘special_ccyl_bessel_je’ was previously declared here
  343 | npy_cdouble special_ccyl_bessel_je(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:343:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:51:6: error: type of ‘special_ckelvin’ does not match original declaration [-Werror=lto-type-mismatch]
   51 | void special_ckelvin(double x, npy_cdouble *Be, npy_cdouble *Ke, npy_cdouble *Bep, npy_cdouble *Kep);
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:177:6: note: ‘special_ckelvin’ was previously declared here
  177 | void special_ckelvin(double x, npy_cdouble *Be, npy_cdouble *Ke, npy_cdouble *Bep, npy_cdouble *Kep) {
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:177:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:118:13: error: type of ‘special_ccyl_bessel_k’ does not match original declaration [-Werror=lto-type-mismatch]
  118 | npy_cdouble special_ccyl_bessel_k(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:375:13: note: return value type mismatch
  375 | npy_cdouble special_ccyl_bessel_k(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:375:13: note: ‘special_ccyl_bessel_k’ was previously declared here
  375 | npy_cdouble special_ccyl_bessel_k(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:375:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:121:13: error: type of ‘special_ccyl_bessel_ke’ does not match original declaration [-Werror=lto-type-mismatch]
  121 | npy_cdouble special_ccyl_bessel_ke(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:381:13: note: return value type mismatch
  381 | npy_cdouble special_ccyl_bessel_ke(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:381:13: note: ‘special_ccyl_bessel_ke’ was previously declared here
  381 | npy_cdouble special_ccyl_bessel_ke(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:381:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:88:6: error: type of ‘modified_fresnel_minus_wrap’ does not match original declaration [-Werror=lto-type-mismatch]
   88 | void modified_fresnel_minus_wrap(double x, npy_cdouble *F, npy_cdouble *K);
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:301:6: note: ‘modified_fresnel_minus_wrap’ was previously declared here
  301 | void modified_fresnel_minus_wrap(double x, npy_cdouble *Fminus, npy_cdouble *Kminus) {
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:301:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:87:6: error: type of ‘modified_fresnel_plus_wrap’ does not match original declaration [-Werror=lto-type-mismatch]
   87 | void modified_fresnel_plus_wrap(double x, npy_cdouble *F, npy_cdouble *K);
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:295:6: note: ‘modified_fresnel_plus_wrap’ was previously declared here
  295 | void modified_fresnel_plus_wrap(double x, npy_cdouble *Fplus, npy_cdouble *Kplus) {
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:295:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:170:13: error: type of ‘special_crgamma’ does not match original declaration [-Werror=lto-type-mismatch]
  170 | npy_cdouble special_crgamma(npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:415:13: note: return value type mismatch
  415 | npy_cdouble special_crgamma(npy_cdouble z) { return to_ccomplex(special::rgamma(to_complex(z))); }
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:415:13: note: ‘special_crgamma’ was previously declared here
  415 | npy_cdouble special_crgamma(npy_cdouble z) { return to_ccomplex(special::rgamma(to_complex(z))); }
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:415:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:173:13: error: type of ‘special_sph_harm_unsafe’ does not match original declaration [-Werror=lto-type-mismatch]
  173 | npy_cdouble special_sph_harm_unsafe(double m, double n, double theta, double phi);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:453:13: note: return value type mismatch
  453 | npy_cdouble special_sph_harm_unsafe(double m, double n, double theta, double phi) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:453:13: note: ‘special_sph_harm_unsafe’ was previously declared here
  453 | npy_cdouble special_sph_harm_unsafe(double m, double n, double theta, double phi) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:453:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:172:13: error: type of ‘special_sph_harm’ does not match original declaration [-Werror=lto-type-mismatch]
  172 | npy_cdouble special_sph_harm(long m, long n, double theta, double phi);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:449:13: note: return value type mismatch
  449 | npy_cdouble special_sph_harm(long m, long n, double theta, double phi) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:449:13: note: ‘special_sph_harm’ was previously declared here
  449 | npy_cdouble special_sph_harm(long m, long n, double theta, double phi) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:449:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:105:13: error: type of ‘special_ccyl_bessel_y’ does not match original declaration [-Werror=lto-type-mismatch]
  105 | npy_cdouble special_ccyl_bessel_y(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:349:13: note: return value type mismatch
  349 | npy_cdouble special_ccyl_bessel_y(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:349:13: note: ‘special_ccyl_bessel_y’ was previously declared here
  349 | npy_cdouble special_ccyl_bessel_y(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:349:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:108:13: error: type of ‘special_ccyl_bessel_ye’ does not match original declaration [-Werror=lto-type-mismatch]
  108 | npy_cdouble special_ccyl_bessel_ye(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:355:13: note: return value type mismatch
  355 | npy_cdouble special_ccyl_bessel_ye(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:355:13: note: ‘special_ccyl_bessel_ye’ was previously declared here
  355 | npy_cdouble special_ccyl_bessel_ye(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:355:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:230:13: error: type of ‘special_csph_bessel_j_jac’ does not match original declaration [-Werror=lto-type-mismatch]
  230 | npy_cdouble special_csph_bessel_j_jac(long n, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:559:13: note: return value type mismatch
  559 | npy_cdouble special_csph_bessel_j_jac(long n, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:559:13: note: ‘special_csph_bessel_j_jac’ was previously declared here
  559 | npy_cdouble special_csph_bessel_j_jac(long n, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:559:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:227:13: error: type of ‘special_csph_bessel_j’ does not match original declaration [-Werror=lto-type-mismatch]
  227 | npy_cdouble special_csph_bessel_j(long n, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:553:13: note: return value type mismatch
  553 | npy_cdouble special_csph_bessel_j(long n, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:553:13: note: ‘special_csph_bessel_j’ was previously declared here
  553 | npy_cdouble special_csph_bessel_j(long n, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:553:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:236:13: error: type of ‘special_csph_bessel_y_jac’ does not match original declaration [-Werror=lto-type-mismatch]
  236 | npy_cdouble special_csph_bessel_y_jac(long n, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:571:13: note: return value type mismatch
  571 | npy_cdouble special_csph_bessel_y_jac(long n, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:571:13: note: ‘special_csph_bessel_y_jac’ was previously declared here
  571 | npy_cdouble special_csph_bessel_y_jac(long n, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:571:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:233:13: error: type of ‘special_csph_bessel_y’ does not match original declaration [-Werror=lto-type-mismatch]
  233 | npy_cdouble special_csph_bessel_y(long n, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:565:13: note: return value type mismatch
  565 | npy_cdouble special_csph_bessel_y(long n, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:565:13: note: ‘special_csph_bessel_y’ was previously declared here
  565 | npy_cdouble special_csph_bessel_y(long n, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:565:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:242:13: error: type of ‘special_csph_bessel_i_jac’ does not match original declaration [-Werror=lto-type-mismatch]
  242 | npy_cdouble special_csph_bessel_i_jac(long n, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:583:13: note: return value type mismatch
  583 | npy_cdouble special_csph_bessel_i_jac(long n, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:583:13: note: ‘special_csph_bessel_i_jac’ was previously declared here
  583 | npy_cdouble special_csph_bessel_i_jac(long n, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:583:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:239:13: error: type of ‘special_csph_bessel_i’ does not match original declaration [-Werror=lto-type-mismatch]
  239 | npy_cdouble special_csph_bessel_i(long n, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:577:13: note: return value type mismatch
  577 | npy_cdouble special_csph_bessel_i(long n, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:577:13: note: ‘special_csph_bessel_i’ was previously declared here
  577 | npy_cdouble special_csph_bessel_i(long n, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:577:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:248:13: error: type of ‘special_csph_bessel_k_jac’ does not match original declaration [-Werror=lto-type-mismatch]
  248 | npy_cdouble special_csph_bessel_k_jac(long n, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:595:13: note: return value type mismatch
  595 | npy_cdouble special_csph_bessel_k_jac(long n, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:595:13: note: ‘special_csph_bessel_k_jac’ was previously declared here
  595 | npy_cdouble special_csph_bessel_k_jac(long n, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:595:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:245:13: error: type of ‘special_csph_bessel_k’ does not match original declaration [-Werror=lto-type-mismatch]
  245 | npy_cdouble special_csph_bessel_k(long n, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:589:13: note: return value type mismatch
  589 | npy_cdouble special_csph_bessel_k(long n, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:589:13: note: ‘special_csph_bessel_k’ was previously declared here
  589 | npy_cdouble special_csph_bessel_k(long n, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:589:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:91:6: error: type of ‘special_cairy’ does not match original declaration [-Werror=lto-type-mismatch]
   91 | void special_cairy(npy_cdouble z, npy_cdouble *ai, npy_cdouble *aip, npy_cdouble *bi, npy_cdouble *bip);
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:317:6: note: type mismatch in parameter 1
  317 | void special_cairy(npy_cdouble z, npy_cdouble *ai, npy_cdouble *aip, npy_cdouble *bi, npy_cdouble *bip) {
      |      ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:317:6: note: ‘special_cairy’ was previously declared here
  317 | void special_cairy(npy_cdouble z, npy_cdouble *ai, npy_cdouble *aip, npy_cdouble *bi, npy_cdouble *bip) {
      |      ^
../scipy-9999/scipy/special/special_wrappers.cpp:317:6: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:162:13: error: type of ‘special_cgamma’ does not match original declaration [-Werror=lto-type-mismatch]
  162 | npy_cdouble special_cgamma(npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:411:13: note: return value type mismatch
  411 | npy_cdouble special_cgamma(npy_cdouble z) { return to_ccomplex(special::gamma(to_complex(z))); }
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:411:13: note: ‘special_cgamma’ was previously declared here
  411 | npy_cdouble special_cgamma(npy_cdouble z) { return to_ccomplex(special::gamma(to_complex(z))); }
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:411:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:99:13: error: type of ‘special_ccyl_bessel_j’ does not match original declaration [-Werror=lto-type-mismatch]
   99 | npy_cdouble special_ccyl_bessel_j(double v, npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:337:13: note: return value type mismatch
  337 | npy_cdouble special_ccyl_bessel_j(double v, npy_cdouble z) {
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:337:13: note: ‘special_ccyl_bessel_j’ was previously declared here
  337 | npy_cdouble special_ccyl_bessel_j(double v, npy_cdouble z) {
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:337:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:159:13: error: type of ‘special_cloggamma’ does not match original declaration [-Werror=lto-type-mismatch]
  159 | npy_cdouble special_cloggamma(npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:437:13: note: return value type mismatch
  437 | npy_cdouble special_cloggamma(npy_cdouble z) { return to_ccomplex(special::loggamma(to_complex(z))); }
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:437:13: note: ‘special_cloggamma’ was previously declared here
  437 | npy_cdouble special_cloggamma(npy_cdouble z) { return to_ccomplex(special::loggamma(to_complex(z))); }
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:437:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../scipy-9999/scipy/special/special_wrappers.h:142:13: error: type of ‘special_cdigamma’ does not match original declaration [-Werror=lto-type-mismatch]
  142 | npy_cdouble special_cdigamma(npy_cdouble z);
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:407:13: note: return value type mismatch
  407 | npy_cdouble special_cdigamma(npy_cdouble z) { return to_ccomplex(special::digamma(to_complex(z))); }
      |             ^
../../../../../../../usr/lib/python3.12/site-packages/numpy/_core/include/numpy/npy_common.h:362:3: note: type ‘struct npy_cdouble’ should match type ‘npy_cdouble’
  362 | } npy_cdouble;
      |   ^
../scipy-9999/scipy/special/special_wrappers.cpp:407:13: note: ‘special_cdigamma’ was previously declared here
  407 | npy_cdouble special_cdigamma(npy_cdouble z) { return to_ccomplex(special::digamma(to_complex(z))); }
      |             ^
../scipy-9999/scipy/special/special_wrappers.cpp:407:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto1: some warnings being treated as errors
lto-wrapper: fatal error: g++-14 returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
ninja: build stopped: cannot make progress due to previous errors.
 * ERROR: dev-python/scipy-9999::gentoo failed (compile phase):

SciPy/NumPy/Python version and system information

$ emerge -pv numpy
[binary   R   ~] dev-python/numpy-2.0.0-1:0/2::gentoo  USE="lapack -debug -test" PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11 -python3_13" 0 KiB

About this issue

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

Most upvoted comments

I did a fresh build. New log: build.log

It looks effectively identical so I won’t repaste the extracts inline into the comment field.

Time traveling much lately. I meant 2.2.6 😅

We could maybe use std::complex, but doing that opens yet another can of worms.

Mind expanding on what is this can of worms?

For one, I don’t think it would fix the original lto mismatch issue for bridge code that allows calling complex valued C++ functions from C, since you’d still have the same variables with different types in different translation units.

I think it’s also possible to fix this on the SciPy side by making the current C++ bridge file have a third complex type which is the same in both C++ and C and which is used internally, and then another C bridge file where this gets converted to npy_cdouble. A little messy, but maybe the only option.

I think this is the solution, essentially now we need to replicate what NumPy used to do. My recollection is that part of the problem here is that some C++ compilers don’t support using the standard C complex type in C++. So the bridge had to be something else to keep all compilers happy. That, until now, was the NumPy complex type. We could just define our own for the C bindings, it’s not a big deal.

Anyway, that’s from my memory.

We could maybe use std::complex, but doing that opens yet another can of worms.

Mind expanding on what is this can of worms?

For one, I don’t think it would fix the original lto mismatch issue for bridge code that allows calling complex valued C++ functions from C, since you’d still have the same variables with different types in different translation units.

I think it’s also possible to fix this on the SciPy side by making the current C++ bridge file have a third complex type which is the same in both C++ and C and which is used internally, and then another C bridge file where this gets converted to npy_cdouble. A little messy, but maybe the only option.