new file mode 100755
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+ctest --force-new-ctest-process | sed -u 's/\*\*\*/ /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'
@@ -11,17 +11,49 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=a32c99f24d097c72d1857e533b55642b"
#FORTRAN:forcevariable = ",fortran"
#RUNTIMETARGET:append:pn-gcc-runtime = " libquadmath"
-DEPENDS = "libgfortran"
+DEPENDS = "libgfortran \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', 'rsync-native', '', d)} \
+ "
+RDEPENDS:${PN}-ptest += "cmake"
SRCREV = "32b062a33352e05771dcc01b981ebe961bf2e42f"
-SRC_URI = "git://github.com/Reference-LAPACK/lapack.git;protocol=https;branch=master"
+SRC_URI = "git://github.com/Reference-LAPACK/lapack.git;protocol=https;branch=master \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \
+ "
S = "${WORKDIR}/git"
PACKAGECONFIG ?= ""
PACKAGECONFIG[lapacke] = "-DLAPACKE=ON,-DLAPACKE=OFF"
-EXTRA_OECMAKE = " -DBUILD_SHARED_LIBS=ON "
+EXTRA_OECMAKE = " -DBUILD_SHARED_LIBS=ON \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', ' -DBUILD_TESTING=ON', '', d)} \
+ "
OECMAKE_GENERATOR = "Unix Makefiles"
-inherit cmake pkgconfig
+inherit cmake pkgconfig ptest
EXCLUDE_FROM_WORLD = "1"
+
+do_install_ptest () {
+ rsync -a ${B}/TESTING ${D}${PTEST_PATH} \
+ --exclude CMakeFiles \
+ --exclude cmake_install.cmake \
+ --exclude Makefile
+ rsync -a ${B}/BLAS ${D}${PTEST_PATH} \
+ --exclude CMakeFiles \
+ --exclude cmake_install.cmake \
+ --exclude Makefile
+ rsync -a ${B}/LAPACKE ${D}${PTEST_PATH} \
+ --exclude CMakeFiles \
+ --exclude cmake_install.cmake \
+ --exclude Makefile
+ cp -r ${B}/bin ${D}${PTEST_PATH}
+ cp -r ${B}/lapack_testing.py ${D}${PTEST_PATH}
+ cp ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}
+ cp ${S}/TESTING/*.in ${S}/TESTING/runtest.cmake ${D}${PTEST_PATH}/TESTING
+ cp ${S}/BLAS/TESTING/*.in ${D}${PTEST_PATH}/BLAS/TESTING
+ sed -i -e 's#${B}#${PTEST_PATH}#g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+ sed -i -e 's#${S}#${PTEST_PATH}#g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+ sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+ sed -i -e 's#${PYTHON}#/usr/bin/python3#g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+ sed -i -e 's#${WORKDIR}##g' `find ${D}${PTEST_PATH} -name CTestTestfile.cmake`
+}
103 test cases in all. Test results on qemu with kvm: root@qemux86-64:~# ptest-runner lapack START: ptest-runner 2023-08-07T07:10 BEGIN: /usr/lib64/lapack/ptest PASS: BLAS-xblat1s PASS: BLAS-xblat2s ... PASS: LAPACK-xeigtstz_lse_in PASS: LAPACK-xlintstds_dstest_in PASS: LAPACK-xlintstzc_zctest_in DURATION: 55 END: /usr/lib64/lapack/ptest 2023-08-07T07:11 STOP: ptest-runner TOTAL: 1 FAIL: 0 If build lapack with lapacke, following test cases will be included in ptest. PASS: example_DGESV_rowmajor PASS: example_DGESV_colmajor PASS: example_DGELS_rowmajor PASS: example_DGELS_colmajor Signed-off-by: Chi Xu <chi.xu@windriver.com> --- .../recipes-devtools/lapack/lapack/run-ptest | 3 ++ .../recipes-devtools/lapack/lapack_3.10.1.bb | 40 +++++++++++++++++-- 2 files changed, 39 insertions(+), 4 deletions(-) create mode 100755 meta-oe/recipes-devtools/lapack/lapack/run-ptest