Package Details: cnmatrix 0.0-2

Git Clone URL: https://aur.archlinux.org/cnmatrix.git (read-only, click to copy)
Package Base: cnmatrix
Description: C interface to a few matrix backends
Upstream URL: https://github.com/cntools/cnmatrix/
Licenses: MIT
Submitter: dbermond
Maintainer: dbermond
Last Packager: dbermond
Votes: 0
Popularity: 0.000000
First Submitted: 2022-08-02 22:50 (UTC)
Last Updated: 2024-05-05 15:35 (UTC)

Latest Comments

dbermond commented on 2025-03-05 00:31 (UTC)

@dreieck no, repository blas-openblas does not ship a 'cblas.h' header currently. openblas, a dependency for blas-openblas, do ship it, but not in the same directory of the reference cblas package. If there is a fix to be made, it would be in the openblas package (for example, placing or symlinking the headers in the same place as cblas), and not here. You can open an issue and ask for it. Imagine if there would be something like 50 cblas providers, each one shipping 'cblas.h' in a different directory than cblas does (like openblas do). Would we need to add 50 workarounds/fixes here for each provider? No, it does make sense to solve this here in the client package level.

dreieck commented on 2025-03-04 20:12 (UTC) (edited on 2025-03-04 20:29 (UTC) by dreieck)

cblas.h actually is present in blas-openblas:

/usr/include/openblas/cblas.h

pkgconf --cflags cblas says

-I/usr/include/openblas

It turns out that adding the following to build() does fix the issue:

    _CFLAGSADDITIONS="$(pkgconf --cflags cblas)"
    CFLAGS+=" ${_CFLAGSADDITIONS}"
    CXXFLAGS+=" ${_CFLAGSADDITIONS}"
    export CFLAGS
    export CXXFLAGS

-- this way the correct include directory will be added to the GCC command line, independent of the package that provides cblas.

dbermond commented on 2025-03-04 12:46 (UTC) (edited on 2025-03-04 12:47 (UTC) by dbermond)

@dreieck This is not an issue of this package. The package builds fine with cblas. Your cblas provider (blas-openblas) does not ship the 'cblas.h' header, so it obviously will not work. You have to install cblas to build this package, and then switch to your cblas provider. If you cannot uninstall blas-openblas due to it being required for something else, build the package in a clean chroot.

dreieck commented on 2025-03-04 11:50 (UTC)

Ahoj,

build() fails for me with fatal error: cblas.h: No such file or directory:

[ 40%] Building C object src/CMakeFiles/cnmatrix.dir/cn_matrix.c.o
/var/cache/makepkg/build/cnmatrix/src/cnmatrix-0.0/src/cn_matrix.blas.c:1:10: fatal error: cblas.h: No such file or directory
    1 | #include <cblas.h>
      |          ^~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/cnmatrix.dir/build.make:93: src/CMakeFiles/cnmatrix.dir/cn_matrix.blas.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1053: src/CMakeFiles/cnmatrix.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

As cblas provider I have installed blas-openblas.

Regards and thanks for the package!