lapack: fix TMPDIR reference in do_package_qa
Quoted 34 lines · Peng (Paul) (CN) via lists.openembedded.org
From: Zhang Peng<[email protected]>
When building the
lapackpackage, the following QA error occurs:
"File/usr/lib64/libblas.so.3.12.0in package lapack contains reference to TMPDIR [buildpaths]"The issue arises because the
xerbla.oobject file embeds the absolute host path ofxerbla.f. This occurs during compilation, where the build command inbuild.make(generated by CMake) specifies:gfortran -c <absolute path>/xerbla.f -o.As a result, the absolute path is included in
xerbla.o. Unfortunately,gfortrandoes not support flags like-fdebug-prefix-mapor-ffile-prefix-mapto remove such paths.To resolve this, the fix involves replacing the absolute path of
xerbla.fin the generatedbuild.makefile with a relative path before the compilation step. This ensures that the resultingxerbla.odoes not contain any references to TMPDIR, passing thedo_package_qacheck.Signed-off-by Zhang Peng<[email protected]>--- .../recipes-devtools/lapack/lapack_3.12.0.bb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+)meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb +5
-0@@ -33,6 +33,29 @@ OECMAKE_GENERATOR = "Unix Makefiles" 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. +# To address this issue, we manually replace the absolute path with a relative path +# in the generated `build.make` file. +#
meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb OECMAKE_GENERATOR = "Unix Makefiles" · line 50
Quoted 10 lines
meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb +10
-0+# An issue has been reported:https://github.com/Reference-LAPACK/lapack/issues/1087, +# requesting a fix in the source code. +# +# This workaround resolves the TMPDIR [buildpaths] issue by converting the absolute path +# 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. +# 3. Replace the absolute path with the calculated relative path in the `build.make` files +
While the current implementation resolves the immediate issue effectively, I recognize that the approach may not be the most optimal or elegant. I believe there might be a better way to address this issue If anyone has any suggestions, alternative ideas, or feedback on how to improve this solution, I would greatly appreciate your input.
Thank you for taking the time to review and share your thoughts!
//Peng
Quoted 20 lines
meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb +8
-1+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 + done +} + do_install_ptest () { rsync -a ${B}/TESTING ${D}${PTEST_PATH} \ --exclude CMakeFiles \ -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#114623):https://lists.openembedded.org/g/openembedded-devel/message/114623 Mute This Topic:https://lists.openembedded.org/mt/110403421/8576101
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-