Repository: scipy/scipy

Issue:
Test failures - TestLinprogIPSparseCholmod
When I run the test suite (from master) on my own computer I get a whole heap of test failures from `TestLinprogIPSparseCholmod`.
@mdhaber

```
_______________________________________________________________ TestLinprogIPSparseCholmod.test_docstring_example ________________________________________________________________
scipy/optimize/tests/test_linprog.py:266: in test_docstring_example
    options=self.options, method=self.method)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_____________________________________________________________ TestLinprogIPSparseCholmod.test_inequality_constraints _____________________________________________________________
scipy/optimize/tests/test_linprog.py:393: in test_inequality_constraints
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________ TestLinprogIPSparseCholmod.test_inequality_constraints2 _____________________________________________________________
scipy/optimize/tests/test_linprog.py:406: in test_inequality_constraints2
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
__________________________________________________________________ TestLinprogIPSparseCholmod.test_bounds_mixed __________________________________________________________________
scipy/optimize/tests/test_linprog.py:477: in test_bounds_mixed
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________ TestLinprogIPSparseCholmod.test_bounds_equal_no_presolve ____________________________________________________________
scipy/optimize/tests/test_linprog.py:512: in test_bounds_equal_no_presolve
    method=self.method, options=o)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_________________________________________________________________ TestLinprogIPSparseCholmod.test_zero_column_1 __________________________________________________________________
scipy/optimize/tests/test_linprog.py:527: in test_zero_column_1
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
___________________________________________________________________ TestLinprogIPSparseCholmod.test_zero_row_1 ___________________________________________________________________
scipy/optimize/tests/test_linprog.py:555: in test_zero_row_1
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
___________________________________________________________________ TestLinprogIPSparseCholmod.test_zero_row_2 ___________________________________________________________________
scipy/optimize/tests/test_linprog.py:563: in test_zero_row_2
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_______________________________________________________________ TestLinprogIPSparseCholmod.test_singleton_row_eq_2 _______________________________________________________________
scipy/optimize/tests/test_linprog.py:611: in test_singleton_row_eq_2
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_______________________________________________________________ TestLinprogIPSparseCholmod.test_singleton_row_ub_2 _______________________________________________________________
scipy/optimize/tests/test_linprog.py:633: in test_singleton_row_ub_2
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
___________________________________________________________________ TestLinprogIPSparseCholmod.test_infeasible ___________________________________________________________________
scipy/optimize/tests/test_linprog.py:644: in test_infeasible
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
___________________________________________________________________ TestLinprogIPSparseCholmod.test_unbounded ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:667: in test_unbounded
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_____________________________________________________ TestLinprogIPSparseCholmod.test_unbounded_below_no_presolve_corrected ______________________________________________________
scipy/optimize/tests/test_linprog.py:679: in test_unbounded_below_no_presolve_corrected
    options=o)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
________________________________________________________________ TestLinprogIPSparseCholmod.test_cyclic_recovery _________________________________________________________________
scipy/optimize/tests/test_linprog.py:731: in test_cyclic_recovery
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
__________________________________________________________________ TestLinprogIPSparseCholmod.test_cyclic_bland __________________________________________________________________
scipy/optimize/tests/test_linprog.py:748: in test_cyclic_bland
    method=self.method, options=o)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_______________________________________________________________ TestLinprogIPSparseCholmod.test_nontrivial_problem _______________________________________________________________
scipy/optimize/tests/test_linprog.py:783: in test_nontrivial_problem
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_________________________________________________________________ TestLinprogIPSparseCholmod.test_lpgen_problem __________________________________________________________________
scipy/optimize/tests/test_linprog.py:796: in test_lpgen_problem
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
__________________________________________________________________ TestLinprogIPSparseCholmod.test_network_flow __________________________________________________________________
scipy/optimize/tests/test_linprog.py:817: in test_network_flow
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_________________________________________________________ TestLinprogIPSparseCholmod.test_network_flow_limited_capacity __________________________________________________________
scipy/optimize/tests/test_linprog.py:848: in test_network_flow_limited_capacity
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
______________________________________________________ TestLinprogIPSparseCholmod.test_simplex_algorithm_wikipedia_example _______________________________________________________
scipy/optimize/tests/test_linprog.py:859: in test_simplex_algorithm_wikipedia_example
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
__________________________________________________________________ TestLinprogIPSparseCholmod.test_enzo_example __________________________________________________________________
scipy/optimize/tests/test_linprog.py:877: in test_enzo_example
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_________________________________________________________________ TestLinprogIPSparseCholmod.test_enzo_example_b _________________________________________________________________
scipy/optimize/tests/test_linprog.py:895: in test_enzo_example_b
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_________________________________________________________ TestLinprogIPSparseCholmod.test_enzo_example_c_with_degeneracy _________________________________________________________
scipy/optimize/tests/test_linprog.py:907: in test_enzo_example_c_with_degeneracy
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_______________________________________________________ TestLinprogIPSparseCholmod.test_enzo_example_c_with_infeasibility ________________________________________________________
scipy/optimize/tests/test_linprog.py:933: in test_enzo_example_c_with_infeasibility
    method=self.method, options=o)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
_____________________________________________________________ TestLinprogIPSparseCholmod.test_basic_artificial_vars ______________________________________________________________
scipy/optimize/tests/test_linprog.py:949: in test_basic_artificial_vars
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_5400 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1009: in test_bug_5400
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_6139 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1029: in test_bug_6139
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_6690 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1066: in test_bug_6690
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_7044 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1089: in test_bug_7044
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_7237 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1134: in test_bug_7237
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_8174 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1153: in test_bug_8174
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
___________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_8174_2 ___________________________________________________________________
scipy/optimize/tests/test_linprog.py:1181: in test_bug_8174_2
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_8561 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1198: in test_bug_8561
    method=self.method)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_8662 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1219: in test_bug_8662
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
___________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_10124 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1310: in test_bug_10124
    method=self.method, options=o)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
___________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_10349 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1329: in test_bug_10349
    method=self.method, options=self.options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
___________________________________________________________________ TestLinprogIPSparseCholmod.test_bug_10466 ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1365: in test_bug_10466
    method=self.method, options=o)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
____________________________________________________________________ TestLinprogIPSpecific.test_solver_select ____________________________________________________________________
scipy/optimize/tests/test_linprog.py:1604: in test_solver_select
    res1 = linprog(c, A_ub=A, b_ub=b, method=self.method, options=options)
scipy/optimize/_linprog.py:548: in linprog
    postsolve_args=postsolve_args, **solver_options)
scipy/optimize/_linprog_ip.py:1087: in _linprog_ip
    OptimizeWarning, stacklevel=3)
E   scipy.optimize.optimize.OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
============================================ 38 failed, 1495 passed, 10 skipped, 8 deselected, 1 xfailed, 2 xpassed in 52.59 seconds =============================================


```


Discussion:
Thanks. Is that new? The code hasn't changed recently. Do you have SuiteSparse? scikit-sparse?
At the top of the tests, 
```
has_cholmod = True
try:
    import sksparse
except ImportError:
    has_cholmod = False
```
The class of tests that is failing is only defined if `has_cholmod` is `True`:
```
if has_cholmod:
    class TestLinprogIPSparseCholmod(LinprogIPTests):
        options = {"sparse": True, "cholesky": True}
```
Yet you only get that warning if in `_linprog_ip`:
```
    if (cholesky or cholesky is None) and sparse and not has_cholmod:
        if cholesky:
            warn("Sparse cholesky is only available with scikit-sparse. "
                 "Setting `cholesky = False`",
                 OptimizeWarning, stacklevel=3)
```
where `has_cholmod` is defined at the top:
```
has_umfpack = True
has_cholmod = True
try:
    from sksparse.cholmod import cholesky as cholmod
    from sksparse.cholmod import analyze as cholmod_analyze
except ImportError:
    has_cholmod = False
```
Perhaps you're not getting an `ImportError` but some other kind of error?

1. Can you try:
```
from scipy.optimize import linprog
linprog(1, options={"presolve":False, "sparse":True, "cholesky":True})
```
Do you get the warning?

2. What happens when you try to:
```
    from sksparse.cholmod import cholesky as cholmod
    from sksparse.cholmod import analyze as cholmod_analyze
```
3. How about:
```
import sksparse
```
?

Looking into this a bit further. If `scikit-sparse` is not installed then the test suite runs. If I `pip install scikit-sparse` then I get the errors reported above with `runtests`

The results of your tests:
```
>>> from scipy.optimize import linprog
>>> linprog(1, options={"presolve":False, "sparse":True, "cholesky":True})
<stdin>:1: OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
     con: array([], dtype=float64)
     fun: 2.4999999999987055e-09
 message: 'Optimization terminated successfully.'
     nit: 2
   slack: array([], dtype=float64)
  status: 0
 success: True
```
and
```
>>> from sksparse.cholmod import cholesky as cholmod
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/anz/miniconda3/envs/test/lib/python3.8/site-packages/sksparse/cholmod.cpython-38-darwin.so, 2): Symbol not found: ___addtf3
  Referenced from: /usr/local/opt/gcc/lib/gcc/9/libquadmath.0.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /usr/local/opt/gcc/lib/gcc/9/libquadmath.0.dylib
```
which indicates there's a library symbol not being picked up somewhere. `import sksparse` works.

```
>>> scipy.show_config()
lapack_mkl_info:
  NOT AVAILABLE
openblas_lapack_info:
  NOT AVAILABLE
openblas_clapack_info:
  NOT AVAILABLE
flame_info:
  NOT AVAILABLE
atlas_3_10_threads_info:
  NOT AVAILABLE
atlas_3_10_info:
  NOT AVAILABLE
atlas_threads_info:
  NOT AVAILABLE
atlas_info:
  NOT AVAILABLE
accelerate_info:
  NOT AVAILABLE
lapack_info:
    libraries = ['lapack', 'lapack']
    library_dirs = ['/usr/lib']
    language = f77
blas_mkl_info:
  NOT AVAILABLE
blis_info:
  NOT AVAILABLE
openblas_info:
  NOT AVAILABLE
atlas_3_10_blas_threads_info:
  NOT AVAILABLE
atlas_3_10_blas_info:
  NOT AVAILABLE
atlas_blas_threads_info:
  NOT AVAILABLE
atlas_blas_info:
  NOT AVAILABLE
blas_info:
    libraries = ['blas', 'blas']
    library_dirs = ['/usr/lib']
    include_dirs = ['/usr/local/include', '/usr/include', '/Users/anz/miniconda3/envs/test/include']
blas_opt_info:
    define_macros = [('NO_ATLAS_INFO', 1)]
    libraries = ['blas', 'blas']
    library_dirs = ['/usr/lib']
    include_dirs = ['/usr/local/include', '/usr/include', '/Users/anz/miniconda3/envs/test/include']
lapack_opt_info:
    libraries = ['lapack', 'lapack', 'blas', 'blas']
    library_dirs = ['/usr/lib']
    language = f77
    define_macros = [('NO_ATLAS_INFO', 1)]
    include_dirs = ['/usr/local/include', '/usr/include', '/Users/anz/miniconda3/envs/test/include']
```
Hmm, I think the issue might be that I was messing around with my build setup, as part of trying to get the github actions working. I might just close for now.
Ok, so I think I sorted out my build setup now, into a clean venv, and homebrew install gfortran, openblas.

If I don't install `scikit-sparse` the test suite passes. If I install `scikit-sparse` (but not suite-sparse) then running the test suite fails, with the original errors.

**with sksparse installed, suite-sparse not installed**
```
>>> from scipy.optimize import linprog
>>> linprog(1, options={"presolve":False, "sparse":True, "cholesky":True})
<stdin>:1: OptimizeWarning: Sparse cholesky is only available with scikit-sparse. Setting `cholesky = False`
     con: array([], dtype=float64)
     fun: 2.4999999999987055e-09
 message: 'Optimization terminated successfully.'
     nit: 2
   slack: array([], dtype=float64)
  status: 0
 success: True
       x: array([2.5e-09])
>>> # following line doesn't error, even if suite-sparse not installed.
>>> import sksparse
>>> from sksparse.cholmod import cholesky as cholmod
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/anz/miniconda3/envs/test/lib/python3.8/site-packages/sksparse/cholmod.cpython-38-darwin.so, 2): Library not loaded: /usr/local/opt/suite-sparse/lib/libcholmod.3.0.14.dylib
  Referenced from: /Users/anz/miniconda3/envs/test/lib/python3.8/site-packages/sksparse/cholmod.cpython-38-darwin.so
  Reason: image not found
```
this is a bit weird because sksparse is installed, but the warning says that it's not. The sksparse import fails because suite-sparse is not installed.

As soon as suite-sparse is installed the tests pass.

So the behaviour seems to be:

- test suite passes if sksparse not installed
- test suite fails if sksparse installed, but suite-sparse isn't
- test suite passes if sksparse and suite-sparse installed.


Makes sense to me. SuiteSparse is a dependency of scikit-sparse.... scikit-sparse's only purpose is to wrap CHOLMOD, right? So we can change the language of the warning to emphasize that scikit-sparse needs to be properly configured, but is there anything else to be done? Besides providing general information, I don't think the warning message needs to help the user debug why scikit-sparse doesn't work.
There's probably two ways to go:

- check and only enable the relevant functionality/tests if suite-sparse *and* sksparse are installed.
- if sksparse is installed but suite-sparse isn't, then emit the correct error message, i.e. that the failures are because suite-sparse needs to be installed.

The existing error messages for the tests says "install sckit-sparse", but that's misleading if it is installed.

I have a preference for the first option, but even the second option would be better than now.
How do we check that SuiteSparse is installed? SuiteSparse is a C library, not a Python package.

If you mean scikit-sparse, that's the same as sksparse. The package name is [scikit-sparse](https://pypi.org/project/scikit-sparse/), but you `import sksparse`.
If scikit-sparse isn't installed `import sksparse` will raise an ImportError.
If suite-sparse isn't installed then `from sksparse.cholmod import cholesky as cholmod` will raise an ImportError.
may be ! this is code [scipy]

Resolving patch:
diff --git a/scipy/optimize/_linprog_ip.py b/scipy/optimize/_linprog_ip.py
--- a/scipy/optimize/_linprog_ip.py
+++ b/scipy/optimize/_linprog_ip.py
@@ -28,6 +28,7 @@
 has_umfpack = True
 has_cholmod = True
 try:
+    import sksparse
     from sksparse.cholmod import cholesky as cholmod
     from sksparse.cholmod import analyze as cholmod_analyze
 except ImportError:


Test patch:
diff --git a/scipy/optimize/tests/test_linprog.py b/scipy/optimize/tests/test_linprog.py
--- a/scipy/optimize/tests/test_linprog.py
+++ b/scipy/optimize/tests/test_linprog.py
@@ -21,6 +21,7 @@
 has_cholmod = True
 try:
     import sksparse
+    from sksparse.cholmod import cholesky as cholmod
 except ImportError:
     has_cholmod = False