Issues with the latest versions of openblas (0.3.13-1+)

Problems with packages? Post here, using [tags] of the package name.

Issues with the latest versions of openblas (0.3.13-1+)

Postby Feakster » Fri Jan 08, 2021 6:43 pm

Has anyone else had issues using the latest version of openblas with R? When trying to launch R, I got the following error message:

Code: Select all
/usr/lib/R/bin/exec/R: error while loading shared libraries: libblas.so.3: cannot open shared object file: No such file or directory


I had to downgrade openblas to version 0.3.12-1 in order to get R to launch as expected.
Feakster
 
Posts: 5
Joined: Wed Nov 11, 2020 9:49 am

Re: Issues with the latest versions of openblas (0.3.13-1+)

Postby Feakster » Tue Jan 12, 2021 5:44 pm

The issue seems to revolve around the symlink for:

Code: Select all
/usr/lib/libblas.so.3


not being created. However, I'm not sure why this is the case as the link is present in:

Code: Select all
$pkgdir/usr/lib/


when manually running makepkg on the PKGBUILD.
Feakster
 
Posts: 5
Joined: Wed Nov 11, 2020 9:49 am

Re: Issues with the latest versions of openblas (0.3.13-1+)

Postby Feakster » Wed Jan 13, 2021 8:10 pm

I've been faffing with the PKGBUILD to try some things & have made a few modifications:

  • - Bump in package release.
  • - Added 'openmp' to the "depends" array, as it's listed as an option the "make" step.
  • - Removed 'perl' from the "makedepends" array. I presume 'perl' was added by accident, in place of 'sed'.
  • - Altered the "arch" array to reflect the ARM build targets.
  • - Moved the makefile erasure and "TARGET" detection steps to the prepare() function.
  • - Refactored the "TARGET" detection sequence to use case/esac. The previous sequence would trigger errors where it formed the last call of a function. There's probably an obvious reason for this, but I lack the bash skills to fix it, so I changed it.
  • - Added the 'DYNAMIC_ARCH=1' option for aarch64 architecture. When the TARGET is set to ARMV8, this seems to result in openblas being compiled for all ARMv8 cortex targets, which does increase the build time somewhat, but may have performance benefits. I haven't been able to test this, but welcome feedback. Incidentally, this fixes the bug on aarch64 architecture where the shared object for libopenblas has "armv8" randomly shoved in its name, which had broken the symlinking.
  • - Removed some unnecessary options from the 'make install' line as they weren't doing anything.
  • - Removed the '-e' option from all 'sed' commands, as it's not required here (no multiple expression 'sed' calls.)
  • - Restructured the package() function.
  • - Added comments.
  • - Added myself to the Contributors section (as I think I've now spend enough time on this).

Code: Select all
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Giuseppe Borzi <gborzi _AT_ ieee _DOT_ org>
# Contributor: Feakster <feakster at posteo dot eu>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - set build targets
#  - clear Makefile.arm (bad cflags overrides)

pkgname=openblas
_pkgname=OpenBLAS
pkgver=0.3.13
pkgrel=2.2
pkgdesc='An optimized BLAS library based on GotoBLAS2 1.13 BSD'
arch=('arm' 'armv6h' 'armv7h' 'aarch64')
url='https://www.openblas.net/'
license=('BSD')
depends=('gcc-libs' 'openmp')
makedepends=('gcc-fortran')
provides=('blas=3.8.0') # 3.9.0? Does the version even need to be set?
conflicts=('blas')
source=("${_pkgname}-v${pkgver}.tar.gz::https://github.com/xianyi/${_pkgname}/archive/v${pkgver}.tar.gz")
sha512sums=('86e7f496587cc35d7feede99cbe3cf627ef690dd7489bb03b95f7d15ed758e32baf17d79f17b1de187184394233f60a8249a64dd53c3d59a9540db92269b7ee4')

prepare() {
    # Change Directory
    cd "$srcdir/$_pkgname-$pkgver"

    # Wipe 32-Bit ARM Makefile Contents
    truncate -s 0 Makefile.arm

    # Manually Set CONFIG Target & Opts
    case $CARCH in
        arm)
            _CONFIG='TARGET=ARMV5'
            ;;
        armv6h)
            _CONFIG='TARGET=ARMV6'
            ;;
        armv7h)
            _CONFIG='TARGET=ARMV7'
            CFLAGS=`echo $CFLAGS | sed 's/vfpv3-d16/neon/'`
            CXXFLAGS="$CFLAGS" # Used?
            ;;
        aarch64)
            _CONFIG='TARGET=ARMV8 DYNAMIC_ARCH=1'
            ;;
        *)
            echo 'CPU architecture not supported'
            exit 1
    esac
}

build() {
    # Change Directory
    cd "$srcdir/$_pkgname-$pkgver"

    # Build Libs
    make NO_STATIC=1 NO_LAPACK=1 NO_LAPACKE=1 NO_CBLAS=1 NO_AFFINITY=1 USE_OPENMP=1 \
    CFLAGS="$CPPFLAGS $CFLAGS" $_CONFIG \
    NUM_THREADS=64 MAJOR_VERSION=3 \
    libs shared
}

package() {
    # Change Directory
    cd "$srcdir/$_pkgname-$pkgver"

    # Install
    make install PREFIX="$pkgdir"/usr

    # Remove Crud
    rm -f "$pkgdir"/usr/include/cblas.h "$pkgdir"/usr/include/lapack*
    rmdir "$pkgdir"/usr/bin

    # Install License
    install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE

    # Symlink Shared Objects
    cd "$pkgdir"/usr/lib/
    ln -s libopenblasp-r$pkgver.so libblas.so
    ln -s libopenblasp-r$pkgver.so libblas.so.3

    # Mod Ancillary Files
    ln -s openblas.pc "$pkgdir"/usr/lib/pkgconfig/blas.pc
    sed -i "s|$pkgdir||" "$pkgdir"/usr/lib/pkgconfig/openblas.pc
    sed -i "s|$pkgdir||" "$pkgdir"/usr/lib/cmake/openblas/OpenBLASConfig.cmake
}

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



Looking over the PKGBUILD, I also have a few queries:

  • -Is 'gcc-fortran' required in the "makedepends" array? The GitHub README for openblas https://github.com/xianyi/OpenBLAS states that a fortran compiler is only required for the optional compilation of LAPACK, but the PKGBUILD had/has the 'NO_LAPACK=1' option set in the 'make' command.
  • - Is 'CXXFLAGS' being referenced in any way on armv7h? I've left the code in there, just in case.
  • - Should the 'provides' array not reference the latest version of blas (3.9.0)?
Feakster
 
Posts: 5
Joined: Wed Nov 11, 2020 9:49 am


Return to Packages

Who is online

Users browsing this forum: No registered users and 3 guests