diff --git a/easybuild/easyconfigs/s/SciPy-bundle/SciPy-bundle-2023.07-iimkl-2023a.eb b/easybuild/easyconfigs/s/SciPy-bundle/SciPy-bundle-2023.07-iimkl-2023a.eb new file mode 100644 index 000000000000..95d1e9f41c41 --- /dev/null +++ b/easybuild/easyconfigs/s/SciPy-bundle/SciPy-bundle-2023.07-iimkl-2023a.eb @@ -0,0 +1,117 @@ +easyblock = 'PythonBundle' + +name = 'SciPy-bundle' +version = '2023.07' + +homepage = 'https://python.org/' +description = "Bundle of Python packages for scientific software" + +toolchain = {'name': 'iimkl', 'version': '2023a'} +toolchainopts = {'pic': True, 'lowopt': True, 'strict': True} + +builddependencies = [ + ('hypothesis', '6.82.0'), + ('UnZip', '6.0'), + # scipy >= 1.9.0 uses Meson/Ninja + ('Meson', '1.1.1'), + ('Ninja', '1.11.1'), + ('pkgconf', '1.9.5'), # required by scipy +] + +dependencies = [ + ('Python', '3.11.3'), + ('Python-bundle-PyPI', '2023.06'), + ('pybind11', '2.11.1'), # required by scipy +] + +use_pip = True + +# order is important! +exts_list = [ + ('numpy', '1.25.1', { + 'patches': [ + 'numpy-1.18.2-mkl.patch', + 'numpy-1.25.1_disable_fortran_callback_test.patch', + 'numpy-1.22.3_disable-broken-override-test.patch', + 'numpy-1.25.1_disable-broken-test_long_long_map.patch', + 'numpy-1.25.1_fix_selected_kind_for_ifort.patch', + 'numpy-1.25.1_disable-broken-fortran-docstring-test.patch', + 'numpy-1.25.1_fix-test_features.patch' + ], + 'checksums': [ + {'numpy-1.25.1.tar.gz': '9a3a9f3a61480cc086117b426a8bd86869c213fc4072e606f01c4e4b66eb92bf'}, + {'numpy-1.18.2-mkl.patch': 'ea25ad5c0148c1398d282f0424e642fb9815a1a80f4512659b018e2adc378bcf'}, + {'numpy-1.25.1_disable_fortran_callback_test.patch': + '3c02bd9973b7082fde9f9d18edfeb05798226ccb5731a56f5677269200c345cf'}, + {'numpy-1.22.3_disable-broken-override-test.patch': + '9c589bb073b28b25ff45eb3c63c57966aa508dd8b318d0b885b6295271e4983c'}, + {'numpy-1.25.1_disable-broken-test_long_long_map.patch': + 'fa0fb0a16c4f1339a974c1c84b79df21dc9bfdc14e3e68f6aebaf5e30bad3fe9'}, + {'numpy-1.25.1_fix_selected_kind_for_ifort.patch': + '4e6561f44de027edf498ac29ed93115f801348a3398700271ccbf048f433b2d3'}, + {'numpy-1.25.1_disable-broken-fortran-docstring-test.patch': + '8a4d36e3b3a9c9bf43df6e5214f3883234a069b80c5c1027a7c84bd5cb133457'}, + {'numpy-1.25.1_fix-test_features.patch': + '1c05ee5d105fe2f824416dd6dd5c64ed0c1cd710a002b4e6dbfafff19203adc5'}, + ], + }), + ('ply', '3.11', { + 'checksums': ['00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3'], + }), + ('gast', '0.5.4', { + 'checksums': ['9c270fe5f4b130969b54174de7db4e764b09b4f7f67ccfc32480e29f78348d97'], + }), + ('beniget', '0.4.1', { + 'checksums': ['75554b3b8ad0553ce2f607627dad3d95c60c441189875b98e097528f8e23ac0c'], + }), + ('pythran', '0.13.1', { + 'checksums': ['8aad08162f010e5425a7b254dd68d83311b430bb29f9252dce2eff3ba39497dd'], + }), + ('versioneer', '0.29', { + 'checksums': ['5ab283b9857211d61b53318b7c792cf68e798e765ee17c27ade9f6c924235731'], + }), + ('scipy', '1.11.1', { + 'enable_slow_tests': True, + 'ignore_test_result': False, + 'patches': [ + 'scipy-1.11.1_disable-tests.patch', + 'scipy-1.11.1_xfail-aarch64_test_maxiter_worsening.patch', + 'scipy-1.11.1_disable-tests-iimkl.patch', + 'scipy-1.11.1_relaxed_test_accuracy.patch', + ], + 'checksums': [ + {'scipy-1.11.1.tar.gz': 'fb5b492fa035334fd249f0973cc79ecad8b09c604b42a127a677b45a9a3d4289'}, + {'scipy-1.11.1_disable-tests.patch': '906bfb03397d94882ccdc1b93bc2c8e854e0e060c2d107c83042992394e6a4af'}, + {'scipy-1.11.1_xfail-aarch64_test_maxiter_worsening.patch': + '918c8e6fa8215d459126f267764c961bde729ea4a116c7f6287cddfdc58ffcea'}, + {'scipy-1.11.1_disable-tests-iimkl.patch': + 'e85cf95d343fa4fd9e0045df3a030209a8d7b32a47d6da64ae1efd7b8ef827e3'}, + {'scipy-1.11.1_relaxed_test_accuracy.patch': + '2b6a7f7f58a7a8391dff52ae9565270c20c8312558b482f526be5e474ad2e675'}, + ], + }), + ('numexpr', '2.8.4', { + 'checksums': ['d5432537418d18691b9115d615d6daa17ee8275baef3edf1afbbf8bc69806147'], + }), + ('Bottleneck', '1.3.7', { + 'checksums': ['e1467e373ad469da340ed0ff283214d6531cc08bfdca2083361a3aa6470681f8'], + }), + ('tzdata', '2023.3', { + 'checksums': ['11ef1e08e54acb0d4f95bdb1be05da659673de4acbd21bf9c69e94cc5e907a3a'], + }), + ('pandas', '2.0.3', { + 'preinstallopts': "export PANDAS_CI=0 && ", + 'checksums': ['c02f372a88e0d17f36d3093a644c73cfc1788e876a7c4bcb4020a77512e2043c'], + }), + ('mpmath', '1.3.0', { + 'checksums': ['7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f'], + }), + ('deap', '1.4.0', { + 'modulename': 'deap.base', + 'checksums': ['ffef2921932a0edbe634fcb6d156189e7a364bf638a2af4ae5d59931a9a4c8cc'], + }), +] + +sanity_pip_check = True + +moduleclass = 'lang' diff --git a/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable-broken-fortran-docstring-test.patch b/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable-broken-fortran-docstring-test.patch new file mode 100644 index 000000000000..55cc2989ca9e --- /dev/null +++ b/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable-broken-fortran-docstring-test.patch @@ -0,0 +1,16 @@ +Disable test for docstrings in fortran extension modules, as it fails due to an error +in autogenerated test code (int * versus npy_intp*). + +Author: Jakob Schiotz (Techn. Univ. Denmark) + +--- numpy/f2py/tests/test_module_doc.old 2023-10-23 15:49:00.858332420 +0200 ++++ numpy/f2py/tests/test_module_doc.py 2023-10-23 15:50:04.072826243 +0200 +@@ -7,7 +7,7 @@ + from numpy.testing import IS_PYPY + + +-class TestModuleDocString(util.F2PyTest): ++class Disabled_for_intel_TestModuleDocString(util.F2PyTest): + sources = [ + util.getpath("tests", "src", "module_data", + "module_data_docstring.f90") diff --git a/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable-broken-test_long_long_map.patch b/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable-broken-test_long_long_map.patch new file mode 100644 index 000000000000..c79e894951a1 --- /dev/null +++ b/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable-broken-test_long_long_map.patch @@ -0,0 +1,15 @@ +Disable test that imports a fortran function, it breaks on iimkl toolchain. + +Author: Jakob Schiotz (Techn. Univ. Denmark) + +--- numpy-1.25.1/numpy/f2py/tests/test_value_attrspec.old 2023-07-08 21:25:45.000000000 +0200 ++++ numpy-1.25.1/numpy/f2py/tests/test_value_attrspec.py 2023-09-27 11:21:32.172791528 +0200 +@@ -7,7 +7,7 @@ + sources = [util.getpath("tests", "src", "value_attrspec", "gh21665.f90")] + + # gh-21665 +- def test_long_long_map(self): ++ def ignored_test_long_long_map(self): + inp = 2 + out = self.module.fortfuncs.square(inp) + exp_out = 4 diff --git a/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable_fortran_callback_test.patch b/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable_fortran_callback_test.patch new file mode 100644 index 000000000000..8bd095ba002b --- /dev/null +++ b/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_disable_fortran_callback_test.patch @@ -0,0 +1,17 @@ +Disable TestF90Callback which fails when compiling the resulting code with ifort. +The resulting code is incorrect Fortran. +See https://github.com/numpy/numpy/issues/20157 + +Åke Sandgren, 20211021 +Updated: Jakob Schiøtz, 20230927 +--- numpy-1.25.1/numpy/f2py/tests/test_callback.old 2023-09-27 14:15:21.076625096 +0200 ++++ numpy-1.25.1/numpy/f2py/tests/test_callback.py 2023-09-27 14:15:46.401827839 +0200 +@@ -202,7 +202,7 @@ + options = ["-DF2PY_USE_PYTHON_TLS"] + + +-class TestF90Callback(util.F2PyTest): ++class Disabled_for_intel_TestF90Callback(util.F2PyTest): + sources = [util.getpath("tests", "src", "callback", "gh17797.f90")] + + def test_gh17797(self): diff --git a/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_fix_selected_kind_for_ifort.patch b/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_fix_selected_kind_for_ifort.patch new file mode 100644 index 000000000000..6b20bc7fb274 --- /dev/null +++ b/easybuild/easyconfigs/s/SciPy-bundle/numpy-1.25.1_fix_selected_kind_for_ifort.patch @@ -0,0 +1,65 @@ +Intel Fortran compiler does not support 10-byte reals, nor 16-byte integers. +The f2py module needs to know the supported types to reliably build Fortran extensions. + +This patch was inspired by the discussion at https://github.com/numpy/numpy/issues/13053 +in particular the comments at + https://github.com/numpy/numpy/issues/13053#issuecomment-470314843 +and + https://github.com/numpy/numpy/issues/13053#issuecomment-471008975 +by GitHub user @oleksandr-pavlyk + +Author: Jakob Schiotz (Tech. U. Denmark) + +--- numpy/f2py/crackfortran.py.old 2023-10-23 14:39:51.510964440 +0200 ++++ numpy/f2py/crackfortran.py 2023-10-23 15:10:21.963115914 +0200 +@@ -2385,7 +2385,8 @@ + return 'kind(' + string + ')' + + +-def _selected_int_kind_func(r): ++def _selected_int_kind_func_intel(r): ++ # Intel(R) Fortran compiler only supports kinds 1, 2, 4, 8. + # XXX: This should be processor dependent + m = 10 ** r + if m <= 2 ** 8: +@@ -2396,29 +2397,27 @@ + return 4 + if m <= 2 ** 63: + return 8 +- if m <= 2 ** 128: +- return 16 ++ # Not supported by ifort ++ #if m <= 2 ** 128: ++ # return 16 + return -1 + ++_selected_int_kind_func = _selected_int_kind_func_intel + +-def _selected_real_kind_func(p, r=0, radix=0): ++def _selected_real_kind_func_intel(p, r=0, radix=0): ++ # Intel(R) Fotran compiler only supports kinds 4, 8, 16 + # XXX: This should be processor dependent +- # This is only verified for 0 <= p <= 20, possibly good for p <= 33 and above ++ # This is only good for 0 <= p <= 20 + if p < 7: + return 4 + if p < 16: + return 8 +- machine = platform.machine().lower() +- if machine.startswith(('aarch64', 'arm64', 'power', 'ppc', 'riscv', 's390x', 'sparc')): +- if p <= 33: +- return 16 +- else: +- if p < 19: +- return 10 +- elif p <= 33: +- return 16 ++ if p <= 33: ++ return 16 + return -1 + ++_selected_real_kind_func = _selected_real_kind_func_intel ++ + + def get_parameters(vars, global_params={}): + params = copy.copy(global_params) diff --git a/easybuild/easyconfigs/s/SciPy-bundle/scipy-1.11.1_disable-tests-iimkl.patch b/easybuild/easyconfigs/s/SciPy-bundle/scipy-1.11.1_disable-tests-iimkl.patch new file mode 100644 index 000000000000..6ec02dee408c --- /dev/null +++ b/easybuild/easyconfigs/s/SciPy-bundle/scipy-1.11.1_disable-tests-iimkl.patch @@ -0,0 +1,43 @@ +Skip tests that fail when compiling with iimkl/2023a: + +Disable PROPACK test for complex, as it appears to be broken when +using Intel compiler. The tests were already skipped in a few other +cases for similar reasons. + +Skip test test_x0_equals_Mb[bicgstab-nonsymposdef-F], it fails to +converge. Many other solvers are skipped with this test case for +similar reasons, although it is worrying that it works with OpenBLAS +and not with MKL. + +Author: Jakob Schiotz (Techn. Univ. Denmark) + +--- scipy/sparse/linalg/tests/test_propack.py.old 2023-10-24 12:12:17.722133108 +0200 ++++ scipy/sparse/linalg/tests/test_propack.py 2023-10-24 12:14:02.072938068 +0200 +@@ -34,14 +34,8 @@ + for dtype_flavour in TOLS.keys(): + marks = [] + if is_complex_type(dtype_flavour): +- if is_32bit(): +- # PROPACK has issues w/ complex on 32-bit; see gh-14433 +- marks = [pytest.mark.skip] +- elif is_windows() and np.dtype(dtype_flavour).itemsize == 16: +- # windows crashes for complex128 (so don't xfail); see gh-15108 +- marks = [pytest.mark.skip] +- else: +- marks = [pytest.mark.slow] # type: ignore[list-item] ++ # PROPACK crashes for complex with Intel compiler. ++ marks = [pytest.mark.skip] + _dtypes.append(pytest.param(dtype_flavour, marks=marks, + id=dtype_flavour.__name__)) + _dtypes = tuple(_dtypes) # type: ignore[assignment] +--- scipy/sparse/linalg/_isolve/tests/test_iterative.py.old 2023-10-24 17:07:24.697195558 +0200 ++++ scipy/sparse/linalg/_isolve/tests/test_iterative.py 2023-10-24 17:07:46.106361595 +0200 +@@ -162,7 +162,7 @@ + self.cases.append(Case("nonsymposdef", A, + skip=sym_solvers + [cgs, qmr, bicg, tfqmr])) + self.cases.append(Case("nonsymposdef-F", A.astype('F'), +- skip=sym_solvers + [cgs, qmr, bicg, tfqmr])) ++ skip=sym_solvers + [cgs, qmr, bicg, bicgstab, tfqmr])) + + # Symmetric, non-pd, hitting cgs/bicg/bicgstab/qmr/tfqmr breakdown + A = np.array([[0, 0, 0, 0, 0, 1, -1, -0, -0, -0, -0], diff --git a/easybuild/easyconfigs/s/SciPy-bundle/scipy-1.11.1_relaxed_test_accuracy.patch b/easybuild/easyconfigs/s/SciPy-bundle/scipy-1.11.1_relaxed_test_accuracy.patch new file mode 100644 index 000000000000..df99f4a7389e --- /dev/null +++ b/easybuild/easyconfigs/s/SciPy-bundle/scipy-1.11.1_relaxed_test_accuracy.patch @@ -0,0 +1,110 @@ +Backported test from main branch of scipy on Github, relaxing the +tolerances of a few tests. Some of these fail with the Intel +compiler. + +The patch has been edited directly to backport it (np.double had been replaced +by np.float64 in the main branch), and one patch was to code that is not in +scipy-1.11.1. + +Backported by: Jakob Schiotz (Techn. Univ. Denmark) + +Original description: + +From a4fba82078d2e95005343150d821ccd33cb5de20 Mon Sep 17 00:00:00 2001 +From: Ralf Gommers +Date: Wed, 6 Sep 2023 15:08:59 +0200 +Subject: [PATCH] TST: test tolerance bumps to fix reported failures + +Closes gh-19117 + +The `test_sygst` one was reported in gh-19153. +--- + scipy/fft/_pocketfft/tests/test_real_transforms.py | 2 +- + scipy/linalg/tests/test_lapack.py | 2 +- + scipy/ndimage/tests/test_datatypes.py | 4 +++- + scipy/spatial/transform/tests/test_rotation.py | 8 ++++---- + scipy/special/tests/test_hyp2f1.py | 6 +++--- + 5 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/scipy/fft/_pocketfft/tests/test_real_transforms.py b/scipy/fft/_pocketfft/tests/test_real_transforms.py +index d1f4e1d..a217e75 100644 +--- a/scipy/fft/_pocketfft/tests/test_real_transforms.py ++++ b/scipy/fft/_pocketfft/tests/test_real_transforms.py +@@ -239,7 +239,7 @@ dec_map: DecMapType = { + (dst, np.float32, 3): 7, + + (dst, np.double, 4): 13, +- (dst, np.float32, 4): 6, ++ (dst, np.float32, 4): 5, + + # IDST + (idst, np.double, 1): 14, +diff --git a/scipy/linalg/tests/test_lapack.py b/scipy/linalg/tests/test_lapack.py +index 6c64a2a..2c994f6 100644 +--- a/scipy/linalg/tests/test_lapack.py ++++ b/scipy/linalg/tests/test_lapack.py +@@ -1031,7 +1031,7 @@ def test_sygst(): + + eig, _, info = syevd(a) + assert_(info == 0) +- assert_allclose(eig, eig_gvd, rtol=1e-4) ++ assert_allclose(eig, eig_gvd, rtol=1.2e-4) + + + def test_hegst(): +diff --git a/scipy/ndimage/tests/test_datatypes.py b/scipy/ndimage/tests/test_datatypes.py +index 327cc5a..1eb056b 100644 +--- a/scipy/ndimage/tests/test_datatypes.py ++++ b/scipy/ndimage/tests/test_datatypes.py +@@ -45,7 +45,7 @@ def test_map_coordinates_dts(): + assert_array_almost_equal(these_data, out) + + +-@pytest.mark.xfail(not sys.platform == 'darwin', reason="runs only on darwin") ++@pytest.mark.xfail(True, reason="Broken on many platforms") + def test_uint64_max(): + # Test interpolation respects uint64 max. Reported to fail at least on + # win32 (due to the 32 bit visual C compiler using signed int64 when +@@ -53,6 +53,8 @@ def test_uint64_max(): + # Interpolation is always done in double precision floating point, so + # we use the largest uint64 value for which int(float(big)) still fits + # in a uint64. ++ # This test was last enabled on macOS only, and there it started failing ++ # on arm64 as well (see gh-19117). + big = 2**64 - 1025 + arr = np.array([big, big, big], dtype=np.uint64) + # Tests geometric transform (map_coordinates, affine_transform) +diff --git a/scipy/special/tests/test_hyp2f1.py b/scipy/special/tests/test_hyp2f1.py +index 2fe732f..200d4bb 100644 +--- a/scipy/special/tests/test_hyp2f1.py ++++ b/scipy/special/tests/test_hyp2f1.py +@@ -474,7 +474,7 @@ class TestHyp2f1: + c=-15.5, + z=(1.1578947368421053-1.1578947368421053j), + expected=(0.9778506962676361+0.044083801141231616j), +- rtol=1e-12, ++ rtol=3e-12, + ), + ), + pytest.param( +@@ -1378,7 +1378,7 @@ class TestHyp2f1: + c=-7.949900487447654, + z=(0.4172413793103451-0.8724137931034484j), + expected=(-2258.1590330318213+8860.193389158803j), +- rtol=1e-10, ++ rtol=1.4e-10, + ), + ), + ] +@@ -1433,7 +1433,7 @@ class TestHyp2f1: + c=-15.964218273004214, + z=(0.6448275862068968+0.8724137931034486j), + expected=(85592537010.05054-8061416766688.324j), +- rtol=1e-14, ++ rtol=2e-14, + ), + ), + pytest.param( +-- +1.8.3.1 +