fink / fink-distributions

Package descriptions and patches for Fink
23 stars 38 forks source link

scipy-1.2.1 fails on 10.14 with variants 34, 35, and 36 #414

Open kamischi opened 5 years ago

kamischi commented 5 years ago

Building scipy-1.2.1 fails on 10.14 with variants py34, py35, and py36 with this error message for py36:

... building 'dfftpack' library compiling Fortran sources Fortran f77 compiler: /sw/lib/gcc8/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops Fortran f90 compiler: /sw/lib/gcc8/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops Fortran fix compiler: /sw/lib/gcc8/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops creating build/temp.macosx-10.14-x86_64-3.6 creating build/temp.macosx-10.14-x86_64-3.6/scipy creating build/temp.macosx-10.14-x86_64-3.6/scipy/fftpack creating build/temp.macosx-10.14-x86_64-3.6/scipy/fftpack/src creating build/temp.macosx-10.14-x86_64-3.6/scipy/fftpack/src/dfftpack compile options: '-I/sw/lib/python3.6/site-packages/numpy/core/include -c' gfortran:f77: scipy/fftpack/src/dfftpack/dfftb1.f Traceback (most recent call last): File "setup.py", line 492, in setup_package() File "setup.py", line 488, in setup_package setup(metadata) File "/sw/lib/python3.6/site-packages/numpy/distutils/core.py", line 169, in setup return old_setup(new_attr) File "/sw/lib/python3.6/site-packages/setuptools/init.py", line 140, in setup return distutils.core.setup(attrs) File "/sw/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/sw/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/sw/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/sw/lib/python3.6/site-packages/numpy/distutils/command/build.py", line 47, in run old_build.run(self) File "/sw/lib/python3.6/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/sw/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/sw/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/sw/lib/python3.6/site-packages/numpy/distutils/command/build_clib.py", line 116, in run self.build_libraries(self.libraries) File "/sw/lib/python3.6/site-packages/numpy/distutils/command/build_clib.py", line 135, in build_libraries self.build_a_library(build_info, lib_name, libraries) File "/sw/lib/python3.6/site-packages/numpy/distutils/command/build_clib.py", line 286, in build_a_library extra_postargs=extra_postargs) File "/sw/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 89, in m = lambda self, *args, *kw: func(self, args, kw) File "/sw/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 343, in CCompiler_compile single_compile(o) File "/sw/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 303, in single_compile self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) File "/sw/lib/python3.6/site-packages/numpy/distutils/fcompiler/init.py", line 604, in _compile self.spawn(command, display=display) File "/sw/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 89, in m = lambda self, *args, *kw: func(self, args, kw) File "/sw/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 139, in CCompiler_spawn s, o = exec_command(cmd) File "/sw/lib/python3.6/site-packages/numpy/distutils/exec_command.py", line 213, in exec_command env) File "/sw/lib/python3.6/site-packages/numpy/distutils/exec_command.py", line 256, in _exec_command text, err = proc.communicate() File "/sw/lib/python3.6/subprocess.py", line 850, in communicate stdout = self.stdout.read() File "/sw/lib/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 370: ordinal not in range(128) ...

Building the py27 and py37 variants crashes at much later stages. I will investigate this further and report later.

As I am not 100% sure about the cleanliness of my setup, reproduction of this issue would be helpful.

kamischi commented 5 years ago

Further checks on py27 and py37 revealed that they build fine with numpy-1.14.5-2 and only fail at a late stage with my trial numpy-1.15.3. The fails with py34-py36 are with both versions of numpy.

nieder commented 5 years ago

Built for me on 10.13. On 10.14/Xcode10.2.1, gfortran:f77: scipy/fftpack/src/dfftpack/dfftb1.f compiles, but with a lot of warnings and the build finishes. However I get lots of test failures, and a fatal segfault:

../sparse/linalg/tests/test_onenormest.py ss/tmp/fink.CoeEi: line 13: 90331 Segmentation fault: 11  /sw/bin/python3.5 -B -c "import scipy, sys; e=scipy.test(extra_argv=['-k not test_hrectangular and not test_medium1 and not test_maxiter_worsening and not test_ldl_type_size_combinations']); sys.exit(1-e)"

@kamischi your error looks to be encoding related. What if you add export LANG=en_US.UTF-8 to CompileScript?

kamischi commented 5 years ago

After export LANG=en_US.UTF-8 all variants build. Maybe non-english systems need this (mine is German). Test (-m) with variant py35: 14046 passed, 1305 skipped, 1239 deselected, 73 xfailed, 7 xpassed

dhomeier commented 5 years ago

@kamischi does your numpy-1.15.3 include the numpy.distutilspatch that bypasses the SHELL=/usr/bin/false issue for fink-bld? I've noticed I only left the SHELL=/bin/sh fix in the Compile, but not the Install script, but with numpy-py-1.14.5-2 it should not be required in either. I am going to submit a PR for my numpy-1.16 update so we can test with a newer version.

@nieder could you see which test exactly it segfaulting on? There are only 3 non-skipped in that file, but could you re-run the tests with

SCIPY_XSLOW=1 python%type_pkg[python] -c "import scipy; scipy.test(extra_argv=['-v', '-k test_onenormest'])

for more info?

One option to try is switching back to clang for the scipy build. I generally saw poor results with mixing different C and Fortran compilers in the OpenBLAS build, but it turns out most of the segfaults seem to be due to setting FFLAGS=-ff2c. The gfortran manual cautions against this, and it is evidently not required for interfacing clang. Changing the scipy build to just

 darwin_vers=`uname -r | cut -d. -f1`
 if [ "$darwin_vers" -ge 11 ]; then
   export CC=clang
   export CXX=clang++
 else
   export CC=%p/bin/gcc-fsf-%type_raw[gcc]
   export CXX=%p/bin/g++-fsf-%type_raw[gcc]
 fi
 export FC=%p/lib/gcc%type_raw[gcc]/bin/gfortran
 export PATH="%p/lib/gcc%type_raw[gcc]/bin:$PATH"

let all linalg tests including those skipped in the current package pass on 10.12, and also all but one of those marked xslow.

dhomeier commented 5 years ago

Setting LANG was required e.g. in the numpy tests; for scipy they passed on my machine although my setting is LANG=en_GB.UTF-8 (but in the fink-bld environment the LANG and LC_* variables should be unset by default anyway). But there's probably no harm in setting en_US.UTF-8 in general.

kamischi commented 5 years ago

@dhomeier: in the mean time, i have moved NumPy from 1.15.3 to 1.16.3. I did not change much in the build. The patch on distutils/command/build_ext.py and distutils/system_info.py are applied. I have taken out the patch on distutils/exec_command.py, but forgot the reason. Anyway building of the py36 variant fails with: ... compile options: '-DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.macosx-10.14-x86_64-3.6/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/sw/include/python3.6m -Ibuild/src.macosx-10.14-x86_64-3.6/numpy/core/src/common -Ibuild/src.macosx-10.14-x86_64-3.6/numpy/core/src/npymath -Ibuild/src.macosx-10.14-x86_64-3.6/numpy/core/src/common -Ibuild/src.macosx-10.14-x86_64-3.6/numpy/core/src/npymath -c' gcc: numpy/core/src/dummymodule.c Traceback (most recent call last): File "setup.py", line 415, in setup_package() File "setup.py", line 407, in setup_package setup(metadata) File "/sw/src/fink.build/numpy-py36-1.16.3-1/numpy-1.16.3/numpy/distutils/core.py", line 171, in setup return old_setup(new_attr) File "/sw/lib/python3.6/site-packages/setuptools/init.py", line 140, in setup return distutils.core.setup(**attrs) File "/sw/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/sw/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/sw/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/sw/src/fink.build/numpy-py36-1.16.3-1/numpy-1.16.3/numpy/distutils/command/build.py", line 47, in run old_build.run(self) File "/sw/lib/python3.6/distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/sw/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/sw/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/sw/src/fink.build/numpy-py36-1.16.3-1/numpy-1.16.3/numpy/distutils/command/build_ext.py", line 261, in run self.build_extensions() File "/sw/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "/sw/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "/sw/src/fink.build/numpy-py36-1.16.3-1/numpy-1.16.3/numpy/distutils/command/build_ext.py", line 444, in build_extension if sys.platform=='darwin': NameError: name 'sys' is not defined

nieder commented 5 years ago

I ran your command (the test is actually test_onenormest),

$ SCIPY_XSLOW=1 /sw/bin/python3.5 -c "import scipy; scipy.test(extra_argv=['-v', '-k test_onenormest'])"
================================================== test session starts ==================================================
platform darwin -- Python 3.5.7, pytest-3.10.1, py-1.7.0, pluggy-0.7.1 -- /sw/bin/python3.5
cachedir: .pytest_cache
rootdir: /sw/build.build/scipy-py35-1.2.1-1/scipy-1.2.1, inifile: pytest.ini
collected 16670 items / 16663 deselected                                                                                

../sparse/linalg/tests/test_expm_multiply.py::TestExpmActionSimple::test_onenormest_matrix_power PASSED           [ 14%]
../sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_3_t_2 Segmentation fault: 11

Then reran the original command and it actually gave a more verbose error:

______________________________________ TestOnenormest.test_onenormest_table_5_t_1 _______________________________________

self = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x113fbfbe0>

    def test_onenormest_table_5_t_1(self):
        # "note that there is no randomness and hence only one estimate for t=1"
        t = 1
        n = 100
        itmax = 5
        alpha = 1 - 1e-6
        A = -scipy.linalg.inv(np.identity(n) + alpha*np.eye(n, k=1))
        first_col = np.array([1] + [0]*(n-1))
        first_row = np.array([(-alpha)**i for i in range(n)])
        B = -scipy.linalg.toeplitz(first_col, first_row)
>       assert_allclose(A, B)
E       AssertionError: 
E       Not equal to tolerance rtol=1e-07, atol=0
E       
E       (mismatch 34.16%)
E        x: array([[-1.      ,  0.999999, -0.999998, ..., -0.      , -0.      ,
E                0.      ],
E              [-0.      , -1.      ,  0.999999, ..., -0.      , -0.      ,...
E        y: array([[-1.      ,  0.999999, -0.999998, ...,  0.999903, -0.999902,
E                0.999901],
E              [-0.      , -1.      ,  0.999999, ..., -0.999904,  0.999903,...

A          = array([[-1.      ,  0.999999, -0.999998, ..., -0.      , -0.      ,
         0.      ],
       [-0.      , -1.      , ...-1.      ,
         0.999999],
       [-0.      , -0.      , -0.      , ..., -0.      , -0.      ,
        -1.      ]])
B          = array([[-1.      ,  0.999999, -0.999998, ...,  0.999903, -0.999902,
         0.999901],
       [-0.      , -1.      , ...-1.      ,
         0.999999],
       [-0.      , -0.      , -0.      , ..., -0.      , -0.      ,
        -1.      ]])
alpha      = 0.999999
first_col  = array([1, 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, 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, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
first_row  = array([ 1.      , -0.999999,  0.999998, -0.999997,  0.999996, -0.999995,
        0.999994, -0.999993,  0.999992, -0.99...   0.99991 , -0.999909,  0.999908, -0.999907,  0.999906, -0.999905,
        0.999904, -0.999903,  0.999902, -0.999901])
itmax      = 5
n          = 100
self       = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x113fbfbe0>
t          = 1

../../../root-scipy-py35-1.2.1-1/sw/lib/python3.5/site-packages/scipy/sparse/linalg/tests/test_onenormest.py:134: AssertionError
=========================== 1 failed, 3 passed, 3 skipped, 16663 deselected in 14.91 seconds ============================

I'll try clang building next.

nieder commented 5 years ago

The above was done by running the tests manually inside %b. This is by editing the .info file to just run test_onenormest and change CC/CXX as needed:

GCC8:

   export PYTHONPATH=/sw/build.build/root-scipy-py35-1.2.1-1.1/sw/lib/python3.5/site-packages
   SCIPY_XSLOW=1 /sw/bin/python3.5 -c "import scipy; scipy.test(extra_argv=['-v', '-k test_onenormest'])" || exit 2
======================================================================== test session starts =========================================================================
platform darwin -- Python 3.5.7, pytest-3.10.1, py-1.7.0, pluggy-0.7.1 -- /sw/bin/python3.5
cachedir: .pytest_cache
rootdir: /sw/build.build/scipy-py35-1.2.1-1.2/scipy-1.2.1, inifile: pytest.ini
collected 16670 items / 16663 deselected                                                                                                                             

../sparse/linalg/tests/test_expm_multiply.py::TestExpmActionSimple::test_onenormest_matrix_power PASSED                                                        [ 14%]
../sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_3_t_2 /tmp/fink.ohD_m: line 17: 18319 Segmentation fault: 11  SCIPY_XSLOW=1 /sw/bin/python3.5 -c "import scipy; scipy.test(extra_argv=['-v', '-k test_onenormest'])"
### execution of /tmp/fink.ohD_m failed, exit code 2

clang(xcode10.2)

   export PYTHONPATH=/sw/build.build/root-scipy-py35-1.2.1-1.1/sw/lib/python3.5/site-packages
   SCIPY_XSLOW=1 /sw/bin/python3.5 -c "import scipy; scipy.test(extra_argv=['-v', '-k test_onenormest'])" || exit 2
======================================================================== test session starts =========================================================================
platform darwin -- Python 3.5.7, pytest-3.10.1, py-1.7.0, pluggy-0.7.1 -- /sw/bin/python3.5
cachedir: .pytest_cache
rootdir: /sw/build.build/scipy-py35-1.2.1-1.1/scipy-1.2.1, inifile: pytest.ini
collected 16670 items / 16663 deselected                                                                                                                             

../sparse/linalg/tests/test_expm_multiply.py::TestExpmActionSimple::test_onenormest_matrix_power PASSED                                                        [ 14%]
../sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_3_t_2 FAILED                                                                  [ 28%]
../sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_4_t_7 PASSED                                                                  [ 42%]
../sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_5_t_1 FAILED                                                                  [ 57%]
../sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_6_t_1 FAILED                                                                  [ 71%]
../sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_returns PASSED                                                                                 [ 85%]
../sparse/linalg/tests/test_onenormest.py::TestAlgorithm_2_2::test_randn_inv PASSED                                                                            [100%]

============================================================================== FAILURES ==============================================================================
_____________________________________________________________ TestOnenormest.test_onenormest_table_3_t_2 _____________________________________________________________

self = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x10f768898>

    @pytest.mark.xslow
    def test_onenormest_table_3_t_2(self):
        # This will take multiple seconds if your computer is slow like mine.
        # It is stochastic, so the tolerance could be too strict.
        np.random.seed(1234)
        t = 2
        n = 100
        itmax = 5
        nsamples = 5000
        observed = []
        expected = []
        nmult_list = []
        nresample_list = []
        for i in range(nsamples):
            A = scipy.linalg.inv(np.random.randn(n, n))
>           est, v, w, nmults, nresamples = _onenormest_core(A, A.T, t, itmax)

A          = array([[ 4.42516575e+163,  2.35106453e+164, -9.28924596e+161, ...,
        -3.58559379e+163,  7.65365896e+163, -5.7828...79724988e-002, -8.00273559e-002,  2.97354819e-002, ...,
         1.27280940e-001, -7.00190546e-002,  1.59040413e-002]])
est        = 1.4777489950438e+293
expected   = [9.773634845761701e+156, 1.878131647230004e+249, 6.866461219710646e+223, 1.6781387441807046e+280, 3.751570786937427e+286, 2.0310866568285782e+279, ...]
i          = 23
itmax      = 5
n          = 100
nmult_list = [4, 4, 4, 4, 4, 4, ...]
nmults     = 4
nresample_list = [0, 0, 0, 0, 0, 0, ...]
nresamples = 0
nsamples   = 5000
observed   = [9.773634845761701e+156, 1.878131647230004e+249, 6.866461219710646e+223, 1.6781387441807046e+280, 3.751570786937427e+286, 2.0310866568285782e+279, ...]
self       = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x10f768898>
t          = 2
v          = 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., 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., 0., 0., 0., 0.])
w          = array([ 7.84965805e+167,  3.29072044e+168, -1.29666431e+167,
       -2.42844146e+167, -3.97607815e+166, -1.66684479e+1...34235068e-001,  1.15522567e-001,
        1.24329152e-001,  4.81910616e-001,  1.30188383e-002,
        7.78008637e-004])

../../../root-scipy-py35-1.2.1-1.1/sw/lib/python3.5/site-packages/scipy/sparse/linalg/tests/test_onenormest.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../root-scipy-py35-1.2.1-1.1/sw/lib/python3.5/site-packages/scipy/sparse/linalg/_onenormest.py:409: in _onenormest_core
    est = np.max(mags)
/sw/lib/python3.5/site-packages/numpy/core/fromnumeric.py:2320: in amax
    out=out, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

a = array([nan, nan]), axis = None, out = None, keepdims = False

    def _amax(a, axis=None, out=None, keepdims=False):
>       return umr_maximum(a, axis, None, out, keepdims)
E       RuntimeWarning: invalid value encountered in reduce

a          = array([nan, nan])
axis       = None
keepdims   = False
out        = None

/sw/lib/python3.5/site-packages/numpy/core/_methods.py:26: RuntimeWarning
_____________________________________________________________ TestOnenormest.test_onenormest_table_5_t_1 _____________________________________________________________

self = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x10fd67748>

    def test_onenormest_table_5_t_1(self):
        # "note that there is no randomness and hence only one estimate for t=1"
        t = 1
        n = 100
        itmax = 5
        alpha = 1 - 1e-6
        A = -scipy.linalg.inv(np.identity(n) + alpha*np.eye(n, k=1))
        first_col = np.array([1] + [0]*(n-1))
        first_row = np.array([(-alpha)**i for i in range(n)])
        B = -scipy.linalg.toeplitz(first_col, first_row)
>       assert_allclose(A, B)
E       AssertionError: 
E       Not equal to tolerance rtol=1e-07, atol=0
E       
E       (mismatch 34.16%)
E        x: array([[-1.      ,  0.999999, -0.999998, ..., -0.      , -0.      ,
E                0.      ],
E              [-0.      , -1.      ,  0.999999, ..., -0.      , -0.      ,...
E        y: array([[-1.      ,  0.999999, -0.999998, ...,  0.999903, -0.999902,
E                0.999901],
E              [-0.      , -1.      ,  0.999999, ..., -0.999904,  0.999903,...

A          = array([[-1.      ,  0.999999, -0.999998, ..., -0.      , -0.      ,
         0.      ],
       [-0.      , -1.      , ...-1.      ,
         0.999999],
       [-0.      , -0.      , -0.      , ..., -0.      , -0.      ,
        -1.      ]])
B          = array([[-1.      ,  0.999999, -0.999998, ...,  0.999903, -0.999902,
         0.999901],
       [-0.      , -1.      , ...-1.      ,
         0.999999],
       [-0.      , -0.      , -0.      , ..., -0.      , -0.      ,
        -1.      ]])
alpha      = 0.999999
first_col  = array([1, 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, 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, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
first_row  = array([ 1.      , -0.999999,  0.999998, -0.999997,  0.999996, -0.999995,
        0.999994, -0.999993,  0.999992, -0.99...   0.99991 , -0.999909,  0.999908, -0.999907,  0.999906, -0.999905,
        0.999904, -0.999903,  0.999902, -0.999901])
itmax      = 5
n          = 100
self       = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x10fd67748>
t          = 1

../../../root-scipy-py35-1.2.1-1.1/sw/lib/python3.5/site-packages/scipy/sparse/linalg/tests/test_onenormest.py:134: AssertionError
_____________________________________________________________ TestOnenormest.test_onenormest_table_6_t_1 _____________________________________________________________

self = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x10f761da0>

    @pytest.mark.xslow
    def test_onenormest_table_6_t_1(self):
        #TODO this test seems to give estimates that match the table,
        #TODO even though no attempt has been made to deal with
        #TODO complex numbers in the one-norm estimation.
        # This will take multiple seconds if your computer is slow like mine.
        # It is stochastic, so the tolerance could be too strict.
        np.random.seed(1234)
        t = 1
        n = 100
        itmax = 5
        nsamples = 5000
        observed = []
        expected = []
        nmult_list = []
        nresample_list = []
        for i in range(nsamples):
            A_inv = np.random.rand(n, n) + 1j * np.random.rand(n, n)
            A = scipy.linalg.inv(A_inv)
            est, v, w, nmults, nresamples = _onenormest_core(A, A.T, t, itmax)
            observed.append(est)
>           expected.append(scipy.linalg.norm(A, 1))

A          = array([[            nan        +nanj,             nan        +nanj,
                    nan        +nanj, ...,        ... +1.44655264j, ..., -5.74954639e-02 +0.03663529j,
         2.53767425e-02 -0.06812981j, -2.92457587e-01 +0.03830277j]])
A_inv      = array([[6.03391333e-01+0.06684044j, 3.13258296e-01+0.71113676j,
        4.83321795e-01+0.59081827j, ..., 4.77147129e-0...653e-01+0.82963144j, ..., 7.72135749e-01+0.31823118j,
        5.05613445e-01+0.54135265j, 4.53706075e-01+0.85287507j]])
est        = nan
expected   = [3.730547937412256e+27, 5.798510374042808e+41, 4.936775837728676e+56, 1.698607501136552e+75, 3.4534580766558766e+90, 3.016309231894655e+107, ...]
i          = 19
itmax      = 5
n          = 100
nmult_list = [4, 4, 4, 4, 4, 4, ...]
nmults     = 11
nresample_list = [0, 0, 0, 0, 0, 0, ...]
nresamples = 0
nsamples   = 5000
observed   = [3.7305479374122545e+27, 5.798510374042808e+41, 4.936775837728676e+56, 1.698607501136552e+75, 3.4534580766558757e+90, 3.016309231894654e+107, ...]
self       = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x10f761da0>
t          = 1
v          = 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., 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., 0., 0., 0., 1.])
w          = array([            nan           +nanj,             nan           +nanj,
                   nan           +nanj,      ...798332e-01j, -7.17514029e-01+3.30501551e-01j,
        2.91294699e-01-3.35946925e-01j, -2.92457587e-01+3.83027661e-02j])

../../../root-scipy-py35-1.2.1-1.1/sw/lib/python3.5/site-packages/scipy/sparse/linalg/tests/test_onenormest.py:166: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../root-scipy-py35-1.2.1-1.1/sw/lib/python3.5/site-packages/scipy/linalg/misc.py:137: in norm
    a = np.asarray_chkfinite(a)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

a = array([[            nan        +nanj,             nan        +nanj,
                    nan        +nanj, ...,        ... +1.44655264j, ..., -5.74954639e-02 +0.03663529j,
         2.53767425e-02 -0.06812981j, -2.92457587e-01 +0.03830277j]])
dtype = None, order = None

    def asarray_chkfinite(a, dtype=None, order=None):
        """Convert the input to an array, checking for NaNs or Infs.

        Parameters
        ----------
        a : array_like
            Input data, in any form that can be converted to an array.  This
            includes lists, lists of tuples, tuples, tuples of tuples, tuples
            of lists and ndarrays.  Success requires no NaNs or Infs.
        dtype : data-type, optional
            By default, the data-type is inferred from the input data.
        order : {'C', 'F'}, optional
             Whether to use row-major (C-style) or
             column-major (Fortran-style) memory representation.
             Defaults to 'C'.

        Returns
        -------
        out : ndarray
            Array interpretation of `a`.  No copy is performed if the input
            is already an ndarray.  If `a` is a subclass of ndarray, a base
            class ndarray is returned.

        Raises
        ------
        ValueError
            Raises ValueError if `a` contains NaN (Not a Number) or Inf (Infinity).

        See Also
        --------
        asarray : Create and array.
        asanyarray : Similar function which passes through subclasses.
        ascontiguousarray : Convert input to a contiguous array.
        asfarray : Convert input to a floating point ndarray.
        asfortranarray : Convert input to an ndarray with column-major
                         memory order.
        fromiter : Create an array from an iterator.
        fromfunction : Construct an array by executing a function on grid
                       positions.

        Examples
        --------
        Convert a list into an array.  If all elements are finite
        ``asarray_chkfinite`` is identical to ``asarray``.

        >>> a = [1, 2]
        >>> np.asarray_chkfinite(a, dtype=float)
        array([1., 2.])

        Raises ValueError if array_like contains Nans or Infs.

        >>> a = [1, 2, np.inf]
        >>> try:
        ...     np.asarray_chkfinite(a)
        ... except ValueError:
        ...     print('ValueError')
        ...
        ValueError

        """
        a = asarray(a, dtype=dtype, order=order)
        if a.dtype.char in typecodes['AllFloat'] and not np.isfinite(a).all():
            raise ValueError(
>               "array must not contain infs or NaNs")
E           ValueError: array must not contain infs or NaNs

a          = array([[            nan        +nanj,             nan        +nanj,
                    nan        +nanj, ...,        ... +1.44655264j, ..., -5.74954639e-02 +0.03663529j,
         2.53767425e-02 -0.06812981j, -2.92457587e-01 +0.03830277j]])
dtype      = None
order      = None

/sw/lib/python3.5/site-packages/numpy/lib/function_base.py:1233: ValueError
======================================================= 3 failed, 4 passed, 16663 deselected in 55.43 seconds ========================================================
### execution of /tmp/fink.uj5Yx failed, exit code 1
dhomeier commented 5 years ago

Thanks for testing. test_onenormest_table_6_t_1 also fails on 10.12, for the rest that seems to be the best we can get - at least no segfaults. I did manage to build openblas-0.3.6 with clang as well, but it requires some tweaking as Apple's clang does not support -fopenmp, and accordingly multiprocessing performance is not quite as good (the Fortran routines are still parallelised). But on 10.12 it fails and passes exactly the same scipy.linalg tests, so does not look like it's worth the effort.

If you have time for two additional tests, could you run these with python3.5 and python3.6, both with SCIPY_XSLOW=1?

scipy.test(extra_argv=['-v', '--runxfail', '-k test_maxiter_worsening'])

On 10.12, the gmres version fails in python3.6 only. If it's the same for 10.14 I'd adjust the list of tests to skip accordingly.

dhomeier commented 5 years ago

@kamischi I needed to add one or two patches for numpy 1.16.3 to build; also the test setup has changed a bit. I had one test failure numpy.RankWarning: Polyfit may be poorly conditioned in TestPolynomial.test_polyfit when building against Accelerate/VecLib, but with openblas installed it would automatically detect and build against the latter (with no test failures). So for consistency I thought it best to make it a [Build]Depends - see #415.