Coder Social home page Coder Social logo

rgommers / scipy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scipy/scipy

22.0 4.0 5.0 154.61 MB

Scipy main repository

Home Page: http://scipy.org/

License: BSD 3-Clause "New" or "Revised" License

Python 57.35% C 16.72% Fortran 15.86% Makefile 0.01% MATLAB 0.01% C++ 4.36% TeX 0.17% Shell 0.05% Meson 0.52% Cython 4.93% Starlark 0.01% R 0.01%

scipy's Introduction

https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A https://img.shields.io/pypi/dm/scipy.svg?label=Pypi%20downloads https://img.shields.io/conda/dn/conda-forge/scipy.svg?label=Conda%20downloads https://img.shields.io/badge/DOI-10.1038%2Fs41592--019--0686--2-blue

SciPy (pronounced "Sigh Pie") is an open-source software for mathematics, science, and engineering. It includes modules for statistics, optimization, integration, linear algebra, Fourier transforms, signal and image processing, ODE solvers, and more.

SciPy is built to work with NumPy arrays, and provides many user-friendly and efficient numerical routines, such as routines for numerical integration and optimization. Together, they run on all popular operating systems, are quick to install, and are free of charge. NumPy and SciPy are easy to use, but powerful enough to be depended upon by some of the world's leading scientists and engineers. If you need to manipulate numbers on a computer and display or publish the results, give SciPy a try!

For the installation instructions, see our install guide.

Call for Contributions

We appreciate and welcome contributions. Small improvements or fixes are always appreciated; issues labeled as "good first issue" may be a good starting point. Have a look at our contributing guide.

Writing code isn’t the only way to contribute to SciPy. You can also:

  • review pull requests
  • triage issues
  • develop tutorials, presentations, and other educational materials
  • maintain and improve our website
  • develop graphic design for our brand assets and promotional materials
  • help with outreach and onboard new contributors
  • write grant proposals and help with other fundraising efforts

If you’re unsure where to start or how your skills fit in, reach out! You can ask on the mailing list or here, on GitHub, by leaving a comment on a relevant issue that is already open.

If you are new to contributing to open source, this guide helps explain why, what, and how to get involved.

scipy's People

Contributors

alexbrc avatar andyfaff avatar atsushisakai avatar cournape avatar dlax avatar endolith avatar eric-jones avatar ev-br avatar ilayn avatar jarrodmillman avatar kai-striega avatar larsmans avatar larsoner avatar matthew-brett avatar mckib2 avatar mdhaber avatar nmayorov avatar pearu avatar perimosocordiae avatar person142 avatar peterbell10 avatar pv avatar pvanmulbregt avatar rgommers avatar rkern avatar stefanv avatar teoliphant avatar tupui avatar tylerjereddy avatar warrenweckesser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

scipy's Issues

Meson doesn't work with the clang+gfortran combo on arm64 macOS

An attempted build will immediately fail with:

% meson setup build
The Meson build system
Version: 0.59.99
Source dir: /Users/rgommers/code/bldscipy
Build dir: /Users/rgommers/code/bldscipy/build
Build type: native build
Project name: SciPy
Project version: 1.7.0.dev0+ababababab

meson.build:1:0: ERROR: Unable to detect GNU compiler type:
error: unknown target ABI 'lp64'
error: unknown target ABI 'lp64'

Related issue: conda-forge/gfortran_osx-64-feedstock#11. Trying that "fake cc1" workaround does not make a difference. The issue is that Meson expects that if you're using gfortran, you are also using gcc. It tries to execute gfortran -E -dm - at https://github.com/mesonbuild/meson/blob/61993f893bbdc2415155e28ee70e6ea806725e64/mesonbuild/environment.py#L668-L671. And that just does not result in a valid call to clang. Trying that with verbose output:

% $FC -E -dm - --verbose
Using built-in specs.
COLLECT_GCC=/Users/rgommers/mambaforge/envs/scipy-meson/bin/arm64-apple-darwin20.0.0-gfortran
Target: arm64-apple-darwin20.0.0
Configured with: ../configure --prefix=/Users/rgommers/mambaforge/envs/scipy-meson --build=x86_64-apple-darwin13.4.0 --host=arm64-apple-darwin20.0.0 --target=arm64-apple-darwin20.0.0 --with-libiconv-prefix=/Users/rgommers/mambaforge/envs/scipy-meson --enable-languages=fortran --disable-multilib --enable-checking=release --disable-bootstrap --disable-libssp --with-gmp=/Users/rgommers/mambaforge/envs/scipy-meson --with-mpfr=/Users/rgommers/mambaforge/envs/scipy-meson --with-mpc=/Users/rgommers/mambaforge/envs/scipy-meson --with-isl=/Users/rgommers/mambaforge/envs/scipy-meson
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.1 20210403 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-E' '-dm' '-v' '-mmacosx-version-min=11.4.0' '-asm_macosx_version_min=11.4' '-mlittle-endian' '-mabi=lp64'
 cc1 -E -quiet -v -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -D__DYNAMIC__ - -fPIC -mmacosx-version-min=11.4.0 -mlittle-endian -mabi=lp64 -dm -dumpbase -
clang version 11.1.0
Target: arm64-apple-darwin20.0.0
Thread model: posix
InstalledDir: /Users/rgommers/mambaforge/envs/scipy-meson/bin
clang-11: warning: argument unused during compilation: '-dm' [-Wunused-command-line-argument]
 "/Users/rgommers/mambaforge/envs/scipy-meson/bin/clang-11" -cc1 -triple arm64-apple-macosx11.4.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-rounding-math -munwind-tables -target-sdk-version=11.3 -fcompatibility-qualified-id-block-type-checking -target-cpu apple-a7 -target-feature +fp-armv8 -target-feature +neon -target-feature +crypto -target-feature +zcm -target-feature +zcz -target-feature +sha2 -target-feature +aes -target-abi lp64 -fallow-half-arguments-and-returns -debugger-tuning=lldb -target-linker-version 530 -v -resource-dir /Users/rgommers/mambaforge/envs/scipy-meson/lib/clang/11.1.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -D __DYNAMIC__ -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Users/rgommers/mambaforge/envs/scipy-meson/lib/clang/11.1.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -fdebug-compilation-dir /Users/rgommers/code/bldscipy -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcolor-diagnostics -o - -x c -
error: unknown target ABI 'lp64'
 "/Users/rgommers/mambaforge/envs/scipy-meson/bin/clang-11" -cc1 -triple arm64-apple-macosx11.4.0 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-rounding-math -munwind-tables -target-sdk-version=11.3 -fcompatibility-qualified-id-block-type-checking -target-cpu apple-a7 -target-feature +fp-armv8 -target-feature +neon -target-feature +crypto -target-feature +zcm -target-feature +zcz -target-feature +sha2 -target-feature +aes -target-abi lp64 -fallow-half-arguments-and-returns -debugger-tuning=lldb -target-linker-version 530 -v -resource-dir /Users/rgommers/mambaforge/envs/scipy-meson/lib/clang/11.1.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -D __DYNAMIC__ -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Users/rgommers/mambaforge/envs/scipy-meson/lib/clang/11.1.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -fdebug-compilation-dir /Users/rgommers/code/bldscipy -ferror-limit 19 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcolor-diagnostics -o - -x c -
error: unknown target ABI 'lp64'

Looks like that needs a fix in Meson.

BUG: Scipy build failing

Describe your issue.

Facing the below error while trying to run python dev.py --build-only

meson.build:41:0: ERROR: Executables created by Fortran compiler /Users/sayantikabanik/miniforge3/envs/scipy-dev/bin/arm64-apple-darwin20.0.0-gfortran are not runnable.
conda info

     active environment : scipy-dev
    active env location : /Users/sayantikabanik/miniforge3/envs/scipy-dev
            shell level : 2
       user config file : /Users/sayantikabanik/.condarc
 populated config files : /Users/sayantikabanik/miniforge3/.condarc
                          /Users/sayantikabanik/.condarc
          conda version : 4.11.0
    conda-build version : not installed
         python version : 3.9.7.final.0
       virtual packages : __osx=12.2.1=0
                          __unix=0=0
                          __archspec=1=arm64
       base environment : /Users/sayantikabanik/miniforge3  (writable)
      conda av data dir : /Users/sayantikabanik/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/sayantikabanik/miniforge3/pkgs
                          /Users/sayantikabanik/.conda/pkgs
       envs directories : /Users/sayantikabanik/miniforge3/envs
                          /Users/sayantikabanik/.conda/envs
               platform : osx-arm64
             user-agent : conda/4.11.0 requests/2.27.1 CPython/3.9.7 Darwin/21.3.0 OSX/12.2.1
                UID:GID : 501:20
             netrc file : None
           offline mode : False

conda list

# Name                    Version                   Build  Channel
alabaster                 0.7.12                     py_0    conda-forge
appnope                   0.1.2           py310hbe9552e_2    conda-forge
asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
asv                       0.5.1           py310h1b49c16_0    conda-forge
attrs                     21.4.0             pyhd8ed1ab_0    conda-forge
babel                     2.9.1              pyh44b312d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.10.0             pyha770c72_0    conda-forge
beniget                   0.4.1              pyhd8ed1ab_0    conda-forge
black                     22.1.0             pyhd8ed1ab_0    conda-forge
brotli                    1.0.9                h3422bc3_6    conda-forge
brotli-bin                1.0.9                h3422bc3_6    conda-forge
brotlipy                  0.7.0           py310he2143c4_1003    conda-forge
bzip2                     1.0.8                h3422bc3_4    conda-forge
c-compiler                1.3.0                h3422bc3_0    conda-forge
ca-certificates           2021.10.8            h4653dfc_0    conda-forge
cctools                   973.0.1              ha9384d2_6    conda-forge
cctools_osx-arm64         973.0.1              ha8964d5_6    conda-forge
certifi                   2021.10.8       py310hbe9552e_1    conda-forge
cffi                      1.15.0          py310hf10583b_0    conda-forge
chardet                   4.0.0           py310hbe9552e_2    conda-forge
charset-normalizer        2.0.11             pyhd8ed1ab_0    conda-forge
clang                     11.1.0               hce30654_1    conda-forge
clang-11                  11.1.0          default_h0fdd720_1    conda-forge
clang_osx-arm64           11.1.0               hf92b6e0_6    conda-forge
clangxx                   11.1.0          default_h8b1a7b7_1    conda-forge
clangxx_osx-arm64         11.1.0               h0742238_6    conda-forge
click                     8.0.3           py310hbe9552e_1    conda-forge
cloudpickle               2.0.0                    pypi_0    pypi
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
compiler-rt               11.1.0               h7d99272_0    conda-forge
compiler-rt_osx-arm64     11.1.0               h103ad0d_0    conda-forge
compilers                 1.3.0                hce30654_0    conda-forge
conda                     4.11.0          py310hbe9552e_0    conda-forge
conda-build               3.21.8          py310hbe9552e_0    conda-forge
conda-package-handling    1.7.3           py310he2143c4_1    conda-forge
coverage                  6.3.1           py310he2143c4_0    conda-forge
cryptography              36.0.1          py310heb878e4_0    conda-forge
cxx-compiler              1.3.0                hc021e02_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
cython                    0.29.27         py310h1b49c16_0    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
docutils                  0.17.1          py310hbe9552e_1    conda-forge
doit                      0.34.1                   pypi_0    pypi
execnet                   1.9.0              pyhd8ed1ab_0    conda-forge
executing                 0.8.2              pyhd8ed1ab_0    conda-forge
filelock                  3.4.2              pyhd8ed1ab_1    conda-forge
flake8                    3.9.2              pyhd8ed1ab_0    conda-forge
fonttools                 4.29.1          py310he2143c4_0    conda-forge
fortran-compiler          1.3.0                h630c574_0    conda-forge
freetype                  2.10.4               h17b34a0_1    conda-forge
fribidi                   1.0.10               h27ca646_0    conda-forge
gast                      0.5.3              pyhd8ed1ab_0    conda-forge
gettext                   0.19.8.1          h049c9fb_1008    conda-forge
gfortran                  11.0.1.dev0         h40eb566_15    conda-forge
gfortran_impl_osx-arm64   11.0.1.dev0         hbce66ab_23    conda-forge
gfortran_osx-arm64        11.0.1.dev0         h57527a5_15    conda-forge
giflib                    5.2.1                h27ca646_2    conda-forge
glob2                     0.7                        py_0    conda-forge
gmp                       6.2.1                h9f76cd9_0    conda-forge
gmpy2                     2.1.2           py310h25f46c9_0    conda-forge
icu                       69.1                 hbdafb3b_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
imagesize                 1.3.0              pyhd8ed1ab_0    conda-forge
importlib-metadata        4.11.0          py310hbe9552e_0    conda-forge
iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
ipython                   8.0.1           py310hbe9552e_0    conda-forge
isl                       0.22.1               hb904e53_2    conda-forge
jbig                      2.1               h3422bc3_2003    conda-forge
jedi                      0.18.1          py310hbe9552e_0    conda-forge
jinja2                    3.0.3              pyhd8ed1ab_0    conda-forge
jpeg                      9e                   h3422bc3_0    conda-forge
kiwisolver                1.3.2           py310hd99b56e_1    conda-forge
lcms2                     2.12                 had6a04f_0    conda-forge
ld64                      609                  h08716b2_6    conda-forge
ld64_osx-arm64            609                  h354fe41_6    conda-forge
lerc                      3.0                  hbdafb3b_0    conda-forge
libarchive                3.5.2                hc24d6eb_1    conda-forge
libblas                   3.9.0           13_osxarm64_openblas    conda-forge
libbrotlicommon           1.0.9                h3422bc3_6    conda-forge
libbrotlidec              1.0.9                h3422bc3_6    conda-forge
libbrotlienc              1.0.9                h3422bc3_6    conda-forge
libcblas                  3.9.0           13_osxarm64_openblas    conda-forge
libclang-cpp11.1          11.1.0          default_h0fdd720_1    conda-forge
libcxx                    12.0.1               h168391b_1    conda-forge
libdeflate                1.8                  h3422bc3_0    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0.dev0      11_0_1_hf114ba7_23    conda-forge
libgfortran-devel_osx-arm64 11.0.1.dev0         hf114ba7_23    conda-forge
libgfortran5              11.0.1.dev0         hf114ba7_23    conda-forge
libglib                   2.70.2               h67e64d8_4    conda-forge
libiconv                  1.16                 h642e427_0    conda-forge
liblapack                 3.9.0           13_osxarm64_openblas    conda-forge
liblief                   0.11.5               hbdafb3b_1    conda-forge
libllvm11                 11.1.0               h93073aa_2    conda-forge
libopenblas               0.3.18          openmp_h5dd58f0_0    conda-forge
libpng                    1.6.37               hf7e6567_2    conda-forge
libtiff                   4.3.0                h74060c4_2    conda-forge
libwebp                   1.2.2                h0d20362_0    conda-forge
libwebp-base              1.2.2                h3422bc3_1    conda-forge
libxcb                    1.13              h9b22ae9_1004    conda-forge
libxml2                   2.9.12               hedbfbf4_1    conda-forge
libzlib                   1.2.11            hee7b306_1013    conda-forge
llvm-openmp               13.0.1               hf3c4609_0    conda-forge
llvm-tools                11.1.0               h93073aa_2    conda-forge
lz4-c                     1.9.3                hbdafb3b_1    conda-forge
lzo                       2.10              h642e427_1000    conda-forge
macfsevents               0.8.1                    pypi_0    pypi
markupsafe                2.0.1           py310he2143c4_1    conda-forge
matplotlib                3.5.1           py310hb6292c7_0    conda-forge
matplotlib-base           3.5.1           py310hacb9267_0    conda-forge
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
meson                     0.61.2             pyhd8ed1ab_0    conda-forge
mpc                       1.2.1                h309154c_0    conda-forge
mpfr                      4.1.0                h6d7a090_1    conda-forge
mpmath                    1.2.1              pyhd8ed1ab_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mypy                      0.931           py310he2143c4_2    conda-forge
mypy_extensions           0.4.3           py310hbe9552e_4    conda-forge
ncurses                   6.3                  hc470f4d_0    conda-forge
ninja                     1.10.2               hc021e02_1    conda-forge
numpy                     1.22.2          py310h567df17_0    conda-forge
numpydoc                  1.1.0                      py_1    conda-forge
openblas                  0.3.18          openmp_h3b88efd_0    conda-forge
openjpeg                  2.4.0                h062765e_1    conda-forge
openssl                   1.1.1l               h3422bc3_0    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pathspec                  0.9.0              pyhd8ed1ab_0    conda-forge
pcre                      8.45                 hbdafb3b_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.0.1           py310h3e63bf8_1    conda-forge
pip                       22.0.3             pyhd8ed1ab_0    conda-forge
pkg-config                0.29.2            h144af15_1008    conda-forge
pkginfo                   1.8.2              pyhd8ed1ab_0    conda-forge
platformdirs              2.5.0              pyhd8ed1ab_0    conda-forge
pluggy                    1.0.0           py310hbe9552e_2    conda-forge
ply                       3.11                       py_1    conda-forge
prompt-toolkit            3.0.27             pyha770c72_0    conda-forge
psutil                    5.9.0           py310he2143c4_0    conda-forge
pthread-stubs             0.4               h27ca646_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py                        1.11.0             pyh6c4a22f_0    conda-forge
py-lief                   0.11.5          py310h1b49c16_1    conda-forge
pybind11                  2.9.1           py310hd99b56e_0    conda-forge
pybind11-global           2.9.1           py310hd99b56e_0    conda-forge
pycodestyle               2.7.0              pyhd8ed1ab_0    conda-forge
pycosat                   0.6.3           py310he2143c4_1009    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydata-sphinx-theme       0.8.0              pyhd8ed1ab_0    conda-forge
pyflakes                  2.3.1              pyhd8ed1ab_0    conda-forge
pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.7              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1           py310hbe9552e_4    conda-forge
pytest                    7.0.0           py310hbe9552e_0    conda-forge
pytest-cov                3.0.0              pyhd8ed1ab_0    conda-forge
pytest-forked             1.4.0              pyhd8ed1ab_0    conda-forge
pytest-xdist              2.5.0              pyhd8ed1ab_0    conda-forge
python                    3.10.2          hd16f9c5_3_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-libarchive-c       4.0             py310hbe9552e_0    conda-forge
python_abi                3.10                    2_cp310    conda-forge
pythran                   0.11.0          py310hd0bb7a8_0    conda-forge
pytz                      2021.3             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0             py310he2143c4_3    conda-forge
readline                  8.1                  hedafd6a_0    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
ripgrep                   13.0.0               h822aac1_1    conda-forge
ruamel_yaml               0.15.80         py310he2143c4_1006    conda-forge
setuptools                59.8.0          py310hbe9552e_0    conda-forge
sigtool                   0.1.3                h7747421_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.1              pyhd8ed1ab_0    conda-forge
sphinx                    4.4.0              pyh6c4a22f_1    conda-forge
sphinx-panels             0.6.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_1    conda-forge
sqlite                    3.37.0               h72a2b83_0    conda-forge
stack_data                0.1.4              pyhd8ed1ab_0    conda-forge
tapi                      1100.0.11            he4954df_0    conda-forge
threadpoolctl             3.1.0              pyh8a188c0_0    conda-forge
tk                        8.6.11               he1e0b03_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tornado                   6.1             py310he2143c4_2    conda-forge
tqdm                      4.62.3             pyhd8ed1ab_0    conda-forge
traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
typed-ast                 1.5.2           py310he2143c4_0    conda-forge
typing_extensions         4.0.1              pyha770c72_0    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
unicodedata2              14.0.0          py310he2143c4_0    conda-forge
urllib3                   1.26.8             pyhd8ed1ab_1    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.9                h27ca646_0    conda-forge
xorg-libxdmcp             1.1.3                h27ca646_0    conda-forge
xsimd                     8.0.5                hc021e02_0    conda-forge
xz                        5.2.5                h642e427_1    conda-forge
yaml                      0.2.5                h3422bc3_2    conda-forge
zipp                      3.7.0              pyhd8ed1ab_1    conda-forge
zlib                      1.2.11            hee7b306_1013    conda-forge
zstd                      1.5.2                h861e0a7_0    conda-forge

Reproducing Code Example

- Deleted the older fork and cloned the forked repo again. 
- Activated the conda environment `scipy-dev`
- updated the submodules using `git submodule update --init`
- Finally the command `python dev.py --build-only`

Error message

Build started at 2022-02-21T15:23:37.687537
Main binary: /Users/sayantikabanik/miniforge3/envs/scipy-dev/bin/python3.10
Build Options: -Dprefix=/Users/sayantikabanik/scipy/build-install
Python system: Darwin
The Meson build system
Version: 0.61.2
Source dir: /Users/sayantikabanik/scipy
Build dir: /Users/sayantikabanik/scipy/build
Build type: native build
Project name: SciPy
Project version: 1.9.0.dev0
Sanity testing C compiler: arm64-apple-darwin20.0.0-clang
Is cross compiler: False.
Sanity check compiler command line: arm64-apple-darwin20.0.0-clang sanitycheckc.c -o sanitycheckc.exe -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -Wno-incompatible-pointer-types -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib -L/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /Users/sayantikabanik/scipy/build/meson-private/sanitycheckc.exe
C compiler for the host machine: arm64-apple-darwin20.0.0-clang (clang 11.1.0 "clang version 11.1.0")
C linker for the host machine: arm64-apple-darwin20.0.0-clang ld64 609
Sanity testing C++ compiler: arm64-apple-darwin20.0.0-clang++
Is cross compiler: False.
Sanity check compiler command line: arm64-apple-darwin20.0.0-clang++ sanitycheckcpp.cc -o sanitycheckcpp.exe -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem /Users/sayantikabanik/miniforge3/envs/scipy-dev/include -D_FORTIFY_SOURCE=2 -isystem /Users/sayantikabanik/miniforge3/envs/scipy-dev/include -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib -L/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /Users/sayantikabanik/scipy/build/meson-private/sanitycheckcpp.exe
C++ compiler for the host machine: arm64-apple-darwin20.0.0-clang++ (clang 11.1.0 "clang version 11.1.0")
C++ linker for the host machine: arm64-apple-darwin20.0.0-clang++ ld64 609
Sanity testing C compiler: arm64-apple-darwin20.0.0-clang
Is cross compiler: False.
Sanity check compiler command line: arm64-apple-darwin20.0.0-clang sanitycheckc.c -o sanitycheckc.exe -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/sayantikabanik/miniforge3/envs/scipy-dev/include -D_FORTIFY_SOURCE=2 -isystem /Users/sayantikabanik/miniforge3/envs/scipy-dev/include -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib -L/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /Users/sayantikabanik/scipy/build/meson-private/sanitycheckc.exe
Compiler for language c for the build machine not found.
Sanity testing C++ compiler: arm64-apple-darwin20.0.0-clang++
Is cross compiler: False.
Sanity check compiler command line: arm64-apple-darwin20.0.0-clang++ sanitycheckcpp.cc -o sanitycheckcpp.exe -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem /Users/sayantikabanik/miniforge3/envs/scipy-dev/include -D_FORTIFY_SOURCE=2 -isystem /Users/sayantikabanik/miniforge3/envs/scipy-dev/include -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib -L/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /Users/sayantikabanik/scipy/build/meson-private/sanitycheckcpp.exe
Compiler for language cpp for the build machine not found.
Build machine cpu family: aarch64
Build machine cpu: arm64
Host machine cpu family: aarch64
Host machine cpu: arm64
Target machine cpu family: aarch64
Target machine cpu: arm64
Running compile:
Working directory:  /Users/sayantikabanik/scipy/build/meson-private/tmpb3f1xdly
Command line:  arm64-apple-darwin20.0.0-clang /Users/sayantikabanik/scipy/build/meson-private/tmpb3f1xdly/testfile.c -o /Users/sayantikabanik/scipy/build/meson-private/tmpb3f1xdly/output.obj -c -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -Wno-incompatible-pointer-types -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wunused-but-set-variable -Wno-unused-but-set-variable 

Code:
 extern int i;
int i;

Compiler stdout:
 
Compiler stderr:
 error: unknown warning option '-Wunused-but-set-variable'; did you mean '-Wunused-const-variable'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]

Compiler for C supports arguments -Wno-unused-but-set-variable: NO 
Running compile:
Working directory:  /Users/sayantikabanik/scipy/build/meson-private/tmpn1k76xd1
Command line:  arm64-apple-darwin20.0.0-clang -L/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib /Users/sayantikabanik/scipy/build/meson-private/tmpn1k76xd1/testfile.c -o /Users/sayantikabanik/scipy/build/meson-private/tmpn1k76xd1/output.exe -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -Wno-incompatible-pointer-types -O0 -Werror=implicit-function-declaration -lm -Wl,-undefined,dynamic_lookup -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/sayantikabanik/miniforge3/envs/scipy-dev/lib 

Code:
 int main(void) { return 0; }

Compiler stdout:
 
Compiler stderr:
 
Library m found: YES

meson.build:41:0: ERROR: Executables created by Fortran compiler /Users/sayantikabanik/miniforge3/envs/scipy-dev/bin/arm64-apple-darwin20.0.0-gfortran are not runnable.

SciPy/NumPy/Python version information

1.22.2 sys.version_info(major=3, minor=10, micro=2, releaselevel='final', serial=0)

Four test failures on the `meson` branch

These are the failures currently (from https://github.com/rgommers/scipy/runs/3125263304?check_suite_focus=true):

FAILED lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py::test_odeint_banded_jac
FAILED lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py::test_odeint_full_jac
FAILED lib/python3.9/site-packages/scipy/optimize/_trustregion_constr/tests/test_report.py::test_gh12922
FAILED lib/python3.9/site-packages/scipy/stats/tests/test_continuous_basic.py::test_cont_basic[500-200-ncf-arg74]

Detailed tracebacks:

=================================== FAILURES ===================================
____________________________ test_odeint_banded_jac ____________________________
[gw1] linux -- Python 3.9.6 /opt/hostedtoolcache/Python/3.9.6/x64/bin/python
lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py:75: in test_odeint_banded_jac
    check_odeint(JACTYPE_BANDED)
lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py:52: in check_odeint
    sol, info = odeint(rhs, y0, t,
        atol       = 1e-13
        dt         = 0.125
        jacobian   = <function bjac at 0x7f2a5a09a670>
        jactype    = 4
        ml         = 2
        mu         = 1
        nsteps     = 64
        rtol       = 1e-11
        t          = array([0.   , 0.125, 0.25 , 0.375, 0.5  , 0.625, 0.75 , 0.875, 1.   ,
       1.125, 1.25 , 1.375, 1.5  , 1.625, 1.75 ,...6.25 , 6.375, 6.5  , 6.625,
       6.75 , 6.875, 7.   , 7.125, 7.25 , 7.375, 7.5  , 7.625, 7.75 ,
       7.875, 8.   ])
        y0         = array([1., 2., 3., 4., 5.])
lib/python3.9/site-packages/scipy/integrate/odepack.py:241: in odeint
    output = _odepack.odeint(func, y0, t, args, Dfun, col_deriv, ml, mu,
        Dfun       = <function bjac at 0x7f2a5a09a670>
        args       = ()
        atol       = 1e-13
        col_deriv  = 0
        dt         = array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125,
       0.125, 0.125, 0.125, 0.125, 0.125, 0.125,...0.125, 0.125, 0.125, 0.125, 0.125,
       0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125,
       0.125])
        full_output = True
        func       = <function rhs at 0x7f2a5a0b2040>
        h0         = 0.0
        hmax       = 0.0
        hmin       = 0.0
        ixpr       = 0
        ml         = 2
        mu         = 1
        mxhnil     = 0
        mxordn     = 12
        mxords     = 5
        mxstep     = 0
        printmessg = 0
        rtol       = 1e-11
        t          = array([0.   , 0.125, 0.25 , 0.375, 0.5  , 0.625, 0.75 , 0.875, 1.   ,
       1.125, 1.25 , 1.375, 1.5  , 1.625, 1.75 ,...6.25 , 6.375, 6.5  , 6.625,
       6.75 , 6.875, 7.   , 7.125, 7.25 , 7.375, 7.5  , 7.625, 7.75 ,
       7.875, 8.   ])
        tcrit      = None
        tfirst     = False
        y0         = array([1., 2., 3., 4., 5.])
lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py:10: in rhs
    banded5x5.banded5x5(t, y, dydt)
E   AttributeError: module 'scipy.integrate._test_odeint_banded' has no attribute 'banded5x5'
        dydt       = array([0., 0., 0., 0., 0.])
        t          = 0.0
        y          = array([1., 2., 3., 4., 5.])
_____________________________ test_odeint_full_jac _____________________________
[gw0] linux -- Python 3.9.6 /opt/hostedtoolcache/Python/3.9.6/x64/bin/python
lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py:71: in test_odeint_full_jac
    check_odeint(JACTYPE_FULL)
lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py:52: in check_odeint
    sol, info = odeint(rhs, y0, t,
        atol       = 1e-13
        dt         = 0.125
        jacobian   = <function jac at 0x7f957ded74c0>
        jactype    = 1
        ml         = None
        mu         = None
        nsteps     = 64
        rtol       = 1e-11
        t          = array([0.   , 0.125, 0.25 , 0.375, 0.5  , 0.625, 0.75 , 0.875, 1.   ,
       1.125, 1.25 , 1.375, 1.5  , 1.625, 1.75 ,...6.25 , 6.375, 6.5  , 6.625,
       6.75 , 6.875, 7.   , 7.125, 7.25 , 7.375, 7.5  , 7.625, 7.75 ,
       7.875, 8.   ])
        y0         = array([1., 2., 3., 4., 5.])
lib/python3.9/site-packages/scipy/integrate/odepack.py:241: in odeint
    output = _odepack.odeint(func, y0, t, args, Dfun, col_deriv, ml, mu,
        Dfun       = <function jac at 0x7f957ded74c0>
        args       = ()
        atol       = 1e-13
        col_deriv  = 0
        dt         = array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125,
       0.125, 0.125, 0.125, 0.125, 0.125, 0.125,...0.125, 0.125, 0.125, 0.125, 0.125,
       0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125,
       0.125])
        full_output = True
        func       = <function rhs at 0x7f957ded78b0>
        h0         = 0.0
        hmax       = 0.0
        hmin       = 0.0
        ixpr       = 0
        ml         = -1
        mu         = -1
        mxhnil     = 0
        mxordn     = 12
        mxords     = 5
        mxstep     = 0
        printmessg = 0
        rtol       = 1e-11
        t          = array([0.   , 0.125, 0.25 , 0.375, 0.5  , 0.625, 0.75 , 0.875, 1.   ,
       1.125, 1.25 , 1.375, 1.5  , 1.625, 1.75 ,...6.25 , 6.375, 6.5  , 6.625,
       6.75 , 6.875, 7.   , 7.125, 7.25 , 7.375, 7.5  , 7.625, 7.75 ,
       7.875, 8.   ])
        tcrit      = None
        tfirst     = False
        y0         = array([1., 2., 3., 4., 5.])
lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py:10: in rhs
    banded5x5.banded5x5(t, y, dydt)
E   AttributeError: module 'scipy.integrate._test_odeint_banded' has no attribute 'banded5x5'
        dydt       = array([0., 0., 0., 0., 0.])
        t          = 0.0
        y          = array([1., 2., 3., 4., 5.])
_________________________________ test_gh12922 _________________________________
[gw0] linux -- Python 3.9.6 /opt/hostedtoolcache/Python/3.9.6/x64/bin/python
lib/python3.9/site-packages/scipy/optimize/_trustregion_constr/tests/test_report.py:27: in test_gh12922
    result = minimize(objective, x0=x0, method='trust-constr',
        cons       = {'fun': <function test_gh12922.<locals>.<lambda> at 0x7f9570680670>, 'type': 'ineq'}
        n          = 25
        objective  = <function test_gh12922.<locals>.objective at 0x7f9570680430>
        opts       = {'maxiter': 1000, 'verbose': 2}
        x0         = array([-5.        , -4.58333333, -4.16666667, -3.75      , -3.33333333,
       -2.91666667, -2.5       , -2.08333333, ...666667,  2.08333333,  2.5       ,  2.91666667,
        3.33333333,  3.75      ,  4.16666667,  4.58333333,  5.        ])
lib/python3.9/site-packages/scipy/optimize/_minimize.py:634: in minimize
    return _minimize_trustregion_constr(fun, x0, args, jac, hess, hessp,
        args       = ()
        bounds     = None
        callback   = None
        constraints = [<scipy.optimize._constraints.NonlinearConstraint object at 0x7f95706902e0>]
        fun        = <function test_gh12922.<locals>.objective at 0x7f9570680430>
        hess       = None
        hessp      = None
        jac        = '2-point'
        meth       = 'trust-constr'
        method     = 'trust-constr'
        options    = {'maxiter': 1000, 'verbose': 2}
        tol        = None
        x0         = array([-5.        , -4.58333333, -4.16666667, -3.75      , -3.33333333,
       -2.91666667, -2.5       , -2.08333333, ...666667,  2.08333333,  2.5       ,  2.91666667,
        3.33333333,  3.75      ,  4.16666667,  4.58333333,  5.        ])
lib/python3.9/site-packages/scipy/optimize/_trustregion_constr/minimize_trustregion_constr.py:509: in _minimize_trustregion_constr
    _, result = tr_interior_point(
        J_eq0      = array([], shape=(0, 25), dtype=float64)
        J_ineq0    = array([[-10.0000001,   0.       ,   0.       ,   0.       ,   0.       ,
          0.       ,   0.       ,   0.       ...    ,  -0.       ,  -0.       ,  -0.       ,
         -0.       ,  -0.       ,  -0.       ,  -0.       ,  -0.       ]])
        args       = ()
        barrier_tol = 1e-08
        bounds     = None
        c_eq0      = array([], dtype=float64)
        c_ineq0    = array([25.])
        callback   = None
        canonical  = <scipy.optimize._trustregion_constr.canonical_constraint.CanonicalConstraint object at 0x7f9570690880>
        canonical_all = [<scipy.optimize._trustregion_constr.canonical_constraint.CanonicalConstraint object at 0x7f9570690880>]
        constraints = [<scipy.optimize._constraints.NonlinearConstraint object at 0x7f95706902e0>]
        disp       = False
        factorization_method = None
        finite_diff_bounds = (-inf, inf)
        finite_diff_rel_step = None
        fun        = <function test_gh12922.<locals>.objective at 0x7f9570680430>
        grad       = '2-point'
        gtol       = 1e-08
        hess       = <scipy.optimize._hessian_update_strategy.BFGS object at 0x7f9570690d00>
        hessp      = None
        initial_barrier_parameter = 0.1
        initial_barrier_tolerance = 0.1
        initial_constr_penalty = 1.0
        initial_tr_radius = 1.0
        lagrangian_hess = <scipy.optimize._trustregion_constr.minimize_trustregion_constr.LagrangianHessian object at 0x7f95706907f0>
        maxiter    = 1000
        method     = 'tr_interior_point'
        n_sparse   = 0
        n_vars     = 25
        objective  = <scipy.optimize._differentiable_functions.ScalarFunction object at 0x7f9570690b50>
        prepared_constraints = [<scipy.optimize._constraints.PreparedConstraint object at 0x7f95706903a0>]
        sparse_jacobian = False
        start_time = 1626880845.5189075
        state      =  barrier_parameter: 2.048000000000001e-09
 barrier_tolerance: 2.048000000000001e-09
          cg_niter: 99
      cg_st...1, -9.99996971e-01,
       -1.00000212e+00, -9.99998856e-01, -9.99998509e-01, -1.00000035e+00,
       -9.99999303e-01])
        stop_criteria = <function _minimize_trustregion_constr.<locals>.stop_criteria at 0x7f957069f040>
        verbose    = 2
        x0         = array([-5.        , -4.58333333, -4.16666667, -3.75      , -3.33333333,
       -2.91666667, -2.5       , -2.08333333, ...666667,  2.08333333,  2.5       ,  2.91666667,
        3.33333333,  3.75      ,  4.16666667,  4.58333333,  5.        ])
        xtol       = 1e-08
lib/python3.9/site-packages/scipy/optimize/_trustregion_constr/tr_interior_point.py:321: in tr_interior_point
    z, state = equality_constrained_sqp(
        BARRIER_DECAY_RATIO = 0.2
        BOUNDARY_PARAMETER = 0.995
        TRUST_ENLARGEMENT = 5
        barrier_parameter = 2.048000000000001e-09
        constr     = <function CanonicalConstraint._greater_to_canonical.<locals>.fun at 0x7f957069f280>
        constr0_subprob = array([5.97175363e-16])
        constr_eq0 = array([], dtype=float64)
        constr_ineq0 = array([25.])
        enforce_feasibility = array([False])
        factorization_method = None
        fun        = <bound method ScalarFunction.fun of <scipy.optimize._differentiable_functions.ScalarFunction object at 0x7f9570690b50>>
        fun0       = 250.69444444444446
        fun0_subprob = 1.0000000555070645
        grad       = <bound method ScalarFunction.grad of <scipy.optimize._differentiable_functions.ScalarFunction object at 0x7f9570690b50>>
        grad0      = array([-8.00000038, -7.16666735, -6.3333334 , -5.50000051, -4.66666716,
       -3.83333393, -3.        , -2.16666686, ...333357,  6.16666806,  7.        ,  7.83333438,
        8.66666677,  9.5       , 10.33333369, 11.16666708, 12.        ])
        grad0_subprob = array([ 1.99999997e+00,  7.45058060e-09,  2.98023224e-08,  4.47034836e-08,
        4.47034836e-08,  8.94069672e-08,  1...8,
       -0.00000000e+00, -7.45058037e-08, -8.94069632e-08, -6.70552234e-08,
       -8.19563841e-08, -2.04800000e-09])
        initial_barrier_parameter = 0.1
        initial_penalty = 1.0
        initial_tolerance = 0.1
        initial_trust_radius = 1.0
        jac        = <function CanonicalConstraint._greater_to_canonical.<locals>.jac at 0x7f957069f4c0>
        jac0_subprob = array([[-3.14342542e-08,  0.00000000e+00,  0.00000000e+00,
         0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
... 0.00000000e+00,
         0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         0.00000000e+00,  5.28839571e-16]])
        jac_eq0    = array([], shape=(0, 25), dtype=float64)
        jac_ineq0  = array([[-10.0000001,   0.       ,   0.       ,   0.       ,   0.       ,
          0.       ,   0.       ,   0.       ...    ,  -0.       ,  -0.       ,  -0.       ,
         -0.       ,  -0.       ,  -0.       ,  -0.       ,  -0.       ]])
        lagr_hess  = <scipy.optimize._trustregion_constr.minimize_trustregion_constr.LagrangianHessian object at 0x7f95706907f0>
        n_eq       = 0
        n_ineq     = 1
        n_vars     = 25
        s0         = array([1.])
        state      =  barrier_parameter: 2.048000000000001e-09
 barrier_tolerance: 2.048000000000001e-09
          cg_niter: 99
      cg_st...1, -9.99996971e-01,
       -1.00000212e+00, -9.99998856e-01, -9.99998509e-01, -1.00000035e+00,
       -9.99999303e-01])
        stop_criteria = <function _minimize_trustregion_constr.<locals>.stop_criteria at 0x7f957069f040>
        subprob    = <scipy.optimize._trustregion_constr.tr_interior_point.BarrierSubproblem object at 0x7f957af19e50>
        tolerance  = 2.048000000000001e-09
        trust_lb   = array([  -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf, -0.995])
        trust_radius = 1.0
        trust_ub   = array([inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf,
       inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf])
        x0         = array([-5.        , -4.58333333, -4.16666667, -3.75      , -3.33333333,
       -2.91666667, -2.5       , -2.08333333, ...666667,  2.08333333,  2.5       ,  2.91666667,
        3.33333333,  3.75      ,  4.16666667,  4.58333333,  5.        ])
        xtol       = 1e-08
        z          = array([-8.26654652e-09, -9.99999988e-01, -9.99999978e-01, -9.99999970e-01,
       -9.99999971e-01, -9.99999949e-01, -9...1,
       -9.99999994e-01, -1.00000003e+00, -1.00000004e+00, -1.00000003e+00,
       -1.00000004e+00,  5.28839571e-16])
lib/python3.9/site-packages/scipy/optimize/_trustregion_constr/equality_constrained_sqp.py:165: in equality_constrained_sqp
    f_soc, b_soc = fun_and_constr(x_soc)
        A          = array([[-2.69181670e-08,  0.00000000e+00,  0.00000000e+00,
         0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
... 0.00000000e+00,
         0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         0.00000000e+00,  2.64419786e-18]])
        BOX_FACTOR = 0.5
        H          = <26x26 _CustomLinearOperator with dtype=float64>
        INTERMEDIARY_REDUCTION_RATIO = 0.3
        LARGE_REDUCTION_RATIO = 0.9
        LS         = <1x26 _CustomLinearOperator with dtype=float64>
        MAX_TRUST_REDUCTION = 0.5
        MIN_TRUST_REDUCTION = 0.1
        PENALTY_FACTOR = 0.3
        S          = <26x26 _CustomLinearOperator with dtype=float64>
        SOC_THRESHOLD = 0.1
        SUFFICIENT_REDUCTION_RATIO = 1e-08
        TRUST_ENLARGEMENT_FACTOR_L = 7.0
        TRUST_ENLARGEMENT_FACTOR_S = 2.0
        TR_FACTOR  = 0.8
        Y          = <26x1 _CustomLinearOperator with dtype=float64>
        Z          = <26x26 _CustomLinearOperator with dtype=float64>
        _          = 0
        actual_reduction = -1.8834886983398746e-09
        b          = array([3.87463048e-17])
        b_next     = array([2.35207988e-17])
        b_t        = array([0.])
        c          = array([ 1.99999997e+00,  3.09199095e-06,  9.22381878e-06, -7.22706059e-07,
       -8.53087843e-06, -7.41330030e-06,  1...6,
       -4.26172308e-06,  2.27242708e-06,  2.96533108e-06, -7.15255482e-07,
        1.37835741e-06, -2.04800000e-09])
        c_t        = array([ 2.28549660e+00,  1.77356434e-06,  5.29700086e-06, -3.99091525e-07,
       -4.87347004e-06, -4.21476252e-06,  5...6,
       -2.44275525e-06,  1.27143740e-06,  1.66209417e-06, -4.36310798e-07,
        7.54939587e-07, -2.04800000e-09])
        cg_info    = {'hits_boundary': False, 'niter': 1, 'stop_cond': 4}
        constr0    = array([5.97175363e-16])
        constr_violation = 3.874630476438635e-17
        d          = array([ 1.43941097e-09, -5.31177310e-07, -1.58643620e-06,  1.19526740e-07,
        1.45958996e-06,  1.26230899e-06, -1...6,
        7.31598023e-07, -3.80791767e-07, -4.97792321e-07,  1.30673803e-07,
       -2.26102189e-07,  5.46130927e-10])
        dn         = array([ 1.43941097e-09, -0.00000000e+00, -0.00000000e+00, -0.00000000e+00,
       -0.00000000e+00, -0.00000000e+00, -0...0,
       -0.00000000e+00, -0.00000000e+00, -0.00000000e+00, -0.00000000e+00,
       -0.00000000e+00, -1.41394747e-19])
        dt         = array([ 5.36469749e-20, -5.31177310e-07, -1.58643620e-06,  1.19526740e-07,
        1.45958996e-06,  1.26230899e-06, -1...6,
        7.31598023e-07, -3.80791767e-07, -4.97792321e-07,  1.30673803e-07,
       -2.26102189e-07,  5.46130927e-10])
        f          = 1.0000000710636558
        f_next     = 1.0000000738347012
        factorization_method = None
        fun0       = 1.0000000555070645
        fun_and_constr = <bound method BarrierSubproblem.function_and_constraints of <scipy.optimize._trustregion_constr.tr_interior_point.BarrierSubproblem object at 0x7f957af19e50>>
        grad0      = array([ 1.99999997e+00,  7.45058060e-09,  2.98023224e-08,  4.47034836e-08,
        4.47034836e-08,  8.94069672e-08,  1...8,
       -0.00000000e+00, -7.45058037e-08, -8.94069632e-08, -6.70552234e-08,
       -8.19563841e-08, -2.04800000e-09])
        grad_and_jac = <bound method BarrierSubproblem.gradient_and_jacobian of <scipy.optimize._trustregion_constr.tr_interior_point.BarrierSubproblem object at 0x7f957af19e50>>
        initial_penalty = 1.0
        initial_trust_radius = 1.0
        intersect  = True
        jac0       = array([[-3.14342542e-08,  0.00000000e+00,  0.00000000e+00,
         0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
... 0.00000000e+00,
         0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         0.00000000e+00,  5.28839571e-16]])
        lagr_hess  = <bound method BarrierSubproblem.lagrangian_hessian of <scipy.optimize._trustregion_constr.tr_interior_point.BarrierSubproblem object at 0x7f957af19e50>>
        last_iteration_failed = False
        lb_t       = array([  -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf, -0.995])
        linearized_constr = array([0.])
        merit_function = 1.0000000733223358
        merit_function_next = 1.0000000752058245
        n          = 26
        new_penalty = 43528981.208981454
        optimality = 1.0184943675994873e-05
        penalty    = 58294072.700174615
        predicted_reduction = 2.7823785853887594e-09
        previous_penalty = 58294072.700174615
        quadratic_model = 3.0470286846287016e-09
        reduction_ratio = -0.6769347306763828
        scaling    = <bound method BarrierSubproblem.scaling of <scipy.optimize._trustregion_constr.tr_interior_point.BarrierSubproblem object at 0x7f957af19e50>>
        state      =  barrier_parameter: 2.048000000000001e-09
 barrier_tolerance: 2.048000000000001e-09
          cg_niter: 99
      cg_st...1, -9.99996971e-01,
       -1.00000212e+00, -9.99998856e-01, -9.99998509e-01, -1.00000035e+00,
       -9.99999303e-01])
        stop_criteria = <bound method BarrierSubproblem.stop_criteria of <scipy.optimize._trustregion_constr.tr_interior_point.BarrierSubproblem object at 0x7f957af19e50>>
        t          = 1
        trust_lb   = array([  -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,   -inf,
         -inf, -0.995])
        trust_radius = 6.96500000066631
        trust_radius_t = 6.96500000066631
        trust_ub   = array([inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf,
       inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf])
        ub_t       = array([inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf,
       inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf])
        v          = array([74299263.13440967])
        vpred      = 1e-16
        x          = array([-6.00850288e-09, -9.99998445e-01, -9.99995380e-01, -1.00000035e+00,
       -1.00000426e+00, -1.00000370e+00, -9...1,
       -1.00000212e+00, -9.99998856e-01, -9.99998509e-01, -1.00000035e+00,
       -9.99999303e-01,  2.64419786e-18])
        x0         = array([-8.26654652e-09, -9.99999988e-01, -9.99999978e-01, -9.99999970e-01,
       -9.99999971e-01, -9.99999949e-01, -9...1,
       -9.99999994e-01, -1.00000003e+00, -1.00000004e+00, -1.00000003e+00,
       -1.00000004e+00,  5.28839571e-16])
        x_next     = array([-4.56909192e-09, -9.99998977e-01, -9.99996967e-01, -1.00000023e+00,
       -1.00000280e+00, -1.00000244e+00, -9...1,
       -1.00000139e+00, -9.99999237e-01, -9.99999007e-01, -1.00000022e+00,
       -9.99999529e-01,  2.64419786e-18])
        x_soc      = array([-3.69530289e-09, -9.99998977e-01, -9.99996967e-01, -1.00000023e+00,
       -1.00000280e+00, -1.00000244e+00, -9...1,
       -1.00000139e+00, -9.99999237e-01, -9.99999007e-01, -1.00000022e+00,
       -9.99999529e-01,  2.64419786e-18])
        y          = array([ 8.73789022e-10, -0.00000000e+00, -0.00000000e+00, -0.00000000e+00,
       -0.00000000e+00, -0.00000000e+00, -0...0,
       -0.00000000e+00, -0.00000000e+00, -0.00000000e+00, -0.00000000e+00,
       -0.00000000e+00, -8.58331499e-20])
lib/python3.9/site-packages/scipy/optimize/_trustregion_constr/tr_interior_point.py:82: in function_and_constraints
    f = self.fun(x)
        s          = array([2.64419786e-18])
        self       = <scipy.optimize._trustregion_constr.tr_interior_point.BarrierSubproblem object at 0x7f957af19e50>
        x          = array([-3.69530289e-09, -9.99998977e-01, -9.99996967e-01, -1.00000023e+00,
       -1.00000280e+00, -1.00000244e+00, -9...1, -9.99998013e-01,
       -1.00000139e+00, -9.99999237e-01, -9.99999007e-01, -1.00000022e+00,
       -9.99999529e-01])
        z          = array([-3.69530289e-09, -9.99998977e-01, -9.99996967e-01, -1.00000023e+00,
       -1.00000280e+00, -1.00000244e+00, -9...1,
       -1.00000139e+00, -9.99999237e-01, -9.99999007e-01, -1.00000022e+00,
       -9.99999529e-01,  2.64419786e-18])
lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py:258: in fun
    self._update_x_impl(x)
        self       = <scipy.optimize._differentiable_functions.ScalarFunction object at 0x7f9570690b50>
        x          = array([-3.69530289e-09, -9.99998977e-01, -9.99996967e-01, -1.00000023e+00,
       -1.00000280e+00, -1.00000244e+00, -9...1, -9.99998013e-01,
       -1.00000139e+00, -9.99999237e-01, -9.99999007e-01, -1.00000022e+00,
       -9.99999529e-01])
lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py:230: in update_x
    self._update_hess()
        self       = <scipy.optimize._differentiable_functions.ScalarFunction object at 0x7f9570690b50>
        x          = array([-3.69530289e-09, -9.99998977e-01, -9.99996967e-01, -1.00000023e+00,
       -1.00000280e+00, -1.00000244e+00, -9...1, -9.99998013e-01,
       -1.00000139e+00, -9.99999237e-01, -9.99999007e-01, -1.00000022e+00,
       -9.99999529e-01])
lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py:253: in _update_hess
    self._update_hess_impl()
        self       = <scipy.optimize._differentiable_functions.ScalarFunction object at 0x7f9570690b50>
lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py:215: in update_hess
    self.H.update(self.x - self.x_prev, self.g - self.g_prev)
        self       = <scipy.optimize._differentiable_functions.ScalarFunction object at 0x7f9570690b50>
lib/python3.9/site-packages/scipy/optimize/_hessian_update_strategy.py:182: in update
    warn('delta_grad == 0.0. Check if the approximated '
E   UserWarning: delta_grad == 0.0. Check if the approximated function is linear. If the function is linear better results can be obtained by defining the Hessian as zero instead of using quasi-Newton approximations.
        delta_grad = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0., 0., 0., 0., 0., 0.])
        delta_x    = array([8.73789022e-10, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00, 0.00000000e+00, 0.000000...000e+00, 0.00000000e+00,
       0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
       0.00000000e+00])
        self       = <scipy.optimize._hessian_update_strategy.BFGS object at 0x7f9570690d00>
----------------------------- Captured stdout call -----------------------------
| niter |f evals|CG iter|  obj func   |tr radius |   opt    |  c viol  |
|-------|-------|-------|-------------|----------|----------|----------|
|   1   |  26   |   0   | +2.5069e+02 | 1.00e+00 | 1.20e+01 | 2.50e+01 |
|   2   |  52   |   1   | +2.2693e+02 | 7.00e+00 | 1.15e+01 | 1.77e+01 |
|   3   |  78   |   2   | +6.6230e+01 | 4.90e+01 | 6.32e+00 | 4.07e+00 |
|   4   |  104  |   3   | +1.2726e+01 | 4.90e+01 | 2.79e+00 | 7.77e-01 |
|   5   |  130  |   4   | +4.9841e-01 | 4.90e+01 | 1.85e-01 | 8.74e-02 |
|   6   |  156  |   6   | +7.3244e-01 | 4.90e+01 | 3.96e-02 | 2.12e-02 |
|   7   |  156  |   6   | +7.3244e-01 | 2.45e+02 | 3.96e-02 | 2.12e-02 |
|   8   |  182  |   7   | +8.6782e-01 | 2.45e+02 | 9.68e-04 | 4.68e-03 |
|   9   |  182  |   7   | +8.6782e-01 | 1.23e+03 | 9.68e-04 | 4.68e-03 |
|  10   |  208  |   9   | +9.3326e-01 | 1.23e+03 | 1.63e-02 | 1.17e-03 |
|  11   |  234  |  10   | +9.6631e-01 | 1.23e+03 | 2.46e-04 | 2.89e-04 |
|  12   |  234  |  10   | +9.6631e-01 | 6.13e+03 | 2.46e-04 | 2.89e-04 |
|  13   |  234  |  10   | +9.6631e-01 | 3.06e+04 | 2.46e-04 | 2.89e-04 |
|  14   |  260  |  13   | +9.8308e-01 | 3.06e+04 | 1.71e-04 | 7.22e-05 |
|  15   |  312  |  16   | +9.8308e-01 | 3.06e+03 | 1.71e-04 | 7.22e-05 |
|  16   |  364  |  19   | +9.8308e-01 | 3.06e+02 | 1.71e-04 | 7.22e-05 |
|  17   |  416  |  22   | +9.8308e-01 | 3.87e+01 | 1.71e-04 | 7.22e-05 |
|  18   |  468  |  25   | +9.8308e-01 | 1.94e+01 | 1.71e-04 | 7.22e-05 |
|  19   |  494  |  28   | +9.9160e-01 | 1.94e+01 | 8.68e-05 | 1.77e-05 |
|  20   |  494  |  28   | +9.9160e-01 | 9.68e+01 | 8.68e-05 | 1.77e-05 |
|  21   |  520  |  31   | +9.9580e-01 | 9.68e+01 | 1.07e-04 | 4.43e-06 |
|  22   |  546  |  32   | +9.9790e-01 | 9.68e+01 | 1.06e-05 | 1.11e-06 |
|  23   |  546  |  32   | +9.9790e-01 | 4.84e+02 | 1.06e-05 | 1.11e-06 |
|  24   |  572  |  33   | +9.9895e-01 | 4.84e+02 | 1.99e-05 | 2.75e-07 |
|  25   |  598  |  34   | +9.9948e-01 | 4.84e+02 | 1.10e-05 | 6.70e-08 |
|  26   |  624  |  37   | +9.9974e-01 | 4.84e+02 | 2.28e-06 | 1.67e-08 |
|  27   |  624  |  37   | +9.9974e-01 | 2.42e+03 | 2.28e-06 | 1.67e-08 |
|  28   |  650  |  38   | +9.9987e-01 | 2.42e+03 | 1.23e-06 | 4.18e-09 |
|  29   |  650  |  38   | +9.9987e-01 | 1.21e+04 | 1.23e-06 | 4.18e-09 |
|  30   |  676  |  39   | +9.9994e-01 | 1.21e+04 | 1.23e-06 | 1.03e-09 |
|  31   |  702  |  43   | +9.9997e-01 | 1.21e+04 | 3.60e-05 | 2.59e-10 |
|  32   |  728  |  44   | +9.9998e-01 | 1.21e+04 | 3.05e-06 | 6.46e-11 |
|  33   |  754  |  45   | +9.9999e-01 | 1.21e+04 | 3.65e-07 | 1.61e-11 |
|  34   |  780  |  46   | +1.0000e+00 | 1.21e+04 | 6.11e-07 | 4.00e-12 |
|  35   |  806  |  47   | +1.0000e+00 | 1.21e+04 | 3.95e-07 | 9.54e-13 |
|  36   |  832  |  48   | +1.0000e+00 | 1.21e+04 | 1.42e-07 | 1.92e-13 |
|  37   |  832  |  48   | +1.0000e+00 | 6.05e+04 | 1.42e-07 | 1.92e-13 |
|  38   |  858  |  53   | +1.0000e+00 | 6.05e+04 | 4.44e-06 | 4.94e-14 |
|  39   |  884  |  54   | +1.0000e+00 | 6.05e+04 | 2.82e-06 | 1.29e-14 |
|  40   |  910  |  55   | +1.0000e+00 | 6.05e+04 | 8.20e-07 | 3.38e-15 |
|  41   |  936  |  56   | +1.0000e+00 | 6.05e+04 | 1.34e-07 | 8.02e-16 |
|  42   |  988  |  57   | +1.0000e+00 | 6.05e+03 | 1.34e-07 | 8.02e-16 |
|  43   | 1014  |  58   | +1.0000e+00 | 6.05e+02 | 1.34e-07 | 8.02e-16 |
|  44   | 1066  |  59   | +1.0000e+00 | 6.05e+01 | 1.34e-07 | 8.02e-16 |
|  45   | 1092  |  60   | +1.0000e+00 | 6.05e+00 | 1.34e-07 | 8.02e-16 |
|  46   | 1144  |  61   | +1.0000e+00 | 6.05e-01 | 1.34e-07 | 8.02e-16 |
|  47   | 1170  |  62   | +1.0000e+00 | 6.05e-02 | 1.34e-07 | 8.02e-16 |
|  48   | 1222  |  63   | +1.0000e+00 | 6.05e-03 | 1.34e-07 | 8.02e-16 |
|  49   | 1248  |  64   | +1.0000e+00 | 6.05e-04 | 1.34e-07 | 8.02e-16 |
|  50   | 1300  |  65   | +1.0000e+00 | 6.05e-05 | 1.34e-07 | 8.02e-16 |
|  51   | 1326  |  66   | +1.0000e+00 | 6.05e-06 | 1.34e-07 | 8.02e-16 |
|  52   | 1378  |  67   | +1.0000e+00 | 6.05e-07 | 1.34e-07 | 8.02e-16 |
|  53   | 1404  |  68   | +1.0000e+00 | 1.04e-07 | 1.34e-07 | 8.02e-16 |
|  54   | 1430  |  69   | +1.0000e+00 | 5.20e-08 | 1.34e-07 | 8.02e-16 |
|  55   | 1456  |  70   | +1.0000e+00 | 2.60e-08 | 1.34e-07 | 8.02e-16 |
|  56   | 1482  |  71   | +1.0000e+00 | 1.30e-08 | 1.34e-07 | 8.02e-16 |
|  57   | 1508  |  72   | +1.0000e+00 | 1.30e-08 | 1.42e-07 | 3.21e-16 |
|  58   | 1534  |  73   | +1.0000e+00 | 6.50e-09 | 1.42e-07 | 3.21e-16 |
|  59   | 1560  |  73   | +1.0000e+00 | 1.00e+00 | 1.42e-07 | 3.21e-16 |
|  60   | 1586  |  75   | +1.0000e+00 | 1.00e-01 | 1.42e-07 | 3.21e-16 |
|  61   | 1612  |  77   | +1.0000e+00 | 1.00e-02 | 1.42e-07 | 3.21e-16 |
|  62   | 1638  |  78   | +1.0000e+00 | 1.00e-03 | 1.42e-07 | 3.21e-16 |
|  63   | 1664  |  79   | +1.0000e+00 | 1.00e-04 | 1.42e-07 | 3.21e-16 |
|  64   | 1716  |  81   | +1.0000e+00 | 1.00e-05 | 1.42e-07 | 3.21e-16 |
|  65   | 1742  |  83   | +1.0000e+00 | 1.00e-06 | 1.42e-07 | 3.21e-16 |
|  66   | 1794  |  84   | +1.0000e+00 | 1.93e-07 | 1.42e-07 | 3.21e-16 |
|  67   | 1820  |  86   | +1.0000e+00 | 9.66e-08 | 1.42e-07 | 3.21e-16 |
|  68   | 1846  |  87   | +1.0000e+00 | 4.83e-08 | 1.42e-07 | 3.21e-16 |
|  69   | 1872  |  88   | +1.0000e+00 | 2.41e-08 | 1.42e-07 | 3.21e-16 |
|  70   | 1898  |  89   | +1.0000e+00 | 1.21e-08 | 1.42e-07 | 3.21e-16 |
|  71   | 1924  |  90   | +1.0000e+00 | 1.21e-08 | 1.34e-07 | 6.83e-17 |
|  72   | 1950  |  91   | +1.0000e+00 | 5.87e-09 | 1.34e-07 | 6.83e-17 |
|  73   | 1976  |  91   | +1.0000e+00 | 1.00e+00 | 1.34e-07 | 6.83e-17 |
|  74   | 2002  |  99   | +1.0000e+00 | 6.97e+00 | 1.02e-05 | 3.61e-17 |
______________________ test_cont_basic[500-200-ncf-arg74] ______________________
[gw1] linux -- Python 3.9.6 /opt/hostedtoolcache/Python/3.9.6/x64/bin/python
lib/python3.9/site-packages/scipy/stats/tests/test_continuous_basic.py:189: in test_cont_basic
    check_entropy(distfn, arg, distname)
        alpha      = 0.01
        arg        = (27, 27, 0.41578441799226107)
        distfn     = <scipy.stats._continuous_distns.ncf_gen object at 0x7f2a596f3370>
        distname   = 'ncf'
        locscale_defaults = (0, 1)
        m          = array(1.09663138)
        meths      = [<bound method rv_continuous.pdf of <scipy.stats._continuous_distns.ncf_gen object at 0x7f2a596f3370>>, <bound method ...f2a596f3370>>, <bound method rv_continuous.logsf of <scipy.stats._continuous_distns.ncf_gen object at 0x7f2a596f3370>>]
        n_fit_samples = 200
        rng        = RandomState(MT19937) at 0x7F2A3C3E7940
        rvs        = array([0.90888841, 0.87523216, 0.73228753, 1.33584017, 0.93548576,
       1.09504212, 1.15670442, 0.36786914, 0.791225...03, 1.73540023, 0.87035866, 0.73702581, 0.81477748,
       0.87362182, 1.58673099, 1.88455316, 0.61564337, 1.09912842])
        sm         = 1.0740685247899555
        sn         = 500
        spec_x     = {'levy_l': -0.5, 'pareto': 1.5, 'rv_histogram_instance': 5.0, 'tukeylambda': 0.3, ...}
        sv         = 0.1911827409537913
        v          = array(0.2013794)
        x          = 0.5
lib/python3.9/site-packages/scipy/stats/tests/common_tests.py:93: in check_entropy
    ent = distfn.entropy(*arg)
        arg        = (27, 27, 0.41578441799226107)
        distfn     = <scipy.stats._continuous_distns.ncf_gen object at 0x7f2a596f3370>
        msg        = 'ncf'
lib/python3.9/site-packages/scipy/stats/_distn_infrastructure.py:1254: in entropy
    place(output, cond0, self.vecentropy(*goodargs) + log(goodscale))
        args       = (array(27), array(27), array(0.41578442))
        cond0      = True
        goodargs   = [array([27]), array([27]), array([0.41578442])]
        goodscale  = array([1])
        kwds       = {}
        loc        = array(0)
        output     = array(0.)
        scale      = array(1)
        self       = <scipy.stats._continuous_distns.ncf_gen object at 0x7f2a596f3370>
/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/numpy/lib/function_base.py:2163: in __call__
    return self._vectorize_call(func=func, args=vargs)
        args       = (array([27]), array([27]), array([0.41578442]))
        excluded   = set()
        func       = <bound method rv_continuous._entropy of <scipy.stats._continuous_distns.ncf_gen object at 0x7f2a596f3370>>
        kwargs     = {}
        self       = <numpy.vectorize object at 0x7f2a59c6a850>
        vargs      = (array([27]), array([27]), array([0.41578442]))
/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/numpy/lib/function_base.py:2246: in _vectorize_call
    outputs = ufunc(*inputs)
        args       = (array([27]), array([27]), array([0.41578442]))
        func       = <bound method rv_continuous._entropy of <scipy.stats._continuous_distns.ncf_gen object at 0x7f2a596f3370>>
        inputs     = [array([27], dtype=object), array([27], dtype=object), array([0.41578441799226107], dtype=object)]
        otypes     = 'd'
        self       = <numpy.vectorize object at 0x7f2a59c6a850>
        ufunc      = <ufunc '_entropy (vectorized)'>
lib/python3.9/site-packages/scipy/stats/_distn_infrastructure.py:2621: in _entropy
    h = integrate.quad(integ, _a, _b)[0]
        _a         = 0.0
        _b         = inf
        args       = (27, 27, 0.41578441799226107)
        integ      = <function rv_continuous._entropy.<locals>.integ at 0x7f2a30fe8700>
        self       = <scipy.stats._continuous_distns.ncf_gen object at 0x7f2a596f3370>
lib/python3.9/site-packages/scipy/integrate/quadpack.py:400: in quad
    warnings.warn(msg, IntegrationWarning, stacklevel=2)
E   scipy.integrate.quadpack.IntegrationWarning: The occurrence of roundoff error is detected, which prevents 
E     the requested tolerance from being achieved.  The error may be 
E     underestimated.
        a          = 0.0
        args       = ()
        b          = inf
        epsabs     = 1.49e-08
        epsrel     = 1.49e-08
        flip       = False
        full_output = 0
        func       = <function rv_continuous._entropy.<locals>.integ at 0x7f2a30fe8700>
        ier        = 2
        limit      = 50
        limlst     = 50
        maxp1      = 50
        msg        = 'The occurrence of roundoff error is detected, which prevents \n  the requested tolerance from being achieved.  The error may be \n  underestimated.'
        msgs       = {80: 'A Python error occurred possibly while calling the function.', 1: 'The maximum number of subdivisions (50) has b...\n  underestimated.', 3: 'Extremely bad integrand behavior occurs at some points of the\n  integration interval.', ...}
        points     = None
        retval     = (nan, nan, 2)
        weight     = None
        wopts      = None
        wvar       = None
=========================== short test summary info ============================
FAILED lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py::test_odeint_banded_jac
FAILED lib/python3.9/site-packages/scipy/integrate/tests/test_odeint_jac.py::test_odeint_full_jac
FAILED lib/python3.9/site-packages/scipy/optimize/_trustregion_constr/tests/test_report.py::test_gh12922
FAILED lib/python3.9/site-packages/scipy/stats/tests/test_continuous_basic.py::test_cont_basic[500-200-ncf-arg74]
= 4 failed, 32588 passed, 2086 skipped, 107 xfailed, 8 xpassed in 350.96s (0:05:50) =
~/work/scipy/scipy

I'm seeing three of those locally, as mentioned in the description of #39. @czgdp1807 is seeing none of them.

@Smit-create could you try this as well? Install Meson from https://github.com/rgommers/meson/tree/fix-cython-mixed-sources, and then build and run the tests on the meson branch in this fork. It should run ~35,000 tests.

Windows Meson build broken in CI

Windows CI now builds (after removing the -j 128 which caused out of memory issues during build), but is broken. From https://github.com/rgommers/scipy/runs/4850001376?check_suite_focus=true:

============================= test session starts =============================
platform win32 -- Python 3.9.9, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: D:\a\scipy\scipy, configfile: pytest.ini
plugins: cov-3.0.0
collected 10268 items / 189 errors / 62 deselected / 10017 selected

=================================== ERRORS ====================================
_ ERROR collecting build/Lib/site-packages/scipy/cluster/tests/test_disjoint_set.py _
ImportError while importing test module 'D:\a\scipy\scipy\build\Lib\site-packages\scipy\cluster\tests\test_disjoint_set.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
..\build\Lib\site-packages\scipy\cluster\__init__.py:25: in <module>
    from . import vq, hierarchy
..\build\Lib\site-packages\scipy\cluster\vq.py:72: in <module>
    from scipy.spatial.distance import cdist
..\build\Lib\site-packages\scipy\spatial\__init__.py:108: in <module>
    from ._geometric_slerp import geometric_slerp
..\build\Lib\site-packages\scipy\spatial\_geometric_slerp.py:9: in <module>
    from scipy.spatial.distance import euclidean
..\build\Lib\site-packages\scipy\spatial\distance.py:123: in <module>
    from ..special import rel_entr
..\build\Lib\site-packages\scipy\special\__init__.py:649: in <module>
    from . import _ufuncs
E   ImportError: DLL load failed while importing _ufuncs: %1 is not a valid Win32 application.

The warnings for building _ufuncs are:

2022-01-18T07:41:08.3307183Z C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:185:20: warning: '_fseeki64' redeclared without dllimport attribute after being referenced with dll linkage
2022-01-18T07:41:08.3307875Z   185 | extern int __cdecl _fseeki64(FILE *, long long, int);
2022-01-18T07:41:08.3308231Z       |                    ^~~~~~~~~
2022-01-18T07:41:08.3308827Z C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:186:26: warning: '_ftelli64' redeclared without dllimport attribute after being referenced with dll linkage
2022-01-18T07:41:08.3309489Z   186 | extern long long __cdecl _ftelli64(FILE *);
2022-01-18T07:41:08.3309796Z       |                          ^~~~~~~~~

2022-01-18T07:41:08.3317897Z C:/hostedtoolcache/windows/Python/3.9.9/x64/lib/site-packages/numpy/f2py/src/fortranobject.c: In function 'fortran_doc':
2022-01-18T07:41:08.3318590Z C:/hostedtoolcache/windows/Python/3.9.9/x64/lib/site-packages/numpy/f2py/src/fortranobject.c:322:52: warning: unknown conversion type character 'z' in format [-Wformat=]
2022-01-18T07:41:08.3319202Z   322 |             "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"
2022-01-18T07:41:08.3319597Z       |                                                    ^
2022-01-18T07:41:08.3320823Z C:/hostedtoolcache/windows/Python/3.9.9/x64/lib/site-packages/numpy/f2py/src/fortranobject.c:322:56: warning: unknown conversion type character 'z' in format [-Wformat=]
2022-01-18T07:41:08.3321469Z   322 |             "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"
2022-01-18T07:41:08.3321816Z       |                                                        ^
2022-01-18T07:41:08.3322395Z C:/hostedtoolcache/windows/Python/3.9.9/x64/lib/site-packages/numpy/f2py/src/fortranobject.c:322:13: warning: too many arguments for format [-Wformat-extra-args]
2022-01-18T07:41:08.3323004Z   322 |             "fortranobject.c: fortran_doc: len(p)=%zd>%zd=size:"

Note that CI status is green, but only because the test stage does not set an exit code correctly apparently.

Investigate if the build time of the `sparsetools` extension can be improved

#20 (comment) shows that the two slowest files to build are sparse/bsr.cxx (~90 sec) and sparse/csr.cxx (~70 sec). bsr.cxx includes the csr routines, so it's basically building the same thing twice. It should be investigated if this can be improved.

We are interested in two things:

  • Single file build time (this is the limiting factor when building on a machine with many cores)
  • Total build time (this is limiting on a machine with an underpowered CPU)

If one of those can be improved without deteriorating the other much, that would be really helpful.

Maybe the source code can be restructured. Another option could be to use a unity build; Meson supports that out of the box (https://mesonbuild.com/Unity-builds.html) - but of course then things in different files must not have the same name.

Also see for getting more fine-grained timing profiles:

Also would be good to determine build times of:

  • using different build flags (-O0 ... -O3, with/without -g)
  • gcc vs clang

CI status does not turn red when test suite fails

See https://github.com/rgommers/scipy/runs/3125263304?check_suite_focus=true. The test suite had four failures, but the CI status is green on that job. We're missing some toggle somewhere. In SciPy's CI we use python runtests.py ... which I think sets exist status on failure. In the CI job on this fork (in .github/workflow/linux.yml we're running python -c "import scipy; scipy.test()" instead - that needs a tweak to ensure GH Actions knows to turn red if a test fails.

Build warnings in the Windows Meson build we should fix

@Smit-create here are all the relevant build warnings from today's Windows build against numpy 1.21.5. Could you look into these?

[325/1557] Compiling C object scipy/sparse/linalg/_dsolve/libsuperlu_lib.a.p/SuperLU_SRC_cmemory.c.obj
../scipy/sparse/linalg/_dsolve/SuperLU/SRC/cmemory.c: In function 'cStackCompress':
../scipy/sparse/linalg/_dsolve/SuperLU/SRC/cmemory.c:649:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  649 |     Glu->stack.used -= (long int) fragment;
      |                        ^
../scipy/sparse/linalg/_dsolve/SuperLU/SRC/cmemory.c:650:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  650 |     Glu->stack.top1 -= (long int) fragment;
      |                        ^

The above one also happens in dStackCompress and the s/z variants.

[357/1557] Compiling C++ object scipy/special/_ufuncs_cxx.cp39-win_amd64.pyd.p/meson-generated__ufuncs_cxx.cpp.obj
scipy/special/_ufuncs_cxx.cp39-win_amd64.pyd.p/_ufuncs_cxx.cpp:659: warning: "_USE_MATH_DEFINES" redefined
  659 |   #define _USE_MATH_DEFINES
      | 
<command-line>: note: this is the location of the previous definition
In file included from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_math.h:8,
                 from ..\scipy\special/_complexstuff.h:5,
                 from scipy/special/_ufuncs_cxx.cp39-win_amd64.pyd.p/_ufuncs_cxx.cpp:694:
[516/1557] Compiling C object scipy/stats/_unuran/unuran_wrapper.cp39-win_amd64.pyd.p/.._..__lib_unuran_unuran_src_methods_mvtdr.c.obj
In file included from ../scipy/_lib/unuran/unuran/src/methods/mvtdr.c:330:
In function '_unur_mvtdr_etable_new',
    inlined from '_unur_mvtdr_triangulate' at ../scipy/_lib/unuran/unuran/src/methods/mvtdr_init.h:978:11:
../scipy/_lib/unuran/unuran/src/methods/mvtdr_init.h:1760:17: warning: argument 1 value '18446744073709551608' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
 1760 |   GEN->etable = malloc( size * sizeof(E_TABLE*) );
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ..\scipy\_lib\unuran\unuran\src/unur_source.h:71,
                 from ../scipy/_lib/unuran/unuran/src/methods/mvtdr.c:50:
../scipy/_lib/unuran/unuran/src/methods/mvtdr_init.h: In function '_unur_mvtdr_triangulate':
c:/rtools40/ucrt64/x86_64-w64-mingw32/include/stdlib.h:531:17: note: in a call to allocation function 'malloc' declared here
  531 |   void *__cdecl malloc(size_t _Size);
      |                 ^~~~~~
[564/1557] Compiling C object scipy/special/cython_special.cp39-win_amd64.pyd.p/meson-generated_cython_special.c.obj
scipy/special/cython_special.cp39-win_amd64.pyd.p/cython_special.c:645: warning: "_USE_MATH_DEFINES" redefined
  645 |   #define _USE_MATH_DEFINES
      | 
<command-line>: note: this is the location of the previous definition
In file included from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:4,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:12,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
                 from scipy/special/cython_special.cp39-win_amd64.pyd.p/cython_special.c:681:
scipy/signal/_upfirdn_apply.cp39-win_amd64.pyd.p/_upfirdn_apply.c: In function '__pyx_fuse_1__pyx_pw_5scipy_6signal_14_upfirdn_apply_21_apply':
scipy/signal/_upfirdn_apply.cp39-win_amd64.pyd.p/_upfirdn_apply.c:14631:14: warning: '__pyx_v_row_size_bytes' may be used uninitialized in this function [-Wmaybe-uninitialized]
14631 |       (void)(memset(__pyx_v_output_row, 0, __pyx_v_row_size_bytes));
      |             ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scipy/signal/_upfirdn_apply.cp39-win_amd64.pyd.p/_upfirdn_apply.c:14056:10: note: '__pyx_v_row_size_bytes' was declared here
14056 |   size_t __pyx_v_row_size_bytes;
      |          ^~~~~~~~~~~~~~~~~~~~~~

Many warnings like:

[936/1557] Compiling Fortran object scipy/sparse/linalg/_eigen/arpack/libarpack_lib.a.p/ARPACK_SRC_sgetv0.f.obj
../scipy/sparse/linalg/_eigen/arpack/ARPACK/SRC/sgetv0.f:404:32:

  367 |           call svout (logfil, 1, rnorm0, ndigit,
      |                                 2
......
  404 |          call svout (logfil, n, resid, ndigit,
      |                                1
Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)

These rank mismatch warnings should be silenced by using -fallow-argument-mismatch, see the TODO comment in the top-level meson.build.

Also recording this one, but needs someone who speaks Fortran:

[999/1557] Compiling Fortran object scipy/stats/_mvn.cp39-win_amd64.pyd.p/mvndst.f.obj
../scipy/stats/mvndst.f:233:39:

  233 |       DOUBLE PRECISION COV(NL*(NL+1)/2), A(NL), B(NL), Y(NL)
      |                                       1
Warning: Array 'cov' at (1) is larger than limit set by '-fmax-stack-var-size=', moved from stack to static storage. This makes the procedure unsafe when called recursively, or concurrently from multiple threads. Consider using '-frecursive', or increase the '-fmax-stack-var-size=' limit, or change the code to use an ALLOCATABLE array. [-Wsurprising]

Not sure what the deal is with this one:

[1025/1557] Linking target scipy/stats/_biasedurn.cp39-win_amd64.pyd
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
../scipy/odr/__odrpack.c: In function 'odr':
../scipy/odr/__odrpack.c:1121:21: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'npy_intp' {aka 'long long int'} [-Wformat=]
 1121 |           printf("%ld %lld\n", PyArray_DIMS(work)[0], (long long)lwork);
      |                   ~~^          ~~~~~~~~~~~~~~~~~~~~~
      |                     |                            |
      |                     long int                     npy_intp {aka long long int}
      |                   %lld
../scipy/odr/__odrpack.c:1121:21: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'npy_intp' {aka 'long long int'} [-Wformat=]
 1121 |           printf("%ld %lld\n", PyArray_DIMS(work)[0], (long long)lwork);
      |                   ~~^          ~~~~~~~~~~~~~~~~~~~~~
      |                     |                            |
      |                     long int                     npy_intp {aka long long int}
      |                   %lld

Let's prioritize this one, since currently linprog (which uses HiGHS) is segfaulting:

[1474/1557] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_mip_HighsImplications.cpp.obj
../scipy/_lib/highs/src/mip/HighsImplications.cpp: In member function 'bool HighsImplications::runProbing(HighsInt, HighsInt&)':
../scipy/_lib/highs/src/mip/HighsImplications.cpp:167:46: warning: 'implicsdown' may be used uninitialized in this function [-Wmaybe-uninitialized]
  167 |       if (implicsup[u].column < implicsdown[d].column)
      |  

Write CI script to verify Meson installed all relevant test files

#68 (review) showed an issue where the .py file with tests for a new feature was not included in a meson.build file and hence not installed. If that happens, CI will not fail, so it'd be good to have another CI test script that explicitly checks that all tests/test_*.py files (minus some whitelist of files) end up in the install dir. We don't need to check non-test or data files, because if those are missing then tests will fail.

This should be a script that can be run standalone, and invoked at the end of a single CI job. It can be put under tools/, ala https://github.com/scipy/scipy/blob/master/tools/refguide_check.py

Using ninjatracing to profile build performance

This is quite a nice tool: https://github.com/nico/ninjatracing/blob/master/ninjatracing. It's Apache 2 licensed, so we cannot just vendor it. But usage is quite easy. Simply save that file as ninjatracing.py and run:

python tools/ninjatracing.py build/.ninja_log > trace.json

Then load trace.json in https://ui.perfetto.dev (or in Chrome) to obtain:

image

This allows exploring build performance. Also, shows the joys of building templated C++ (pypocketfft) and generated code. pypocketfft takes about 39 seconds, so that's a lower bound on the eventual SciPy build time we can expect.

It also shows what is wrong with rebuilds. Running ninja -C build twice in a row, the second time should be a no-op that completes in well under a second, however Cython code gets regenerated and rebuilt. I need to file a bug about this on the Meson issue tracker.

FYI @czgdp1807 (no urgent need for this, it was on my list to try for a little while and it's fun).

Update Meson build files for C++ Cython support

Please describe your issue.

mesonbuild/meson#9017 added support in Meson master to target C++ when using add_extension('somefile.pyx'). This is much nicer than using custom_target for the .pyx to .cpp step, so we should update all build files where this is current done to use the new functionality.

Verify/update style of `meson.build` files

There are some inconsistencies in coding style in the meson.build files. We want to conform to https://mesonbuild.com/Style-guide.html here, and have everything in a consistent and best-practice way. E.g.:

  • 2 spaces (not 4) indents everywhere
  • source paths sorted alphabetically, as in https://mesonbuild.com/Style-guide.html#sorting-source-paths
  • Should there be a space before : in arguments? This is inconsistent in Meson itself, so let's go with PEP 8 style (name: arg).
  • Closing brackets on separate lines.

For the last one, like this:

py3.install_sources('name',   # applies to other calls too, like `extension_module()`
  pure: false,
  install: true
)  # <-- this one, separate line, same indent as the top line it closes

It'd be great to fix this all up now, before we merge things into SciPy master.

@Smit-create could you do this?

Windows build for Meson broken in CI

I've seen this a bunch of times now (e.g., in https://github.com/rgommers/scipy/runs/4842673552?check_suite_focus=true):

 [1511/1557] Compiling C++ object scipy/interpolate/_rbfinterp_pythran.cp39-win_amd64.pyd.p/meson-generated_..__rbfinterp_pythran.cpp.obj
In file included from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:4,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:12,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/arrayobject.h:5,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\pythran/pythonic/python/core.hpp:19,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\pythran/pythonic/include/types/int.hpp:19,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\pythran/pythonic/types/int.hpp:5,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\pythran/pythonic/core.hpp:34,
                 from scipy/interpolate/_rbfinterp_pythran.cpp:1:
C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:185:20: warning: 'int _fseeki64(FILE*, long long int, int)' redeclared without dllimport attribute after being referenced with dll linkage
  185 | extern int __cdecl _fseeki64(FILE *, long long, int);
      |                    ^~~~~~~~~
C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:186:26: warning: 'long long int _ftelli64(FILE*)' redeclared without dllimport attribute after being referenced with dll linkage
  186 | extern long long __cdecl _ftelli64(FILE *);
      |                          ^~~~~~~~~

The code from npy_common.h (here):

/* mingw based on 3.4.5 has lseek but not ftell/fseek */
#if defined(__MINGW32__) || defined(__MINGW64__)
extern int __cdecl _fseeki64(FILE *, long long, int);
extern long long __cdecl _ftelli64(FILE *);
#endif

Pythran just has ftell (here) and nothing else.

This seems to be an incompatibility between numpy and mingw-w64 with the long double modifications. Cc @matthew-brett, @carlkl.

Issues with prefix/destdir and "Broken python installation detected" warnings

Describe your issue.

Am trying to build the tip of the master branch with meson in a virtualenv on ubuntu focal. The setup works fine for the scipy master with setup.py / runtests.py / pip, but with meson fails with a nonsensical cannot find <complex> hearder in scipy.special.

Here's a full set of steps:

# shallow clone the rgommers/scipy fork:

$ git log
commit 683a74a3a4cd507eaba5c7e92b6ef4d81f2cc178 (grafted, HEAD -> meson, origin/meson, origin/HEAD)
Author: Smit Lunagariya <[email protected]>
Date:   Sat Oct 9 16:17:01 2021 +0530

    CI: Fix and Check installation of test files (#81)

### Patch up to use system blas/lapack (should not matter)

$ git diff
diff --git a/scipy/meson.build b/scipy/meson.build
index 6d4931e..aaf8f6c 100644
--- a/scipy/meson.build
+++ b/scipy/meson.build
@@ -72,8 +72,8 @@ numpy_nodepr_api = '-DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION'
 
 
 # TODO: 64-bit BLAS and LAPACK
-blas = dependency('openblas')
-lapack = dependency('openblas')
+blas = dependency('blas')
+lapack = dependency('lapack')
 
 # TODO: deal with case where we do need the g77 ABI wrappers (see
 #       _build_utils/_fortran.py)
diff --git a/scipy/odr/meson.build b/scipy/odr/meson.build
index 5c544fa..031539a 100644
--- a/scipy/odr/meson.build
+++ b/scipy/odr/meson.build
@@ -16,7 +16,7 @@ odrpack = static_library('odrpack',
 # conda: pkgconfig.variables('openblas')
 # https://github.com/mesonbuild/meson/issues/2835
 # TODO: 64-bit BLAS
-blas = dependency('openblas')
+blas = dependency('blas')
 
 py3.extension_module('__odrpack',
   '__odrpack.c',

# make a fresh virtualenv

br@gonzales:~/sweethome/temp/meson_scipy/scipy$ mkvirtualenv scipy_meson                       
created virtual environment CPython3.8.10.final.0-64 in 94ms
  creator CPython3Posix(dest=/home/br/.virtualenvs/scipy_meson, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/br/.local/share/virtualenv)
    added seed packages: pip==21.2.4, setuptools==58.0.4, wheel==0.37.0
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
virtualenvwrapper.user_scripts creating /home/br/.virtualenvs/scipy_meson/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/br/.virtualenvs/scipy_meson/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/br/.virtualenvs/scipy_meson/bin/preactivate
virtualenvwrapper.user_scripts creating /home/br/.virtualenvs/scipy_meson/bin/postactivate
virtualenvwrapper.user_scripts creating /home/br/.virtualenvs/scipy_meson/bin/get_env_details
(scipy_meson) br@gonzales:~/sweethome/temp/meson_scipy/scipy$ pip install --upgrade pip
Requirement already satisfied: pip in /home/br/.virtualenvs/scipy_meson/lib/python3.8/site-packages (21.2.4)
(scipy_meson) br@gonzales:~/sweethome/temp/meson_scipy/scipy$ pip install numpy cython pythran
Collecting numpy
  Using cached numpy-1.21.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.8 MB)
Collecting cython
  Using cached Cython-0.29.24-cp38-cp38-manylinux1_x86_64.whl (1.9 MB)
Collecting pythran
  Using cached pythran-0.10.0-py3-none-any.whl (4.3 MB)
Collecting ply>=3.4
  Using cached ply-3.11-py2.py3-none-any.whl (49 kB)
Collecting beniget~=0.4.0
  Using cached beniget-0.4.1-py3-none-any.whl (9.4 kB)
Collecting gast~=0.5.0
  Using cached gast-0.5.2-py3-none-any.whl (10 kB)
Installing collected packages: gast, ply, numpy, beniget, pythran, cython
Successfully installed beniget-0.4.1 cython-0.29.24 gast-0.5.2 numpy-1.21.2 ply-3.11 pythran-0.10.0
(scipy_meson) br@gonzales:~/sweethome/temp/meson_scipy/scipy$ pip install meson ninja
Collecting meson
  Using cached meson-0.59.2-py3-none-any.whl
Collecting ninja
  Using cached ninja-1.10.2.2-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (108 kB)
Installing collected packages: ninja, meson
Successfully installed meson-0.59.2 ninja-1.10.2.2
(scipy_meson) br@gonzales:~/sweethome/temp/meson_scipy/scipy$ pip install pybind11

#### All deps are there, start building

(scipy_meson) br@gonzales:~/sweethome/temp/meson_scipy/scipy$ rm -rf installdir
(scipy_meson) br@gonzales:~/sweethome/temp/meson_scipy/scipy$ rm -rf builddir
(scipy_meson) br@gonzales:~/sweethome/temp/meson_scipy/scipy$ meson setup builddir --prefix=$PWD/installdir
The Meson build system
Version: 0.59.2
Source dir: /home/br/sweethome/temp/meson_scipy/scipy
Build dir: /home/br/sweethome/temp/meson_scipy/scipy/builddir
Build type: native build
Project name: SciPy
Project version: 1.7.0.dev0+ababababab
C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
C linker for the host machine: cc ld.bfd 2.34
C++ compiler for the host machine: c++ (gcc 9.3.0 "c++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Cython compiler for the host machine: cython (cython 0.29.24)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Fortran compiler for the host machine: gfortran (gcc 9.3.0 "GNU Fortran (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0")
Fortran linker for the host machine: gfortran ld.bfd 2.34
Program cython found: YES (/home/br/.virtualenvs/scipy_meson/bin/cython)
Program pythran found: YES (/home/br/.virtualenvs/scipy_meson/bin/pythran)
Program python3 found: YES (/home/br/.virtualenvs/scipy_meson/bin/python)
WARNING: Broken python installation detected. Python files installed by Meson might not be found by python interpreter.
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Dependency python found: YES (pkgconfig)
Library npymath found: YES
Library npyrandom found: YES
Run-time dependency blas found: YES 3.9.0
Run-time dependency lapack found: YES 3.9.0
Program cp found: YES (/usr/bin/cp)
Program cp found: YES (/usr/bin/cp)
Checking for function "open_memstream" : NO 
Configuring messagestream_config.h using configuration
Compiler for C++ supports arguments -fvisibility=hidden: YES 
Program cp found: YES (/usr/bin/cp)
Program cp found: YES (/usr/bin/cp)
Program cp found: YES (/usr/bin/cp)
Checking for size of "void*" : 8
Program cp found: YES (/usr/bin/cp)
Run-time dependency threads found: YES
Checking for size of "void*" : 8
Dependency threads found: YES unknown (cached)
Program cp found: YES (/usr/bin/cp)
Compiler for C++ supports arguments -fvisibility=hidden: YES (cached)
Dependency blas found: YES 3.9.0 (cached)
Program cp found: YES (/usr/bin/cp)
Program cp found: YES (/usr/bin/cp)
Build targets in project: 199

Found ninja-1.10.2.git.kitware.jobserver-1 at /home/br/.virtualenvs/scipy_meson/bin/ninja

$ meson install -C builddir
ninja: Entering directory `/home/br/sweethome/temp/meson_scipy/scipy/builddir'
[218/1492] Compiling C object scipy/special/_ufuncs_cxx.cpython-38-...64-linux-gnu.so.p/meson-generated_scipy_special__ufuncs_cxx.pyx.c.o
FAILED: scipy/special/_ufuncs_cxx.cpython-38-x86_64-linux-gnu.so.p/meson-generated_scipy_special__ufuncs_cxx.pyx.c.o 
cc -Iscipy/special/_ufuncs_cxx.cpython-38-x86_64-linux-gnu.so.p -Iscipy/special -I../scipy/special -I/home/br/.virtualenvs/scipy_meson/lib/python3.8/site-packages/numpy/core/include -Iscipy/_lib -I../scipy/_lib -I../scipy/_build_utils/src -Iscipy -I/usr/include/python3.8 -I/usr/include/x86_64-linux-gnu/python3.8 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w -std=c99 -O2 -g -Wno-unused-function -Wno-conversion -Wno-unused-but-set-variable -Wno-misleading-indentation -Wno-incompatible-pointer-types -fPIC -MD -MQ scipy/special/_ufuncs_cxx.cpython-38-x86_64-linux-gnu.so.p/meson-generated_scipy_special__ufuncs_cxx.pyx.c.o -MF scipy/special/_ufuncs_cxx.cpython-38-x86_64-linux-gnu.so.p/meson-generated_scipy_special__ufuncs_cxx.pyx.c.o.d -o scipy/special/_ufuncs_cxx.cpython-38-x86_64-linux-gnu.so.p/meson-generated_scipy_special__ufuncs_cxx.pyx.c.o -c scipy/special/_ufuncs_cxx.cpython-38-x86_64-linux-gnu.so.p/scipy/special/_ufuncs_cxx.pyx.c
In file included from /home/br/sweethome/temp/meson_scipy/scipy/builddir/scipy/special/_ufuncs_cxx_defs.h:3,
                 from scipy/special/_ufuncs_cxx.cpython-38-x86_64-linux-gnu.so.p/scipy/special/_ufuncs_cxx.pyx.c:631:
../scipy/special/_faddeeva.h:12:10: fatal error: complex: No such file or directory
   12 | #include <complex>
      |          ^~~~~~~~~
compilation terminated.
[227/1492] Compiling Fortran object scipy/special/libspecfun.a.p/specfun_specfun.f.o
ninja: build stopped: subcommand failed.
Could not rebuild /home/br/sweethome/temp/meson_scipy/scipy/builddir

(scipy_meson) br@gonzales:~/sweethome/temp/meson_scipy/scipy$ ls scipy/special/_fa*
scipy/special/_factorial.pxd  scipy/special/_faddeeva.cxx  scipy/special/_faddeeva.h

Reproducing Code Example

.

Error message

.

SciPy/NumPy/Python version information

.

ENH: Developing a dedicated compiler toolchain for windows scipy-meson builds

Is your feature request related to a problem? Please describe.

rtools (chocolatey) is currently being used for CI windows scipy-meson builds. However, rtools is behind the msys2 ucrt64 gcc toolchain in terms of features and patches. The recent ucrt64 msys2 gcc toolchain contains more complete setting of patches targeting all kind of different issues. On the other hand all msys2/mingw-w64 packages are know as 'rolling release' packages. Reproducible builds are therefore difficult to achieve.

Describe the solution you'd like.

Developing and maintaining a win64 toolchain based on patches and build scripts of the https://github.com/msys2/MINGW-packages/ repository targeting the needs of a GCC based windows compiler toolchain with the greatest possible compatibility to MSVC. A fork of the UCRT64 compiler toolchain enables further changes/patches that appear necessary to be applied directly without waiting to be accepted upstream.

Another aspect is 32-bit support: it is possibility to develop a win32 (32-bit) toolchain with UCRT runtime support. A toolchain of this kind with Fortran support is not available yet: https://www.msys2.org/docs/environments/ from Msys2. See also this poll: scipy#16286

Describe alternatives you've considered.

leave the things as they are.

Additional context (e.g. screenshots, GIFs)

No response

Tracking issue for Meson support of submodules

Here is a list to keep track of where we are with adding Meson support. An "x" means "has a meson.build file that's mostly complete; some TODO or FIXME items may be left").

  • _lib
  • cluster
  • constants
  • fft
  • fftpack
  • integrate
  • interpolate
  • io
  • linalg
  • misc
  • ndimage
  • odr
  • optimize
  • signal
  • sparse
  • sparse.linalg
  • sparse.csgraph
  • spatial
  • special
  • stats

When picking up a new module, let's comment here to avoid double work.

Other topics worth tracking separately:

  • A GitHub Actions CI job to test Linux dev builds
  • Cython+Meson improvements needed:
    • Allowing specifying extension names as input to the cython CLI to properly support generated Cython code (#31) UPDATE: fixed by splitting out build rules; we'd still like to get mesonbuild/meson#8961 fixed so we can simplify our meson.build files.
    • Add depfile support to have correct dependency tracking for .pxi/.pxd files (mesonbuild/meson#9049) - UPDATE: done in Cython master, backported to 0.29.x and released in 0.29.27, needs support in Meson
  • Deal with cython --cplus correctly (see gh-25)
  • Extensions that depend on linalg.pxd (e.g. in cluster/ and optimize/_lsq/)
  • A dev.py interface similar to runtests.py
  • Support for MKL and other BLAS/LAPACK libraries in Meson
  • ILP64 support
  • macOS support
  • macOS CI job (@HarshCasper)
  • Windows support (@matthew-brett)
  • building wheels (see scipy#15476)
  • handle virtualenvs incl. Debian/Ubuntu correctly (gh-82)
  • fix Meson configure warnings (mesonbuild/meson#9837)
  • cross-compiling (e.g. to aarch64)
  • documentation:
    • regular usage
    • debugging build issues
    • special topics (using ccache, multiple builds in a tree, debug build, ASAN build, coverage, changing build flags, etc.)
  • (not a blocker, but nice to have for other libraries) mesonbuild/meson#9598

BUG: Tests fail after regenerating cython lapack signatures with LAPACK 3.7.1

Describe your issue.

After successfully rebuilding scipy with scipy#18247 merged, the tests fail cause a symbol can't be found in the cython lapack dynamic library object. I'm attaching the full error below.

Here's my system's configuration
>>> import scipy;scipy.show_config()
/Users/lysnikolaou/repos/python/scipy/build-install/lib/python3.10/site-packages/scipy/__config__.py:140: UserWarning: Install `pyyaml` for better output
  warnings.warn("Install `pyyaml` for better output", stacklevel=1)
{
  "Compilers": {
    "c": {
      "name": "clang",
      "linker": "ld64",
      "version": "14.0.6",
      "commands": "x86_64-apple-darwin13.4.0-clang"
    },
    "cython": {
      "name": "cython",
      "linker": "cython",
      "version": "0.29.33",
      "commands": "cython"
    },
    "c++": {
      "name": "clang",
      "linker": "ld64",
      "version": "14.0.6",
      "commands": "x86_64-apple-darwin13.4.0-clang++"
    },
    "fortran": {
      "name": "gcc",
      "linker": "ld64",
      "version": "11.3.0",
      "commands": "/Users/lysnikolaou/anaconda3/envs/scipy-dev/bin/x86_64-apple-darwin13.4.0-gfortran"
    },
    "pythran": {
      "version": "0.12.1",
      "include directory": "../../../../anaconda3/envs/scipy-dev/lib/python3.10/site-packages/pythran"
    }
  },
  "Machine Information": {
    "host": {
      "cpu": "x86_64",
      "family": "x86_64",
      "endian": "little",
      "system": "darwin"
    },
    "build": {
      "cpu": "x86_64",
      "family": "x86_64",
      "endian": "little",
      "system": "darwin"
    },
    "cross-compiled": false
  },
  "Build Dependencies": {
    "blas": {
      "name": "OpenBLAS",
      "found": true,
      "version": "0.3.21",
      "detection method": "cmake",
      "include directory": "unknown",
      "lib directory": "unknown",
      "openblas configuration": "unknown",
      "pc file directory": "unknown"
    },
    "lapack": {
      "name": "OpenBLAS",
      "found": true,
      "version": "0.3.21",
      "detection method": "cmake",
      "include directory": "unknown",
      "lib directory": "unknown",
      "openblas configuration": "unknown",
      "pc file directory": "unknown"
    }
  },
  "Python Information": {
    "path": "/Users/lysnikolaou/anaconda3/envs/scipy-dev/bin/python3.10",
    "version": "3.10"
  }
}

Reproducing Code Example

import scipy.linalg.blas

Error message

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/lysnikolaou/repos/python/scipy/build-install/lib/python3.10/site-packages/scipy/linalg/__init__.py", line 218, in <module>
    from ._matfuncs import *
  File "/Users/lysnikolaou/repos/python/scipy/build-install/lib/python3.10/site-packages/scipy/linalg/_matfuncs.py", line 19, in <module>
    from ._matfuncs_expm import pick_pade_structure, pade_UV_calc
  File "scipy/linalg/_matfuncs_expm.pyx", line 1, in init scipy.linalg._matfuncs_expm
ImportError: dlopen(/Users/lysnikolaou/repos/python/scipy/build-install/lib/python3.10/site-packages/scipy/linalg/cython_lapack.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_ssyconvf_'

SciPy/NumPy/Python version information

Scipy: 1.11.0.dev0+0.f8f18ef, Numpy: 1.24.2, Python 3.10.10

Windows Mingw build has warnings about threading not supported

These warnings seem to indicate a real issue:

[94/1557] Compiling C object scipy/linalg/_flapack.cp39-win_amd64.pyd.p/meson-generated_..__flapackmodule.c.obj
In file included from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:4,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:12,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
                 from C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\f2py\src/fortranobject.h:13,
                 from scipy/linalg/_flapackmodule.c:16:
scipy/linalg/_flapackmodule.c:1248:1: warning: 'thread' attribute directive ignored [-Wattributes]
 1248 | static F2PY_THREAD_LOCAL_DECL cb_cselect_in_gees__user__routines_t *_active_cb_cselect_in_gees__user__routines = NULL;
      | ^~~~~~
scipy/linalg/_flapackmodule.c:1410:1: warning: 'thread' attribute directive ignored [-Wattributes]
 1410 | static F2PY_THREAD_LOCAL_DECL cb_zselect_in_gees__user__routines_t *_active_cb_zselect_in_gees__user__routines = NULL;
      | ^~~~~~
scipy/linalg/_flapackmodule.c:1572:1: warning: 'thread' attribute directive ignored [-Wattributes]
 1572 | static F2PY_THREAD_LOCAL_DECL cb_sselect_in_gees__user__routines_t *_active_cb_sselect_in_gees__user__routines = NULL;
      | ^~~~~~
scipy/linalg/_flapackmodule.c:1738:1: warning: 'thread' attribute directive ignored [-Wattributes]
 1738 | static F2PY_THREAD_LOCAL_DECL cb_dselect_in_gees__user__routines_t *_active_cb_dselect_in_gees__user__routines = NULL;
      | ^~~~~~

...

There are 30 such warnings, in linalg/_interpolativemodule.c, linalg/_flapackmodule.c, linalg/_propack/_[c|s|d|z]propackmodule.c, integrate/_lsodamodule.c, integrate/_vodemodule.c, integrate/_dopmodule.c, and optimize/_cobylamodule.c.

Probably relevant links:

From the second link: "Because __declspec(thread) results in just a warning and not a compilation failure, the configure script thinks that __declspec(thread) is supported and happens to select it". If that's the case here too, we may have a problem.

The code generated by f2py looks like:

#ifndef F2PY_THREAD_LOCAL_DECL
#if defined(_MSC_VER) \
      || defined(_WIN32) || defined(_WIN64) \
      || defined(__MINGW32__) || defined(__MINGW64__)
#define F2PY_THREAD_LOCAL_DECL __declspec(thread)

So it explicitly deals with mingw-w64, but it looks like mingw-w64 doesn't recognize what f2py is doing here.

Cc @matthew-brett, @carlkl

Also Cc @pearu in case this rings a bell.

Prototype a better developer CLI for SciPy (& similar projects)

See scipy#15489

We'd like to create a first prototype with one task runner tool and one command-line interface tool, so we can more easily evaluate next steps and technology choices. I think the top candidates to use for that first prototype are:

These would be good to start looking into. The prototype doesn't have to be complete, we just need to have a representative set of tasks in the CLI. For example:

  1. a regular build + test task
  2. a doc build (which depends on a regular build)
  3. a couple of the release tasks (this will check "task grouping)
  4. benchmarks with asv-compare (depends on two builds)

Let me work these our a little more one by one.

A regular build + test task

For now our most complete interface is python dev.py. Let's start in a new file with doit/typer and wrap dev.py. So for building we need a task that runs

python dev.py --build-only

And for testing (say the cluster module) we need to run:

python dev.py --no-build -s cluster

The equivalent commands should probably be:

  • doit build
  • doit test -s cluster

And the test task will have a dependency on the build task.

A doc build

This is python dev.py --doc now, however this is a composite command already. So let's decompose that again into:

  1. build the current version of SciPy (doit build)
  2. build the docs (see the if args.doc logic (6 lines of code) in dev.py.

Note that this has a --parallel option. That is true for build and test as well. That'd be good to implement too (but can be left to the end).

Release tasks

I think here we want to test task grouping. So:

  • Create author list: doit release authors or doit release --authors
  • Create release notes: doit release notes or doit release --notes

The author list generation is done with:

python tools/authors.py

That script can be used unchanged (for now at least) , so this task is just a one-line wrapper around that script.

The release notes creation is now done with:

paver write_release_and_log

But we don't want to keep paver or pavement.py around, so let's move write_release_task contents (from pavement.py) directly into a doit task or in a standalone script under tools/ similar to tools/authors.py.

Benchmarks including comparisons

First we need a single benchmark run (doit bench task), for example:

python dev.py --bench -t integrate.SolveBVP

The -s and -t selection commands are the same as for test.

_Note that for the second step we need to update asv to build with Meson, so let's leave the --bench-compare step alone for now.

Prototype evaluation

At this point we'd like to look at the code (is it easy to implement everything, and express dependencies between tasks and grouping tasks), as well as the CLI (does it look nice, is the help text useful, etc.).

Cc @sayantikabanik @tupui.

Tackling some `sepfir2d` improvements

From scipy#14367 (comment):

There are a couple of issues (2 open, 2 closed) about sepfir2d, so it does get usage. Now that we've looked into this and found some of the problems, it makes sense to fix them. This could turn into a bit of a project though, so let's not try to do it all in this PR. @Smit-create I suggest the following:

  • This PR: incorporate the fix the outptr -> out in memmove (see review comment above), and then we'll merge this.
  • Follow-up PRs (all separately, or at least the templating one - to keep diffs readable):
    • deduplicating the four files (C_bspline_util.c, D_bspline_util.c, S_bspline_util.c, Z_bspline_util.c). This can be done with a Tempita template (see scipy/signal/correlate_nd.c.in for an example). At that point bspline_util.c also doesn't need to be a separate file, the one function in it can be included in the same templated C file.
    • add a test for strided input arrays, and handle strides correctly (@peterbell10's comment above)
    • add a test for scipygh-13643 and remove the __GNUC__ guards. I think this requires modernizing the code (__complex__ usage is odd, it's only done in a few signal functions)

This code is pretty arcane, it should be possible to squash quite a few bugs in it here.

EDIT: final thing could be to improve the algorithm to also handle even hrow, hcol, see scipygh-12691.

Next steps

Let's start with the easier topics here:

  • deduplicate the four files to get only a single file
  • remove the __GNUC__ guards. Instead of using __complex__ float, this could use numpy types like npy_cfloat.

tracking issue topics Smit

Hi @Smit-create, as we talked about on the weekend, let's keep a list of topics and ideas that would be interesting to work on.

  • #22 (misc, io, maybe there's more later)
  • #30
  • #33 (this may be a challenging one)
  • fixing build warnings in the SciPy code base that we temporarily silenced - bugs could be hiding here: #42
  • #32
  • Following up on the signal.sepfir2d issues: #43
  • meson: timestamp caching in CI trick. The build/ folder can be saved and reused for future PRs, but the timestamps must be manipulated in a smart way in order to get rebuilds for only the targets that were affected by a PR and commits since the last rebuild. I read a blog post about this that I cannot find right now. (no separate issue yet)
  • It would be interesting to learn how BLAS/LAPACK library affects performance on different CPUs, as well as the relative performance of BLAS libraries. There are blog posts about this, in particular for OpenBLAS and MKL on Intel and AMD CPUs. We're getting more interested in aarch64 too. And haven't seen much about arm64 (Mac M1) yet.
  • Similar to above, a little easier: how does build time and benchmark performance depend on optimization level (-O0 ... -O3, -g, etc.).
  • PROPACK support in Meson build files (finishing #62).
  • gh-69
  • gh-72
  • update the meson branch in this fork to be up-to-date with SciPy master (see gh-93)
  • add a dev.py interface for the Meson build: current idea is to import functions that don't need changes from runtests.py and reimplement build_project.
  • ensure stats.linalg tests are installed and passing (currently ~90 failures on master)
  • write a uarray backend for a small part of scipy.signal and create a Colab notebook which works with CuPy and https://docs.rapids.ai/api/cusignal/nightly/api.html#module-cusignal.filtering.resample
  • gh-120
  • Add a new section to the SciPy docs on Meson about development topics, covering building with different optimization levels (closes gh-58) and building with ASAN (closes gh-32).
  • Related to the above topic: write a new section on how to use several different builds in parallel: gcc, clang regular builds and a gcc debug build on Linux.
  • Make Meson work with gcov code coverage: scipy#15896
  • sdist and wheels support via meson-python

Failure on `cluster._vq` build with Meson

From https://github.com/rgommers/scipy/runs/3778235538?check_suite_focus=true, on macOS there's a failure looking like:

[92/1492] Generating scipy/cluster/_optimal_leaf_ordering with a custom command
[93/1492] Generating scipy/cluster/_vq with a custom command
FAILED: scipy/cluster/_vq.c 
/usr/local/miniconda/envs/scipy-dev/bin/cython -3 --fast-fail ../scipy/cluster/_vq.pyx -o scipy/cluster/_vq.c -I .

Error compiling Cython file:
------------------------------------------------------------
...
"""

cimport cython
import numpy as np
cimport numpy as np
from scipy.linalg.cython_blas cimport dgemm, sgemm
^
------------------------------------------------------------

/Users/runner/work/scipy/scipy/scipy/cluster/_vq.pyx:13:0: 'scipy/linalg/cython_blas.pxd' not found
[94/1492] Compiling C object scipy/cluster/_optimal_leaf_ordering.cpython-39-darwin.so.p/meson-generated_..__optimal_leaf_ordering.c.o
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]
1 warning generated.
ninja: build stopped: subcommand failed.

It's likely that there's a dependency issue here; it fails only very rarely but something must be wrong.

Try to build with ASAN and document how to get useful output

This isn't important now, I was just curious so documenting for later when we want to look into it more.

Building with ASAN is easy with Meson, in principle: https://mesonbuild.com/howtox.html#use-address-sanitizer

Python itself leaks badly, so you need a suppression file. Following what this blog does works: https://tobywf.com/2021/02/python-ext-asan/

Then you may see <unknown module> in the output, which makes it hard to tell where a memory leak is coming from. This workaround, pre-loading a fake dlclose, helps: google/sanitizers#89 (comment).

I spent about an hour and got it to work. The results seem to say that SciPy is not leaking any memory. But of course the whole test suite doesn't run yet, so this should be repeated later. Also, to verify the results are correct, we should

  1. introduce a memory leak somewhere and ensure it's detected,
  2. document exactly how to get this to work,
  3. and perhaps add a CI job using ASAN

BENCH: Benchmarks with meson optimization levels

Hi @rgommers,
I have written a CI script for benchmarking and uploading the results to GitHub Actions with meson optimization levels(#36). See: https://github.com/Smit-create/scipy/blob/for_run/.github/workflows/linux.yml

I am uploading results here too: https://drive.google.com/drive/folders/1x9sBoOGLKMf6VWV0jNj0_p6Jgm35HDAM?usp=sharing

I can see many failing/timeout tests in them: https://drive.google.com/file/d/1mpqNEdzy9eml8FFVNMf3v0r_EMv_NMJ-/view?usp=sharing

Should I open an issue in scipy about these tests?

BLD: Build failure with Clang on Linux

Describe your issue.

Using the following command to build with clang on Linux:

CC=clang-12 CXX=clang++-12 python dev.py --build-only --build-dir=build-clang

I get the following error:

[213/1564] Linking target scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so
FAILED: scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so 
clang++-12  -o scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so.p/meson-generated__ufuncs_cxx.cpp.o scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so.p/_faddeeva.cxx.o scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so.p/_wright.cxx.o scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so.p/ellint_carlson_wrap.cxx.o scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so.p/Faddeeva.cc.o scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so.p/sf_error.c.o scipy/special/_ufuncs_cxx.cpython-310-x86_64-linux-gnu.so.p/wright.cc.o -L/home/admin-pc/anaconda3/envs/scipy-dev/lib -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/admin-pc/anaconda3/envs/scipy-dev/lib -Wl,-rpath-link,/home/admin-pc/anaconda3/envs/scipy-dev/lib -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/admin-pc/anaconda3/envs/scipy-dev/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/admin-pc/anaconda3/envs/scipy-dev/include -Wl,--start-group /home/admin-pc/anaconda3/envs/scipy-dev/lib/python3.10/site-packages/numpy/core/include/../lib/libnpymath.a -Wl,--end-group
/usr/bin/ld: /home/admin-pc/anaconda3/envs/scipy-dev/lib/python3.10/site-packages/numpy/core/include/../lib/libnpymath.a(npy_math.o): unable to initialize decompress status for section .debug_info
/usr/bin/ld: /home/admin-pc/anaconda3/envs/scipy-dev/lib/python3.10/site-packages/numpy/core/include/../lib/libnpymath.a(npy_math.o): unable to initialize decompress status for section .debug_info
/home/admin-pc/anaconda3/envs/scipy-dev/lib/python3.10/site-packages/numpy/core/include/../lib/libnpymath.a: error adding symbols: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Meson logs:

The Meson build system
Version: 0.60.3
Source dir: /home/admin-pc/Smitlunagariya/scipy
Build dir: /home/admin-pc/Smitlunagariya/scipy/build-clang
Build type: native build
Project name: SciPy
Project version: 1.9.0.dev0
C compiler for the host machine: clang-12 (clang 12.0.0 "Ubuntu clang version 12.0.0-++20210319082646+4990141a4366-1~exp1~20210319193401.61")
C linker for the host machine: clang-12 ld.bfd 2.30
C++ compiler for the host machine: clang++-12 (clang 12.0.0 "Ubuntu clang version 12.0.0-++20210319082646+4990141a4366-1~exp1~20210319193401.61")
C++ linker for the host machine: clang++-12 ld.bfd 2.30
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wno-unused-but-set-variable: NO 
Library m found: YES
Fortran compiler for the host machine: /home/admin-pc/anaconda3/envs/scipy-dev/bin/x86_64-conda-linux-gnu-gfortran (gcc 9.4.0 "GNU Fortran (GCC) 9.4.0")
Fortran linker for the host machine: /home/admin-pc/anaconda3/envs/scipy-dev/bin/x86_64-conda-linux-gnu-gfortran ld.bfd 2.36.1
Program cython found: YES (/home/admin-pc/anaconda3/envs/scipy-dev/bin/cython)
Program pythran found: YES (/home/admin-pc/anaconda3/envs/scipy-dev/bin/pythran)
Program cp found: YES (/bin/cp)
Program python3 found: YES (/home/admin-pc/anaconda3/envs/scipy-dev/bin/python3.1)
WARNING: Broken python installation detected. Python files installed by Meson might not be found by python interpreter.
 This warning can be avoided by setting "python.platlibdir" option.
WARNING: Broken python installation detected. Python files installed by Meson might not be found by python interpreter.
 This warning can be avoided by setting "python.purelibdir" option.
Found pkg-config: /home/admin-pc/anaconda3/envs/scipy-dev/bin/pkg-config (0.29.2)
Library npymath found: YES
Library npyrandom found: YES
Run-time dependency openblas found: YES 0.3.18
Dependency openblas found: YES 0.3.18 (cached)
Program _build_utils/cythoner.py found: YES (/home/admin-pc/anaconda3/envs/scipy-dev/bin/python3.1 /home/admin-pc/Smitlunagariya/scipy/scipy/_build_utils/cythoner.py)
Checking for function "open_memstream" : NO 
Configuring messagestream_config.h using configuration
Compiler for C++ supports arguments -fvisibility=hidden: YES 
Checking for size of "void*" : 8
Run-time dependency threads found: YES
Checking for size of "void*" : 8
Dependency threads found: YES unknown (cached)
Compiler for C++ supports arguments -fvisibility=hidden: YES (cached)
Compiler for C supports arguments -Wno-unused-but-set-variable: NO (cached)
Compiler for C supports arguments -Wno-unused-but-set-variable: NO (cached)
Compiler for C++ supports arguments -Wno-format-truncation: NO 
Compiler for C++ supports arguments -Wno-class-memaccess: NO 
Build targets in project: 199

SciPy 1.9.0.dev0

  User defined options
    prefix: /home/admin-pc/Smitlunagariya/scipy/build-clang-install

Clang versions

Ubuntu clang version 12.0.0-++20210319082646+4990141a4366-1~exp1~20210319193401.61
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Reproducing Code Example

CC=clang-12 CXX=clang++-12 python dev.py --build-only --build-dir=build-clang

Error message

NA

SciPy/NumPy/Python version information

Numpy: 1.21.4

Removing use of deprecated NumPy C API from SciPy

SciPy uses the NumPy C API. Part of that C API is deprecated, and if an extension in SciPy still uses it then a build warning is emitted. The deprecated API uses direct field access (e.g. x->data) while the new API uses macros (e.g. PyArray_DATA(x)). We want to get rid of all deprecated API usage as much as possible.

For an example of what the warning looks like, see scipy#5889 (reading that whole issue is quite instructive).

Examples of PRs fixing warnings: scipy#14311, scipy#4378. The latter PR also makes an adjustment to setup.py like (which would be good to do):

from scipy._build_utils import numpy_nodepr_api

config.add_extension('extname', ..., **numpy_nodepr_api)

To find modules which are using the deprecated API, search meson.build files for Wno-cpp (the flag that suppresses the warning). E.g. right now, searching with ripgrep, I see:

$ rg Wno-cpp
scipy/integrate/meson.build
86:    c_args: '-Wno-cpp',  # TODO: replace with numpy_nodepr_api

scipy/optimize/meson.build
172:             '-Wno-cpp', '-Wno-int-in-bool-context', 

scipy/sparse/sparsetools/meson.build
21:  cpp_args : '-Wno-cpp',  # suppress numpy deprecation warnings

scipy/stats/meson.build
76:  cpp_args: '-Wno-cpp',  # TODO: replace with numpy_nodepr_api

scipy/spatial/meson.build
27:  c_args: '-Wno-cpp',
57:  cpp_args: cpp_args + ['-Wno-cpp'], # TODO: replace with numpy_nodepr_api
65:  c_args: '-Wno-cpp', # TODO: replace with numpy_nodepr_api

scipy/spatial/transform/meson.build
3:  c_args: '-Wno-cpp', # TODO: replace with numpy_nodepr_api

Important to know:

  • C code can and should all be fixed
  • Cython code may be problematic, fix only if the code doesn't get uglier (see discussion in scipy#10840 - that PR stalled, some of the code may be reusable)

An efficient way of working is likely something like:

  1. Search for the -Wno-cpp flag
  2. Pick a module to work on, change the '-Wno-cpp' flag to numpy_nodepr_api
  3. Run the build with ninja -C build, you should now see the warnings errors
  4. Update the C code, then rerun ninja -C build
  5. Once things work, copy the changes to a new branch based on upstream/master
  6. Add the **nodepr_api change to setup.py
  7. Send a PR to SciPy (one PR per module seems good, if there's only a couple of code changes maybe combining 2-3 modules makes sense).

Cc @Smit-create

Investigate issue with `vsnprintf` and mingw-w64

This is a follow-up to gh-118. From the comments there:

Thanks @carlkl, that's what I expected. It fixes fprintf, but not vsnprintf. All remaining warnings come from Cython-generated code. gh-123 should take care of those. For GCC/Mingw I guess it means they should apply their fix also to the v*nprintf functions, and not just to fprintf.

Can you make a minimal standalone repro for the vsnprintf issue? Because when dealing with that, AFAIK it’s also affected by how you declare your own wrapper function that intercepts the varargs and calls vsnprintf. And I don’t see anything specifically relating to one but not the other function family in the gcc patch.

We'll try. There's a level of indirection here, via CPython's PyOS_snprintf, so perhaps the problem is there.

Those warnings were silenced in #123, however there's still a problem in one of Cython, CPython or Mingw-w64. It'd be nice to figure out where exactly, so we can remove the warning silencing and no one else has to deal with this in the future.

Cython build issues in combination with generated sources

There's multiple places where we can't express dependencies correctly, or we can but they go missing. I filed one issue upstream: mesonbuild/meson#8961.

Extensions that have problems:

scipy.special._ufuncs

[1/539] Compiling Cython source scipy/special/_ufuncs.pyx
FAILED: scipy/special/_ufuncs.cpython-39-x86_64-linux-gnu.so.p/scipy/special/_ufuncs.pyx.c 
cython --fast-fail -3 -o scipy/special/_ufuncs.cpython-39-x86_64-linux-gnu.so.p/scipy/special/_ufuncs.pyx.c scipy/special/_ufuncs.pyx

Error compiling Cython file:
------------------------------------------------------------
...
# This file is automatically generated by _generate_pyx.py.
# Do not edit manually!

include "_ufuncs_extra_code_common.pxi"
^

scipy.linalg._decomp_update

If we build without expressing the dependency on cython_blas.pxd:

TypeError: C function scipy.linalg.cython_blas.daxpy has wrong signature (expected void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *), got void (int *, __pyx_t_11cython_blas_d *, __pyx_t_11cython_blas_d *, int *, __pyx_t_11cython_blas_d *, int *))

And if we add it, that doesn't seem supported:

Found ninja-1.10.2 at /home/rgommers/anaconda3/envs/scipy-meson/bin/ninja
Traceback (most recent call last):                                                                  
  File "/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 223, in run
    return options.run_func(options)
  File "/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.9/site-packages/mesonbuild/msetup.py", line 281, in run
    app.generate()
  File "/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.9/site-packages/mesonbuild/msetup.py", line 184, in generate
    self._generate(env)
  File "/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.9/site-packages/mesonbuild/msetup.py", line 246, in _generate
    intr.backend.generate()
  File "/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.9/site-packages/mesonbuild/backend/ninjabackend.py", line 544, in generate
    self.generate_target(t)
  File "/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.9/site-packages/mesonbuild/backend/ninjabackend.py", line 753, in generate_target
    transpiled_sources = self.generate_cython_transpile(target)
  File "/home/rgommers/anaconda3/envs/scipy-meson/lib/python3.9/site-packages/mesonbuild/backend/ninjabackend.py", line 1601, in generate_cython_transpile
    generated_sources[ssrc] = mesonlib.File.from_built_file(gen.subdir, ssrc)
AttributeError: 'CustomTargetIndex' object has no attribute 'subdir'
FAILED: build.ninja 

If we add all of _generate_cy as a dependency, then we rebuild cython_blas.pyx and cython_lapack.pyx which isn't right.

optimize._lsq.givens_elimination

Not built yet, but also depends on cython_lapack.pxd

Investigating and fixing build warnings

There are a lot of silenced build warnings that may indicate there's a bug hidden there. So we should investigate and fix those. There are a number of fairly harmless ones, but sometimes there are real bugs. So let's focus on those. For example, -Wmaybe-uninitialized warnings can lead to bugs for certain types of input (e.g., size 0 or 1 array). And if they're not bugs, then they are often easy to fix.

First, what code not to fix:

  • generated code, e.g. Pythran-generated C++ or the files generated by f2py.
  • vendored Fortran code. There's just too much of it, and there are a ton of warnings.
  • other large vendored modules which may still be developed upstream (Boost, SuperLU, HiGHS, etc.)

Now how to go about finding the ones to fix. First search the meson.build files for the warning type, e.g. (searching with ripgrep in this case):

$ rg Wno-maybe-uninitialized
scipy/interpolate/meson.build
90:  fortran_args: '-Wno-maybe-uninitialized')
133:  c_args: [numpy_nodepr_api, '-Wno-maybe-uninitialized'],

scipy/optimize/meson.build
5:  '-Wno-maybe-uninitialized', '-Wno-unused-label',

scipy/linalg/meson.build
137:                  '-Wno-maybe-uninitialized',

scipy/cluster/meson.build
23:   '-Wno-maybe-uninitialized',
46:   '-Wno-maybe-uninitialized',
69:   '-Wno-maybe-uninitialized',

scipy/sparse/linalg/isolve/meson.build
4:  '-Wno-maybe-uninitialized', '-Wno-unused-label',

scipy/sparse/linalg/dsolve/meson.build
187:    '-Wno-maybe-uninitialized',

scipy/integrate/meson.build
4:  '-Wno-maybe-uninitialized', '-Wno-unused-label',

scipy/io/meson.build
4:  '-Wno-maybe-uninitialized', '-Wno-unused-label',

scipy/special/meson.build
290:  fortran_args: '-Wno-maybe-uninitialized'
296:    '-Wno-maybe-uninitialized',
304:  fortran_args: ['-Wno-unused-dummy-argument', '-Wno-maybe-uninitialized'],
309:  fortran_args: '-Wno-maybe-uninitialized'

scipy/stats/meson.build
4:  '-Wno-maybe-uninitialized', '-Wno-unused-label',

Remove some flags and rebuild to make the warnings show up. E.g. for cluster:

[3/6] Compiling C object scipy/cluster/_opt...son-generated_..__optimal_leaf_ordering.c.o
scipy/cluster/_optimal_leaf_ordering.c: In function '__pyx_pf_5scipy_7cluster_22_optimal_leaf_ordering_optimal_leaf_ordering.isra.0':
scipy/cluster/_optimal_leaf_ordering.c:4714:18: warning: '__pyx_v_best_w' may be used uninitialized in this function [-Wmaybe-uninitialized]
 4714 |       __pyx_t_36 = __pyx_v_best_w;
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:3432:7: note: '__pyx_v_best_w' was declared here
 3432 |   int __pyx_v_best_w;
      |       ^~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:4713:18: warning: '__pyx_v_best_u' may be used uninitialized in this function [-Wmaybe-uninitialized]
 4713 |       __pyx_t_32 = __pyx_v_best_u;
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~
scipy/cluster/_optimal_leaf_ordering.c:3431:7: note: '__pyx_v_best_u' was declared here
 3431 |   int __pyx_v_best_u;
      |       ^~~~~~~~~~~~~~
[5/6] Compiling C object scipy/cluster/_hie...-gnu.so.p/meson-generated_..__hierarchy.c.o
scipy/cluster/_hierarchy.c: In function '__pyx_pw_5scipy_7cluster_10_hierarchy_23linkage':
scipy/cluster/_hierarchy.c:11073:7: warning: '__pyx_v_y' may be used uninitialized in this function [-Wmaybe-uninitialized]
11073 |   int __pyx_v_y;
      |       ^~~~~~~~~
scipy/cluster/_hierarchy.c:11648:10: warning: '__pyx_v_x' may be used uninitialized in this function [-Wmaybe-uninitialized]
11648 |       if (__pyx_t_15) {
      |          ^
scipy/cluster/_hierarchy.c:11072:7: note: '__pyx_v_x' was declared here
11072 |   int __pyx_v_x;
      |       ^~~~~~~~~
scipy/cluster/_hierarchy.c: In function '__pyx_pw_5scipy_7cluster_10_hierarchy_29mst_single_linkage':
scipy/cluster/_hierarchy.c:14315:142: warning: '__pyx_v_y' may be used uninitialized in this function [-Wmaybe-uninitialized]
14315 |     *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_Z.data + __pyx_t_18 * __pyx_v_Z.strides[0]) ) + __pyx_t_12 * __pyx_v_Z.strides[1]) )) = __pyx_v_y;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
scipy/cluster/_hierarchy.c:13954:7: note: '__pyx_v_y' was declared here
13954 |   int __pyx_v_y;
      |       ^~~~~~~~~
scipy/cluster/_hierarchy.c: In function '__pyx_pw_5scipy_7cluster_10_hierarchy_27nn_chain':
scipy/cluster/_hierarchy.c:13544:111: warning: '__pyx_v_y' may be used uninitialized in this function [-Wmaybe-uninitialized]
13544 |       *((int *) ( /* dim=0 */ (__pyx_v_cluster_chain.data + __pyx_t_16 * __pyx_v_cluster_chain.strides[0]) )) = __pyx_v_y;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
scipy/cluster/_hierarchy.c:13047:7: note: '__pyx_v_y' was declared here
13047 |   int __pyx_v_y;
      |       ^~~~~~~~~
scipy/cluster/_hierarchy.c: In function '__pyx_pw_5scipy_7cluster_10_hierarchy_25fast_linkage':
scipy/cluster/_hierarchy.c:12533:142: warning: '__pyx_v_dist' may be used uninitialized in this function [-Wmaybe-uninitialized]
12533 |     *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_Z.data + __pyx_t_14 * __pyx_v_Z.strides[0]) ) + __pyx_t_21 * __pyx_v_Z.strides[1]) )) = __pyx_v_dist;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
scipy/cluster/_hierarchy.c:11975:10: note: '__pyx_v_dist' was declared here
11975 |   double __pyx_v_dist;
      |          ^~~~~~~~~~~~
scipy/cluster/_hierarchy.c:11968:7: warning: '__pyx_v_y' may be used uninitialized in this function [-Wmaybe-uninitialized]
11968 |   int __pyx_v_y;
      |       ^~~~~~~~~
scipy/cluster/_hierarchy.c:11967:7: warning: '__pyx_v_x' may be used uninitialized in this function [-Wmaybe-uninitialized]
11967 |   int __pyx_v_x;
      |       ^~~~~~~~~

The Cython code will point to the original lines, in this case best_w in:

        if v_l >= n_points:
            must_swap[v_l - n_points] = int(swap_status[best_u, best_w, 0])
        if v_r >= n_points:
            must_swap[v_r - n_points] = int(swap_status[best_u, best_w, 1])

Then investigate under what conditions best_w is not defined. If that can actually occur, change the code to deal with it. If it can't occur, then get rid of the warning by initializing the variable.

Let's start with -Wno-maybe-uninitialized and address all of those with PRs to SciPy.

BUG: MacOS Build woes

Reproducing Code Example

./mesondev.sh build $PWD/install
meson --version
#0.59.99

Error message

Error log
[319/1380] Module scanner.
FAILED: scipy/sparse/linalg/isolve/_iterative.cpython-39-darwin.so.p/depscan.dd
/Users/rohitgoswami/micromamba/envs/numscipy-dev/bin/meson --internal depscan scipy/sparse/linalg/isolve/_iterative.cpython-39-darwin.so.p/_iterative.cpython-39-darwin.dat scipy/sparse/linalg/isolve/_iterative.cpython-39-darwin.so.p/depscan.dd /Users/rohitgoswami/Git/Github/Quansight/scipy/build/scipy/sparse/linalg/isolve/_iterative.cpython-39-darwin.so.p/_iterative.cpython-39-darwin-deps.json
Traceback (most recent call last):
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/bin/meson", line 8, in <module>
    sys.exit(main())
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 326, in main
    return run(sys.argv[1:], launcher)
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 314, in run
    return run_script_command(args[1], args[2:])
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 262, in run_script_command
    return module.run(script_args)
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/site-packages/mesonbuild/scripts/depscan.py", line 203, in run
    return scanner.scan()
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/site-packages/mesonbuild/scripts/depscan.py", line 153, in scan
    self.scan_file(s)
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/site-packages/mesonbuild/scripts/depscan.py", line 52, in scan_file
    self.scan_fortran_file(fname)
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/site-packages/mesonbuild/scripts/depscan.py", line 61, in scan_fortran_file
    for line in fpath.read_text(encoding='utf-8').split('\n'):
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/pathlib.py", line 1266, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/pathlib.py", line 1252, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/Users/rohitgoswami/micromamba/envs/numscipy-dev/lib/python3.9/pathlib.py", line 1120, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'scipy/sparse/linalg/isolve/BiCGREVCOM.f'
[327/1380] Compiling C object scipy/linal...o.p/meson-generated_..__flapackmodule.c.
warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]
scipy/linalg/_flapackmodule.c:1419:9: warning: variable 'return_value' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (capi_j>capi_i)
        ^~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1436:12: note: uninitialized use occurs here
    return return_value;
           ^~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1419:5: note: remove the 'if' if its condition is always true
    if (capi_j>capi_i)
    ^~~~~~~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1325:21: note: initialize the variable 'return_value' to silence this warning
    int return_value;
                    ^
                     = 0
scipy/linalg/_flapackmodule.c:1582:9: warning: variable 'return_value' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (capi_j>capi_i)
        ^~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1599:12: note: uninitialized use occurs here
    return return_value;
           ^~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1582:5: note: remove the 'if' if its condition is always true
    if (capi_j>capi_i)
    ^~~~~~~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1488:21: note: initialize the variable 'return_value' to silence this warning
    int return_value;
                    ^
                     = 0
scipy/linalg/_flapackmodule.c:1749:9: warning: variable 'return_value' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (capi_j>capi_i)
        ^~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1766:12: note: uninitialized use occurs here
    return return_value;
           ^~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1749:5: note: remove the 'if' if its condition is always true
    if (capi_j>capi_i)
    ^~~~~~~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1651:21: note: initialize the variable 'return_value' to silence this warning
    int return_value;
                    ^
                     = 0
scipy/linalg/_flapackmodule.c:1916:9: warning: variable 'return_value' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (capi_j>capi_i)
        ^~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1933:12: note: uninitialized use occurs here
    return return_value;
           ^~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1916:5: note: remove the 'if' if its condition is always true
    if (capi_j>capi_i)
    ^~~~~~~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1818:21: note: initialize the variable 'return_value' to silence this warning
    int return_value;
                    ^
                     = 0
scipy/linalg/_flapackmodule.c:2087:9: warning: variable 'return_value' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (capi_j>capi_i)
        ^~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2104:12: note: uninitialized use occurs here
    return return_value;
           ^~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2087:5: note: remove the 'if' if its condition is always true
    if (capi_j>capi_i)
    ^~~~~~~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:1985:21: note: initialize the variable 'return_value' to silence this warning
    int return_value;
                    ^
                     = 0
scipy/linalg/_flapackmodule.c:2258:9: warning: variable 'return_value' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (capi_j>capi_i)
        ^~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2275:12: note: uninitialized use occurs here
    return return_value;
           ^~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2258:5: note: remove the 'if' if its condition is always true
    if (capi_j>capi_i)
    ^~~~~~~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2156:21: note: initialize the variable 'return_value' to silence this warning
    int return_value;
                    ^
                     = 0
scipy/linalg/_flapackmodule.c:2425:9: warning: variable 'return_value' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (capi_j>capi_i)
        ^~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2442:12: note: uninitialized use occurs here
    return return_value;
           ^~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2425:5: note: remove the 'if' if its condition is always true
    if (capi_j>capi_i)
    ^~~~~~~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2327:21: note: initialize the variable 'return_value' to silence this warning
    int return_value;
                    ^
                     = 0
scipy/linalg/_flapackmodule.c:2592:9: warning: variable 'return_value' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (capi_j>capi_i)
        ^~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2609:12: note: uninitialized use occurs here
    return return_value;
           ^~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2592:5: note: remove the 'if' if its condition is always true
    if (capi_j>capi_i)
    ^~~~~~~~~~~~~~~~~~
scipy/linalg/_flapackmodule.c:2494:21: note: initialize the variable 'return_value' to silence this warning
    int return_value;
                    ^
                     = 0
scipy/linalg/_flapackmodule.c:7668:41: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++piv[i++]);(*f2py_func)((trans?(trans==2?"C":"T"):"N"),&n,&nrhs,lu,&n,piv,b,&n,&info);for(i=0;i<n;--piv[i++]);} ;
                                        ^
scipy/linalg/_flapackmodule.c:7668:41: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:7831:41: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++piv[i++]);(*f2py_func)((trans?(trans==2?"C":"T"):"N"),&n,&nrhs,lu,&n,piv,b,&n,&info);for(i=0;i<n;--piv[i++]);} ;
                                        ^
scipy/linalg/_flapackmodule.c:7831:41: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:7994:41: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++piv[i++]);(*f2py_func)((trans?(trans==2?"C":"T"):"N"),&n,&nrhs,lu,&n,piv,b,&n,&info);for(i=0;i<n;--piv[i++]);} ;
                                        ^
scipy/linalg/_flapackmodule.c:7994:41: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:8157:41: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++piv[i++]);(*f2py_func)((trans?(trans==2?"C":"T"):"N"),&n,&nrhs,lu,&n,piv,b,&n,&info);for(i=0;i<n;--piv[i++]);} ;
                                        ^
scipy/linalg/_flapackmodule.c:8157:41: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:8907:52: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++ipiv[i],++jpiv[i++]);(*f2py_func)(&n,lu,&lda,rhs,ipiv,jpiv,&scale);for(i=0;i<n;--ipiv[i],--jpiv[i++]);} ;
                                                   ^
scipy/linalg/_flapackmodule.c:8907:52: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:9082:52: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++ipiv[i],++jpiv[i++]);(*f2py_func)(&n,lu,&lda,rhs,ipiv,jpiv,&scale);for(i=0;i<n;--ipiv[i],--jpiv[i++]);} ;
                                                   ^
scipy/linalg/_flapackmodule.c:9082:52: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:9257:52: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++ipiv[i],++jpiv[i++]);(*f2py_func)(&n,lu,&lda,rhs,ipiv,jpiv,&scale);for(i=0;i<n;--ipiv[i],--jpiv[i++]);} ;
                                                   ^
scipy/linalg/_flapackmodule.c:9257:52: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:9432:52: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++ipiv[i],++jpiv[i++]);(*f2py_func)(&n,lu,&lda,rhs,ipiv,jpiv,&scale);for(i=0;i<n;--ipiv[i],--jpiv[i++]);} ;
                                                   ^
scipy/linalg/_flapackmodule.c:9432:52: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:9589:41: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++piv[i++]);(*f2py_func)(&n,lu,&n,piv,work,&lwork,&info);for(i=0;i<n;--piv[i++]);} ;
                                        ^
scipy/linalg/_flapackmodule.c:9589:41: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:9741:41: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++piv[i++]);(*f2py_func)(&n,lu,&n,piv,work,&lwork,&info);for(i=0;i<n;--piv[i++]);} ;
                                        ^
scipy/linalg/_flapackmodule.c:9741:41: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:9893:41: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++piv[i++]);(*f2py_func)(&n,lu,&n,piv,work,&lwork,&info);for(i=0;i<n;--piv[i++]);} ;
                                        ^
scipy/linalg/_flapackmodule.c:9893:41: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:10045:41: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++piv[i++]);(*f2py_func)(&n,lu,&n,piv,work,&lwork,&info);for(i=0;i<n;--piv[i++]);} ;
                                        ^
scipy/linalg/_flapackmodule.c:10045:41: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:31572:42: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++ipiv[i++]);(*f2py_func)((trans>0?(trans==1?"T":"C"):"N"),&n,&kl,&ku,&nrhs,ab,&ldab,ipiv,b,&ldb,&info);for(i=0;i<n;--ipiv[i++]);} ;
                                         ^
scipy/linalg/_flapackmodule.c:31572:42: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:31770:42: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++ipiv[i++]);(*f2py_func)((trans>0?(trans==1?"T":"C"):"N"),&n,&kl,&ku,&nrhs,ab,&ldab,ipiv,b,&ldb,&info);for(i=0;i<n;--ipiv[i++]);} ;
                                         ^
scipy/linalg/_flapackmodule.c:31770:42: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:31968:42: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++ipiv[i++]);(*f2py_func)((trans>0?(trans==1?"T":"C"):"N"),&n,&kl,&ku,&nrhs,ab,&ldab,ipiv,b,&ldb,&info);for(i=0;i<n;--ipiv[i++]);} ;
                                         ^
scipy/linalg/_flapackmodule.c:31968:42: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:32166:42: warning: for loop has empty body [-Wempty-body]
        {F_INT i;for(i=0;i<n;++ipiv[i++]);(*f2py_func)((trans>0?(trans==1?"T":"C"):"N"),&n,&kl,&ku,&nrhs,ab,&ldab,ipiv,b,&ldb,&info);for(i=0;i<n;--ipiv[i++]);} ;
                                         ^
scipy/linalg/_flapackmodule.c:32166:42: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:105657:52: warning: for loop has empty body [-Wempty-body]
        {F_INT i;m=len(piv);for(i=0;i<m;++piv[i++]);++k1;++k2; (*f2py_func)(&n,a,&nrows,&k1,&k2,piv+off,&inc); for(i=0;i<m;--piv[i++]);} ;
                                                   ^
scipy/linalg/_flapackmodule.c:105657:52: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:105832:52: warning: for loop has empty body [-Wempty-body]
        {F_INT i;m=len(piv);for(i=0;i<m;++piv[i++]);++k1;++k2; (*f2py_func)(&n,a,&nrows,&k1,&k2,piv+off,&inc); for(i=0;i<m;--piv[i++]);} ;
                                                   ^
scipy/linalg/_flapackmodule.c:105832:52: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:106007:52: warning: for loop has empty body [-Wempty-body]
        {F_INT i;m=len(piv);for(i=0;i<m;++piv[i++]);++k1;++k2; (*f2py_func)(&n,a,&nrows,&k1,&k2,piv+off,&inc); for(i=0;i<m;--piv[i++]);} ;
                                                   ^
scipy/linalg/_flapackmodule.c:106007:52: note: put the semicolon on a separate line to silence this warning
scipy/linalg/_flapackmodule.c:106182:52: warning: for loop has empty body [-Wempty-body]
        {F_INT i;m=len(piv);for(i=0;i<m;++piv[i++]);++k1;++k2; (*f2py_func)(&n,a,&nrows,&k1,&k2,piv+off,&inc); for(i=0;i<m;--piv[i++]);} ;
                                                   ^
scipy/linalg/_flapackmodule.c:106182:52: note: put the semicolon on a separate line to silence this warning
29 warnings generated.
[332/1380] Compiling C++ object scipy/spa...rsetools.cpython-39-darwin.so.p/bsr.cxx.
ninja: build stopped: subcommand failed.

SciPy/NumPy/Python version information

1.22.0.dev0+1014.g4af05ea0c 3.9.7 | packaged by conda-forge | (default, Sep  2 2021, 17:58:46) [Clang 11.1.0 ]

Other relevant Information

Git history (short)
* d1d32cf54 (HEAD, ralf/meson) DOC: Add minimal docs to use act for running GH Actions locally
* a49125227 BLD: Generate dynamic files
* af9de89f6 CI: Make fixes for dependencies and running tests
* 62ff40e73 CI: Add condition for act in CI
* df47c3a04 MAINT: Remove `-Wunused-result` warnings
* ee3c58380 MAINT: Remove `-Wno-maybe-uninitialized` warnings
* ede2e58a5 BLD: update Meson build for Boost issue
* 1fdb8a771 BLD: update Meson build for unuran addition
* deef2e09c BLD: update Meson build for axis-nan-policy additions
* 2fd6788b2 BLD: update Meson build for special.hyp2f1 change in upstream/master
* 4427dfa3c BLD: update Meson build for `bspline_util` changes in master
* 63e90449d BLD: fix unuran code generation script for Meson

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.