Skip to contentSkip to conversation

lapack: add PACKAGECONFIG for cblas

PATCH New Martin Jansa 1 participant 3 messages Jan 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 lapack: add PACKAGECONFIG for cblas

---
 meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb +1 -0
index 4357515b71..aafcdef681 100644
@@ -24,6 +24,7 @@ S = "${WORKDIR}/git"
 
 PACKAGECONFIG ?= ""
 PACKAGECONFIG[lapacke] = "-DLAPACKE=ON,-DLAPACKE=OFF"
+PACKAGECONFIG[cblas] = "-DCBLAS=ON,-DCBLAS=OFF"
 
 EXTRA_OECMAKE = " -DBUILD_SHARED_LIBS=ON \
                   ${@bb.utils.contains('PTEST_ENABLED', '1', ' -DBUILD_TESTING=ON', '', d)} \
Signature · 1 line
2.48.1
#1 lore raw

PATCH 2/3 lapack: fix buildpaths in ptest also when CBLAS is enabled

ERROR: lapack-3.12.0-r0 do_package_qa: QA Issue:
File /usr/lib/lapack/ptest/bin/xccblat3 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xdcblat3 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xdcblat1 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xscblat1 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xccblat2 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xzcblat2 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xzcblat1 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xccblat1 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xdcblat2 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xscblat2 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xscblat3 in package lapack-ptest contains reference to TMPDIR File /usr/lib/lapack/ptest/bin/xzcblat3 in package lapack-ptest contains reference to TMPDIR [buildpaths]

---
 .../recipes-devtools/lapack/lapack_3.12.0.bb  | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb +17 -6
index aafcdef681..4845d34106 100644
@@ -35,7 +35,12 @@ inherit cmake pkgconfig ptest
 EXCLUDE_FROM_WORLD = "1"
 
 # The `xerbla.o` file contains an absolute path in `xerbla.f.o`, but the options
-# `-fdebug-prefix-map` and `-ffile-prefix-map` cannot be used because gfortran does not support them.
+# `-fdebug-prefix-map` and `-ffile-prefix-map` cannot be used because gfortran does
+# not support them. And we cannot easily change CMake to use relative paths, because
+# it will convert them to absolute paths when generating Unix Makefiles or Ninja:
+# https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#why-does-cmake-use-full-paths-or-can-i-copy-my-build-tree
+# https://gitlab.kitware.com/cmake/cmake/-/issues/13894
+#
 # To address this issue, we manually replace the absolute path with a relative path
 # in the generated `build.make` file.
 #
@@ -46,7 +51,7 @@ EXCLUDE_FROM_WORLD = "1"
 # of `xerbla.f` to a relative path. The steps are as follows:
 #
 # 1. Locate all `build.make` files after the `do_configure` step is completed.
-# 2. Compute the relative path for `xerbla.f` based on the current build directory.
+# 2. Compute the relative path for various `*.f` files based on the current build directory.
 # 3. Replace the absolute path with the calculated relative path in the `build.make` files
 #
 # Additionally, when ptests are enabled, apply a simpler workaround for ptest code:
@@ -54,11 +59,17 @@ EXCLUDE_FROM_WORLD = "1"
 #   the MATGEN subdirectory, with a relative path prefix of `"../../.."`.
 do_configure:append(){
     for file in `find ${B} -name build.make`; do
-        sed -i -e "s#\(.*-c \).*\(/xerbla\.f \)#\1$(grep '\-c .*xerbla\.f' $file | awk -F'cd ' '{print $2}'| \
-            awk '{src=$1; sub(/.*-c /, ""); sub(/xerbla\.f.*/, ""); obj=$0; print src, obj}' | \
-            while read src obj; do echo "$(realpath --relative-to="$src" "$obj")"; done)\2#g" $file
+        # Replacing all .f files found with:
+        # for f in $(find ${S} -name \*.f -printf " %f" | sort -u); do
+        # would be more reliable with other optional PACKAGECONFIGs, but also very slow as there are
+        # ~ 3500 of them and this loop takes around 20 minutes
+        for f in xerbla c_cblat1 c_cblat2 c_cblat3 c_dblat1 c_dblat2 c_dblat3 c_sblat1 c_sblat2 c_sblat3 c_zblat1 c_zblat2 c_zblat3; do
+            sed -i -e "s#\(.*-c \).*\(/$f\.f \)#\1$(grep "\-c .*$f\.f" $file | awk -F'cd ' '{print $2}'| \
+                awk "{src=\$1; sub(/.*-c /, \"\"); sub(/$f\.f.*/, \"\"); obj=\$0; print src, obj}" | \
+                while read src obj; do echo "$(realpath --relative-to="$src" "$obj")"; done)\2#g" $file
+         done
     done
-    if (${@bb.utils.contains('PTEST_ENABLED', '1', 'true', 'false', d)});then
+    if ${@bb.utils.contains('PTEST_ENABLED', '1', 'true', 'false', d)} ; then
         for file in `find . -name build.make -path '*TESTING*' -not -path '*MATGEN*'`; do
             sed -i -e "s#\(.*-c \)\(${WORKDIR}\)\(.*.[f|F] \)#\1../../..\3#g" $file
         done
Signature · 1 line
2.48.1
#2 lore raw

PATCH 3/3 lapack: upgrade to latest 3.12.1

In reply to Martin Jansa

* adjust the list of .f files to cover also newly used .f90 files, causing:
http://errors.yoctoproject.org/Errors/Details/840502/

ERROR: lapack-3.12.1-r0 do_package_qa: QA Issue: File /usr/lib/lapack/ptest/bin/xdmdeigtsts in package lapack-ptest contains reference to TMPDIR [buildpaths]
ERROR: lapack-3.12.1-r0 do_package_qa: QA Issue: File /usr/lib/lapack/ptest/bin/xdmdeigtstd in package lapack-ptest contains reference to TMPDIR [buildpaths]
ERROR: lapack-3.12.1-r0 do_package_qa: QA Issue: File /usr/lib/lapack/ptest/bin/xdmdeigtstz in package lapack-ptest contains reference to TMPDIR [buildpaths]
ERROR: lapack-3.12.1-r0 do_package_qa: QA Issue: File /usr/lib/lapack/ptest/bin/xdmdeigtstc in package lapack-ptest contains reference to TMPDIR [buildpaths]
ERROR: lapack-3.12.1-r0 do_package_qa: Fatal QA errors were found, failing task.

---
 .../lapack/{lapack_3.12.0.bb => lapack_3.12.1.bb}         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
 rename meta-oe/recipes-devtools/lapack/{lapack_3.12.0.bb => lapack_3.12.1.bb} (90%)
meta-oe/recipes-devtools/lapack/lapack_3.12.1.bb renamed from meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb +4 -4
similarity index 90%
rename from meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb
rename to meta-oe/recipes-devtools/lapack/lapack_3.12.1.bb
index 4845d34106..87a5747246 100644
@@ -16,7 +16,7 @@ DEPENDS = "libgfortran \
           "
 RDEPENDS:${PN}-ptest += "cmake"
 
-SRCREV = "04b044e020a3560ccfa9988c8a80a1fb7083fc2e"
+SRCREV = "5ebe92156143a341ab7b14bf76560d30093cfc54"
 SRC_URI = "git://github.com/Reference-LAPACK/lapack.git;protocol=https;branch=master \
            ${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \
           "
@@ -63,9 +63,9 @@ do_configure:append(){
         # for f in $(find ${S} -name \*.f -printf " %f" | sort -u); do
         # would be more reliable with other optional PACKAGECONFIGs, but also very slow as there are
         # ~ 3500 of them and this loop takes around 20 minutes
-        for f in xerbla c_cblat1 c_cblat2 c_cblat3 c_dblat1 c_dblat2 c_dblat3 c_sblat1 c_sblat2 c_sblat3 c_zblat1 c_zblat2 c_zblat3; do
-            sed -i -e "s#\(.*-c \).*\(/$f\.f \)#\1$(grep "\-c .*$f\.f" $file | awk -F'cd ' '{print $2}'| \
-                awk "{src=\$1; sub(/.*-c /, \"\"); sub(/$f\.f.*/, \"\"); obj=\$0; print src, obj}" | \
+        for f in xerbla.f c_cblat1.f c_cblat2.f c_cblat3.f c_dblat1.f c_dblat2.f c_dblat3.f c_sblat1.f c_sblat2.f c_sblat3.f c_zblat1.f c_zblat2.f c_zblat3.f cchkdmd.f90 dchkdmd.f90 schkdmd.f90 zchkdmd.f90; do
+            sed -i -e "s#\(.*-c \).*\(/$f \)#\1$(grep "\-c .*$f" $file | awk -F'cd ' '{print $2}'| \
+                awk "{src=\$1; sub(/.*-c /, \"\"); sub(/$f.*/, \"\"); obj=\$0; print src, obj}" | \
                 while read src obj; do echo "$(realpath --relative-to="$src" "$obj")"; done)\2#g" $file
          done
     done
Signature · 1 line
2.48.1