diff options
| -rw-r--r-- | meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb b/meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb index aafcdef681..4845d34106 100644 --- a/meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb +++ b/meta-oe/recipes-devtools/lapack/lapack_3.12.0.bb | |||
| @@ -35,7 +35,12 @@ inherit cmake pkgconfig ptest | |||
| 35 | EXCLUDE_FROM_WORLD = "1" | 35 | EXCLUDE_FROM_WORLD = "1" |
| 36 | 36 | ||
| 37 | # The `xerbla.o` file contains an absolute path in `xerbla.f.o`, but the options | 37 | # The `xerbla.o` file contains an absolute path in `xerbla.f.o`, but the options |
| 38 | # `-fdebug-prefix-map` and `-ffile-prefix-map` cannot be used because gfortran does not support them. | 38 | # `-fdebug-prefix-map` and `-ffile-prefix-map` cannot be used because gfortran does |
| 39 | # not support them. And we cannot easily change CMake to use relative paths, because | ||
| 40 | # it will convert them to absolute paths when generating Unix Makefiles or Ninja: | ||
| 41 | # https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#why-does-cmake-use-full-paths-or-can-i-copy-my-build-tree | ||
| 42 | # https://gitlab.kitware.com/cmake/cmake/-/issues/13894 | ||
| 43 | # | ||
| 39 | # To address this issue, we manually replace the absolute path with a relative path | 44 | # To address this issue, we manually replace the absolute path with a relative path |
| 40 | # in the generated `build.make` file. | 45 | # in the generated `build.make` file. |
| 41 | # | 46 | # |
| @@ -46,7 +51,7 @@ EXCLUDE_FROM_WORLD = "1" | |||
| 46 | # of `xerbla.f` to a relative path. The steps are as follows: | 51 | # of `xerbla.f` to a relative path. The steps are as follows: |
| 47 | # | 52 | # |
| 48 | # 1. Locate all `build.make` files after the `do_configure` step is completed. | 53 | # 1. Locate all `build.make` files after the `do_configure` step is completed. |
| 49 | # 2. Compute the relative path for `xerbla.f` based on the current build directory. | 54 | # 2. Compute the relative path for various `*.f` files based on the current build directory. |
| 50 | # 3. Replace the absolute path with the calculated relative path in the `build.make` files | 55 | # 3. Replace the absolute path with the calculated relative path in the `build.make` files |
| 51 | # | 56 | # |
| 52 | # Additionally, when ptests are enabled, apply a simpler workaround for ptest code: | 57 | # Additionally, when ptests are enabled, apply a simpler workaround for ptest code: |
| @@ -54,11 +59,17 @@ EXCLUDE_FROM_WORLD = "1" | |||
| 54 | # the MATGEN subdirectory, with a relative path prefix of `"../../.."`. | 59 | # the MATGEN subdirectory, with a relative path prefix of `"../../.."`. |
| 55 | do_configure:append(){ | 60 | do_configure:append(){ |
| 56 | for file in `find ${B} -name build.make`; do | 61 | for file in `find ${B} -name build.make`; do |
| 57 | sed -i -e "s#\(.*-c \).*\(/xerbla\.f \)#\1$(grep '\-c .*xerbla\.f' $file | awk -F'cd ' '{print $2}'| \ | 62 | # Replacing all .f files found with: |
| 58 | awk '{src=$1; sub(/.*-c /, ""); sub(/xerbla\.f.*/, ""); obj=$0; print src, obj}' | \ | 63 | # for f in $(find ${S} -name \*.f -printf " %f" | sort -u); do |
| 59 | while read src obj; do echo "$(realpath --relative-to="$src" "$obj")"; done)\2#g" $file | 64 | # would be more reliable with other optional PACKAGECONFIGs, but also very slow as there are |
| 65 | # ~ 3500 of them and this loop takes around 20 minutes | ||
| 66 | 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 | ||
| 67 | sed -i -e "s#\(.*-c \).*\(/$f\.f \)#\1$(grep "\-c .*$f\.f" $file | awk -F'cd ' '{print $2}'| \ | ||
| 68 | awk "{src=\$1; sub(/.*-c /, \"\"); sub(/$f\.f.*/, \"\"); obj=\$0; print src, obj}" | \ | ||
| 69 | while read src obj; do echo "$(realpath --relative-to="$src" "$obj")"; done)\2#g" $file | ||
| 70 | done | ||
| 60 | done | 71 | done |
| 61 | if (${@bb.utils.contains('PTEST_ENABLED', '1', 'true', 'false', d)});then | 72 | if ${@bb.utils.contains('PTEST_ENABLED', '1', 'true', 'false', d)} ; then |
| 62 | for file in `find . -name build.make -path '*TESTING*' -not -path '*MATGEN*'`; do | 73 | for file in `find . -name build.make -path '*TESTING*' -not -path '*MATGEN*'`; do |
| 63 | sed -i -e "s#\(.*-c \)\(${WORKDIR}\)\(.*.[f|F] \)#\1../../..\3#g" $file | 74 | sed -i -e "s#\(.*-c \)\(${WORKDIR}\)\(.*.[f|F] \)#\1../../..\3#g" $file |
| 64 | done | 75 | done |
