Package Details: python-slycot 0.5.0.0-1

Git Clone URL: https://aur.archlinux.org/python-slycot.git (read-only, click to copy)
Package Base: python-slycot
Description: Python wrapper for selected SLICOT routines, notably including solvers for Riccati, Lyapunov and Sylvester equations.
Upstream URL: http://github.com/python-control/Slycot
Licenses: GPL2
Conflicts: python-slycot-git
Provides: python-slycot
Submitter: bnavigator
Maintainer: bnavigator
Last Packager: bnavigator
Votes: 1
Popularity: 0.000000
First Submitted: 2019-09-27 15:16 (UTC)
Last Updated: 2022-07-09 15:59 (UTC)

Latest Comments

1 2 Next › Last »

Jona commented on 2023-09-16 11:39 (UTC)

I can confirm that the changes done in PKGBUILD are working ok on aarch64 (RaspberryPi 400, but for any other board the result should be the same), using makepkg.

Jona commented on 2023-09-14 19:12 (UTC) (edited on 2023-09-14 19:37 (UTC) by Jona)

For those struggling with this package not building with current numpy, if the maintainer has some spare time, he can update the PKGBUILD to get this working:

_name=slycot
pkgname="python-${_name}"
pkgver=0.5.4
pkgrel=1
pkgdesc="Python wrapper for selected SLICOT routines, notably including solvers for Riccati, Lyapunov and Sylvester equations."
arch=('i686' 'x86_64')
url="http://github.com/python-control/Slycot"
license=('GPL2')
depends=('python-numpy')
makedepends=(
  'blas'
  'cmake'
  'gcc-fortran'
  'lapack'
  'python-build'
  'python-installer'
  'python-scikit-build>=0.14.1'
  'python-setuptools'
  'python-setuptools-scm'
  'python-numpy'
)
opts=(!strip)
optdepends=()
checkdepends=('python-pytest' 'python-scipy')
provides=('python-slycot')
conflicts=('python-slycot-git')
source=(https://files.pythonhosted.org/packages/source/s/$_name/$_name-$pkgver.tar.gz)
sha256sums=('0bcb6e6322d955bfe696a549cb09c1f16272cbbdd09453cb82ea7193ed3d01c6')

build() {
  cd "$srcdir/${_name}-${pkgver}"
  # Link against the Generic NetLIB blas/lapack ABI. If openblas is installed
  # instead of blas, that one will provide the library. Same mechanism as in
  # Extra/python-numpy
  export BLA_VENDOR=Generic
  export CMAKE_GENERATOR="Unix Makefiles"
  # -x: don't check for cmake python metadata
  python -m build --wheel --no-isolation -x
}

check() {
  export PYTHONDONTWRITEBYTECODE=1
  local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
  export PYTHONPATH="${srcdir}/${_name}-${pkgver}/_skbuild/linux-$CARCH-$python_version/setuptools/lib.linux-$CARCH-cpython-${python_version//./}"
  pytest --pyargs slycot -k "not (test_mb03rd or test_tg01fd)"
}

package() {
  export LDFLAGS="$LDFLAGS -shared"

  cd "$srcdir/${_name}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl

  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

# vim:set ts=2 sw=2 et:

bnavigator commented on 2022-07-09 16:22 (UTC)

scikit-build does not work with numpy 1.23.0.

You have to have numpy 1.22 installed during the build of python-slycot. Upgrading to numpy 1.23.0 is possible after installation of python-slycot.

carlosal1015 commented on 2021-10-15 19:35 (UTC)

Thanks @bnavigator. I post the issue here.

bnavigator commented on 2021-10-15 18:32 (UTC)

@carlosal1015

Looks like a new or different version of BLAS/LAPACK returns a differently scaled value for a eigensolution. Not necessarily wrong. Just not expected by the Slycot tests. Could you please open an issue upstream at https://github.com/python-control/Slycot/issues so that the developers (which I am a member of) can look at it?

carlosal1015 commented on 2021-10-15 17:51 (UTC)

Hi, I have the following message error from the last pkgrel changed.

bnavigator commented on 2020-10-02 14:16 (UTC) (edited on 2020-10-02 15:03 (UTC) by bnavigator)

I am not saying we do not support MKL upstream. In fact the conda packages used to build against MKL. I do not know the current status, it looks like they reverted that. Upstream still has the recipe in the repository with python setup.py build_ext -lmkl -DBLA_VENDOR=Intel10_64lp

Removing the check is not an option, it makes sure that the built package actually works. Did you try to use the installed slycot yet? Chances are, that the link to your installed MKL lib is broken there too.

To disable the check use makepkg --nocheck (or yay --mflags --nocheck). To force a specific LAPACK implementation, set BLA_VENDOR.

acxz commented on 2020-10-02 13:14 (UTC) (edited on 2020-10-02 13:22 (UTC) by acxz)

According to upstream: https://github.com/python-control/Slycot#dependencies last bullet

They mention that MKL is a valid BLAS/LAPACK package to use.

Although installing MKL and rebuilding python-slycot finishes successfully. Thx for you help in debugging this. I post an issue upstream. (https://github.com/python-control/Slycot/issues/138)

In the meanwhile, would it be possible to comment out the check function to prevent this issue from appearing for other users. Right now when installing/updating python-slycot I will need to uninstall intel-mkl and reinstall it after python-slycot has been installed.

bnavigator commented on 2020-10-02 13:01 (UTC) (edited on 2020-10-02 13:05 (UTC) by bnavigator)

Yes those versions are the same (ignore the plugins, the are not used here). More interesting would be the numpy and blas/lapack versions.

-- Found NumPy: /usr/lib/python3.8/site-packages/numpy/core/include (found version "1.19.2") 
...
-- A library with LAPACK API found.
-- NumPy: /usr/lib/python3.8/site-packages/numpy/core/include
-- LAPACK: /usr/lib/liblapack.so;/usr/lib/libopenblas.so
-- BLAS: /usr/lib/libopenblas.so
-- Slycot version: 0.4.0
-- Found F2PY: /usr/bin/f2py3 (found version "2") 
...
==> Starting check()...
================================================== test session starts ==================================================
platform linux -- Python 3.8.5, pytest-6.1.0, py-1.9.0, pluggy-0.13.1
rootdir: /home/ben/src/pkgbuild/python-slycot/src
plugins: shutil-1.7.0, virtualenv-1.7.0, mock-2.0.0, cov-2.10.1
collected 108 items                                                                                                     

slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_ab01.py .                               [  0%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_ab08n.py ..                             [  2%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_ag08bd.py ....                          [  6%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_analysis.py ...................         [ 24%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_examples.py .............               [ 36%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_exceptions.py ...                       [ 38%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_mb.py ..........                        [ 48%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_mc.py ...                               [ 50%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_sb.py .............................     [ 77%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_sg02ad.py .                             [ 78%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_sg03ad.py ...                           [ 81%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_tb05ad.py ......                        [ 87%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_td04ad.py .......                       [ 93%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_tg01ad.py .                             [ 94%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_tg01fd.py ..                            [ 96%]
slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_transform.py ....                       [100%]

================================================== 108 passed in 1.93s ==================================================
==> Entering fakeroot environment...

...

% LC_ALL=C pacman -Qo /usr/lib/libopenblas.so                            [0]
/usr/lib/libopenblas.so is owned by openblas 0.3.10-1

Edit: Yep you are trying to use a custom lapack/blas implementation: Intel MKL. Archlinux cannot help here. Maybe I can help you upstream when you open an issue on GitHub and provide as much details about your installation as possible, but be aware that it might be just your custom setup which is not supported.

acxz commented on 2020-10-02 12:45 (UTC) (edited on 2020-10-02 12:56 (UTC) by acxz)

Hello @bnavigator, thx for maintaining this package! I am having some trouble when installing this package, in particular the check() is failing for me. Commenting out the check() functions allows me to complete the successful install of the package.

Here is the error with the check function:

==> Starting check()...
================================================== test session starts ===================================================
platform linux -- Python 3.8.5, pytest-6.1.0, py-1.9.0, pluggy-0.13.1
rootdir: /home/acxz/.cache/yay/python-slycot/src
collected 108 items                                                                                                      

slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_ab01.py ==> ERROR: A failure occurred in check().
    Aborting...

Honestly doesn't seem very informative. Maybe I should also post upstream? Can you confirm that the versions under test session starts are the same for you? Thanks

Edit: Looking a bit deeper (i.e. running the test manually by adding a main and calling the test function directly in the file) I see the follow error:

INTEL MKL ERROR: /opt/intel/mkl/lib/intel64/libmkl_avx2.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.
Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so.