Issue 1:
Description

When I try to build scikit-learn on NixOS with numpy/scipy compiled with MKL, the build succeeds but tests fail:

=================================== FAILURES ===================================
_________________________________ test_omp_cv __________________________________

def test_omp_cv():
y_ = y[:, 0]
gamma_ = gamma[:, 0]
ompcv = OrthogonalMatchingPursuitCV(normalize=True, fit_intercept=False,
max_iter=10, cv=5)
ompcv.fit(X, y_)
> assert_equal(ompcv.n_nonzero_coefs_, n_nonzero_coefs)

/nix/store/7sz7kr8szqhmy75mx2hxbfz3wvgq2iyx-python3.7-scikit-learn-0.21.2/lib/python3.7/site-packages/sklearn/linear_model/tests/test_omp.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/4g2ilwnk4mj4g68rc52kygx7gcqxnjd0-python3-3.7.5/lib/python3.7/unittest/case.py:852: in assertEqual
assertion_func(first, second, msg=msg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <sklearn.utils._unittest_backport.TestCase testMethod=__init__>
first = 6, second = 5, msg = '6 != 5'

def _baseAssertEqual(self, first, second, msg=None):
"""The default assertEqual implementation, not type specific."""
if not first == second:
standardMsg = '%s != %s' % _common_shorten_repr(first, second)
msg = self._formatMessage(msg, standardMsg)
> raise self.failureException(msg)
E AssertionError: 6 != 5

/nix/store/4g2ilwnk4mj4g68rc52kygx7gcqxnjd0-python3-3.7.5/lib/python3.7/unittest/case.py:845: AssertionError

Steps/Code to Reproduce

Using nix, can reproduce with:

> curl https://nixos.org/nix/install | sh # install nix (follow instructions if needed)
> nix-shell -p 'python3.withPackages(ps: with ps; [ scikitlearn ])'
[success]
> nix-shell -p '(python37.override {packageOverrides = self: super: { numpy = super.numpy.override { blas = mkl;}; }; } ).withPackages(ps: with ps; [ scikitlearn ])'
[fail]

full output: https://gist.github.com/tbenst/f32351229c0330edf3aefa003e6c1053

Thanks for any tips / pointers!

Versions

python: 3.7.5

scikit-learn: 0.21.2

numpy: 1.17.3

scipy: 1.3.1

Issue 2:
In newly released scikit-learn 0.20.1 (and actually in 0.20.0) test_omp_cv case fails during running test suite. Any help appreciated!

_______________________________ test_omp_cv _______________________________

def test_omp_cv():
y_ = y[:, 0]
gamma_ = gamma[:, 0]
ompcv = OrthogonalMatchingPursuitCV(normalize=True, fit_intercept=False,
max_iter=10, cv=5)
ompcv.fit(X, y_)
> assert_equal(ompcv.n_nonzero_coefs_, n_nonzero_coefs)

/usr/local/lib/python3.6/dist-packages/scikit_learn-0.20.1-py3.6-linux-x86_64.egg/sklearn/linear_model/tests/test_omp.py:209:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.6/unittest/case.py:829: in assertEqual
assertion_func(first, second, msg=msg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <sklearn.utils._unittest_backport.TestCase testMethod=__init__>, first = 6, second = 5, msg = '6 != 5'

def _baseAssertEqual(self, first, second, msg=None):
"""The default assertEqual implementation, not type specific."""
if not first == second:
standardMsg = '%s != %s' % _common_shorten_repr(first, second)
msg = self._formatMessage(msg, standardMsg)
> raise self.failureException(msg)
E AssertionError: 6 != 5

/usr/lib/python3.6/unittest/case.py:822: AssertionError

Versions

System:

python: 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]

executable: /usr/bin/python3

machine: Linux-4.15.0-39-generic-x86_64-with-Ubuntu-18.04-bionic

BLAS:

macros: SCIPY_MKL_H=None, HAVE_CBLAS=None

lib_dirs: /opt/intel/mkl/lib/intel64

cblas_libs: mkl_rt, pthread

Python deps:

pip: 18.1

setuptools: 40.6.2

sklearn: 0.20.1

numpy: 1.15.4

scipy: 1.1.0

Cython: 0.29

pandas: None