Repository: spack/spack

Issue:
Installation issue: AOCL-Sparse %AOCC failed on OpenSUSE: no rule to make libflame.so
### Steps to reproduce the issue

```console
$ spack spec -l aocl-sparse %aocc
Input spec
--------------------------------
 -   aocl-sparse%aocc

Concretized
--------------------------------
 -   645nrc7  aocl-sparse@4.1%aocc@4.1.0~benchmarks~examples~ilp64~ipo+shared~unit_tests build_system=cmake build_type=Release generator=make arch=linux-opensusetumbleweed2.38-zen3
[+]  spnyfil      ^amdblis@4.1%aocc@4.1.0~aocl_gemm+blas+cblas~ilp64+suphandling build_system=makefile libs=shared,static threads=none arch=linux-opensusetumbleweed2.38-zen3
[+]  cppgfit          ^python@3.10.12%aocc@4.1.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,7d40923,f2fd060 arch=linux-opensusetumbleweed2.38-zen3
[+]  q4pqsh3              ^bzip2@1.0.8%aocc@4.1.0~debug~pic+shared build_system=generic arch=linux-opensusetumbleweed2.38-zen3
[+]  k3izrbw                  ^diffutils@3.9%aocc@4.1.0 build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  n3z6tlh              ^expat@2.5.0%aocc@4.1.0+libbsd build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  7cwjepl                  ^libbsd@0.11.7%aocc@4.1.0 build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  lp7x5tm                      ^libmd@1.0.4%aocc@4.1.0 build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  4rs5sb5              ^gdbm@1.23%aocc@4.1.0 build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  czmpnqf              ^gettext@0.21.1%aocc@4.1.0+bzip2+curses+git~libunistring+libxml2+tar+xz build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  xo2d4za                  ^libiconv@1.17%aocc@4.1.0 build_system=autotools libs=shared,static arch=linux-opensusetumbleweed2.38-zen3
[+]  zwtglby                  ^libxml2@2.10.3%aocc@4.1.0~python build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  uioycpu                  ^tar@1.34%aocc@4.1.0 build_system=autotools zip=pigz arch=linux-opensusetumbleweed2.38-zen3
[+]  ojvejfm                      ^pigz@2.7%aocc@4.1.0 build_system=makefile arch=linux-opensusetumbleweed2.38-zen3
[+]  knlbull                      ^zstd@1.5.5%aocc@4.1.0+programs build_system=makefile compression=none libs=shared,static arch=linux-opensusetumbleweed2.38-zen3
[+]  lqb7gtb              ^libffi@3.4.4%aocc@4.1.0 build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  yesihmp              ^libxcrypt@4.4.35%aocc@4.1.0~obsolete_api build_system=autotools patches=4885da3 arch=linux-opensusetumbleweed2.38-zen3
[+]  u3unzt4              ^openssl@3.1.2%aocc@4.1.0~docs+shared build_system=generic certs=mozilla arch=linux-opensusetumbleweed2.38-zen3
[+]  wqd5gx2                  ^ca-certificates-mozilla@2023-05-30%aocc@4.1.0 build_system=generic arch=linux-opensusetumbleweed2.38-zen3
[+]  kbjt4fz              ^pkgconf@1.9.5%aocc@4.1.0 build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  so6tfuv              ^readline@8.2%aocc@4.1.0 build_system=autotools patches=bbf97f1 arch=linux-opensusetumbleweed2.38-zen3
[+]  lxw2lfd              ^sqlite@3.42.0%aocc@4.1.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  p7rabtp              ^util-linux-uuid@2.38.1%aocc@4.1.0 build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  huprvms              ^xz@5.4.1%aocc@4.1.0~pic build_system=autotools libs=shared,static arch=linux-opensusetumbleweed2.38-zen3
[+]  oz6kkhy      ^amdlibflame@4.1%aocc@4.1.0~debug~ilp64+lapack2flame+shared+static build_system=autotools threads=none arch=linux-opensusetumbleweed2.38-zen3
[+]  eabrd37          ^aocl-utils@4.1%aocc@4.1.0~doc~examples~ipo~tests build_system=cmake build_type=Release generator=make arch=linux-opensusetumbleweed2.38-zen3
[+]  5wkjlnm          ^openblas@0.3.23%aocc@4.1.0~bignuma~consistent_fpcsr+fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=none arch=linux-opensusetumbleweed2.38-zen3
[+]  2kdagls              ^perl@5.38.0%aocc@4.1.0+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=linux-opensusetumbleweed2.38-zen3
[+]  mmss7qu                  ^berkeley-db@18.1.40%aocc@4.1.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux-opensusetumbleweed2.38-zen3
[+]  5yrgv4k      ^cmake@3.26.3%aocc@4.1.0~doc+ncurses+ownlibs build_system=generic build_type=Release arch=linux-opensusetumbleweed2.38-zen3
[+]  ld2w47p          ^curl@8.1.2%aocc@4.1.0~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=openssl arch=linux-opensusetumbleweed2.38-zen3
[+]  cflwumu              ^nghttp2@1.52.0%aocc@4.1.0 build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  twp7yf3          ^ncurses@6.4%aocc@4.1.0~symlinks+termlib abi=none build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
[+]  bvqx6nr          ^zlib-ng@2.1.3%aocc@4.1.0+compat+opt build_system=autotools patches=299b958,ae9077a,b692621 arch=linux-opensusetumbleweed2.38-zen3
[+]  23rnk7k      ^gmake@4.4.1%aocc@4.1.0~guile build_system=autotools arch=linux-opensusetumbleweed2.38-zen3
```


### Error message

<details><summary>Error message</summary>

<pre>

$spack install aocl-sparse %aocc
==> Warning: config:terminal_title has been replaced by install_status and is ignored
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/bzip2-1.0.8-q4pqsh3rxddsvyeuoc4umnhp4fbq3fcc
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/libmd-1.0.4-lp7x5tmamdnni6ccsick632krdghn4rl
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/ncurses-6.4-twp7yf3grnnzv3whbfr3fmccaml2s5ut
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/libiconv-1.17-xo2d4zaqgk4zq54eeic2sd6jxjhbxvuy
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/xz-5.4.1-huprvmsxzdvqjt4wiymsravg6ktpretm
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/zlib-ng-2.1.3-bvqx6nrxcymlillkfu44ns7grwq5mjcv
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/zstd-1.5.5-knlbullsxnlliav3ee24osy35foxd26b
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/libffi-3.4.4-lqb7gtbxs7ugk2qj5z3eompbhiipra7k
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/libxcrypt-4.4.35-yesihmpcxacq7h2pxczprfhnzmdrsl6f
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/util-linux-uuid-2.38.1-p7rabtpzawmfnfxq5izkas34umhvtppj
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/openblas-0.3.23-5wkjlnmpqfgdg2x6ewidl6cfkcjvgp6n
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/nghttp2-1.52.0-cflwumufdhdohooi4drlgslxkjh22w36
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/gmake-4.4.1-23rnk7kkyj37kl2avoa576ox27hargj7
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/libbsd-0.11.7-7cwjeplhcnehfrravoluexflx6rok44s
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/readline-8.2-so6tfuvqypsh7axma25ftc3kkroykzb4
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/pigz-2.7-ojvejfmvnzqtdqpeafqz4mihxhltmihj
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/libxml2-2.10.3-zwtglbydpelveyht26i6iogg3sp5zx4q
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/openssl-3.1.2-u3unzt4belxuwb5banoq5pnoz7tcibgo
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/amdlibflame-4.1-oz6kkhynthdltqwtbupl23mhtetnrs2g
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/expat-2.5.0-n3z6tlhhz3va2d2ympka6pz4jexp2sra
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/sqlite-3.42.0-lxw2lfdvttfvnfpixbl6r2lf4rigcwi2
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/gdbm-1.23-4rs5sb5jp4ohcu42kxqaqjcuijwm6wqe
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/tar-1.34-uioycpuyfw4jlgnthh4r7vjzhacjsfjr
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/curl-8.1.2-ld2w47pd6o36cidqs7d6stsme56mesn3
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/gettext-0.21.1-czmpnqf76u673ipacj4wrf34afwvlp7i
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/cmake-3.26.3-5yrgv4kbbyaf5po2lef37gjfz6q7x5so
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/python-3.10.12-cppgfit2nnmxuxcb2o3jxmjaytszrdvd
[+] /home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/amdblis-4.1-spnyfil243qxoy2mc2lz3nimcrbz2wtz
==> Installing aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt [29/29]
==> No binary for aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt found: installing from source
==> Using cached archive: /var/tmp/yanghaoyu/spack-cache/_source-cache/archive/35/35ef437210bc25fdd802b462eaca830bfd928f962569b91b592f2866033ef2bb.tar.gz
==> No patches needed for aocl-sparse
==> aocl-sparse: Executing phase: 'cmake'
==> aocl-sparse: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    '/home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/gmake-4.4.1-23rnk7kkyj37kl2avoa576ox27hargj7/bin/make' '-j16'

3 errors found in build log:
     91     cd /tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjay
            hcymwwq7hjwzt/spack-src/build/release/library && /home/yanghaoyu/opt/spack/li
            b/spack/env/aocc/clang++ -DAOCL_SPARSE_BUILD_DATE=20230903 -Daoclsparse_EXPOR
            TS -I/tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrj
            ayhcymwwq7hjwzt/spack-src/library/src/include -I/tmp/yanghaoyu/spack-stage/sp
            ack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src/library/
            src/analysis -I/tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7
            vuhd74jdrjayhcymwwq7hjwzt/spack-src/library/src/level2 -I/tmp/yanghaoyu/spack
            -stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src
            /library/src/extra -I/tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-6
            45nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src/library/include -I/tmp/yanghaoyu/sp
            ack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-
            src/build/release/include -I/home/yanghaoyu/opt/spack/packages/linux-opensuse
            tumbleweed2.38-zen3/aocc-4.1.0/amdlibflame-4.1-oz6kkhynthdltqwtbupl23mhtetnrs
            2g/include -I/home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-
            zen3/aocc-4.1.0/amdblis-4.1-spnyfil243qxoy2mc2lz3nimcrbz2wtz/include/blis -st
            d=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -mtune=native -
            mavx2 -mfma -fopenmp=libomp -DNDEBUG -O3 -ftree-vectorize -ffp-contract=fast 
            -MD -MT library/CMakeFiles/aoclsparse.dir/src/analysis/aoclsparse_analysis.cp
            p.o -MF CMakeFiles/aoclsparse.dir/src/analysis/aoclsparse_analysis.cpp.o.d -o
             CMakeFiles/aoclsparse.dir/src/analysis/aoclsparse_analysis.cpp.o -c /tmp/yan
            ghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjw
            zt/spack-src/library/src/analysis/aoclsparse_analysis.cpp
     92     In file included from /tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-
            645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src/library/src/extra/aoclsparse_conte
            xt.cpp:27:
     93     /tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcy
            mwwq7hjwzt/spack-src/library/include/alci/cpu_features.h:241:5: warning: arra
            y designators are a C99 extension [-Wc99-designator]
     94         [ALC_CPUID_EAX_1]    = { 0x1, 0x0 },        /* eax = 0, ecx=0 */
     95         ^~~~~~~~~~~~~~~~~
     96     1 warning generated.
  >> 97     make[2]: *** No rule to make target '/home/yanghaoyu/opt/spack/packages/linux
            -opensusetumbleweed2.38-zen3/aocc-4.1.0/amdlibflame-4.1-oz6kkhynthdltqwtbupl2
            3mhtetnrs2g/lib/libflame.so', needed by 'library/libaoclsparse.so.4.1.0.0'.  
            Stop.
     98     make[2]: *** Waiting for unfinished jobs....
     99     [ 94%] Building CXX object library/CMakeFiles/aoclsparse.dir/src/analysis/aoc
            lsparse_csr_util.cpp.o
     100    cd /tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjay
            hcymwwq7hjwzt/spack-src/build/release/library && /home/yanghaoyu/opt/spack/li
            b/spack/env/aocc/clang++ -DAOCL_SPARSE_BUILD_DATE=20230903 -Daoclsparse_EXPOR
            TS -I/tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrj
            ayhcymwwq7hjwzt/spack-src/library/src/include -I/tmp/yanghaoyu/spack-stage/sp
            ack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src/library/
            src/analysis -I/tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7
            vuhd74jdrjayhcymwwq7hjwzt/spack-src/library/src/level2 -I/tmp/yanghaoyu/spack
            -stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src
            /library/src/extra -I/tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-6
            45nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src/library/include -I/tmp/yanghaoyu/sp
            ack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-
            src/build/release/include -I/home/yanghaoyu/opt/spack/packages/linux-opensuse
            tumbleweed2.38-zen3/aocc-4.1.0/amdlibflame-4.1-oz6kkhynthdltqwtbupl23mhtetnrs
            2g/include -I/home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-
            zen3/aocc-4.1.0/amdblis-4.1-spnyfil243qxoy2mc2lz3nimcrbz2wtz/include/blis -st
            d=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -mtune=native -
            mavx2 -mfma -fopenmp=libomp -DNDEBUG -O3 -ftree-vectorize -ffp-contract=fast 
            -MD -MT library/CMakeFiles/aoclsparse.dir/src/analysis/aoclsparse_csr_util.cp
            p.o -MF CMakeFiles/aoclsparse.dir/src/analysis/aoclsparse_csr_util.cpp.o.d -o
             CMakeFiles/aoclsparse.dir/src/analysis/aoclsparse_csr_util.cpp.o -c /tmp/yan
            ghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjw
            zt/spack-src/library/src/analysis/aoclsparse_csr_util.cpp
     101    /tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcy
            mwwq7hjwzt/spack-src/library/src/conversion/aoclsparse_convert.cpp:122:23: wa
            rning: using integer absolute value function 'abs' when argument is of floati
            ng point type [-Wabsolute-value]
     102        pc_diff_blks    = abs(pc_blks_inc[0] - pc_blks_inc[1]);
     103                          ^

     ...

     139    2 warnings generated.
     140    1 warning generated.
     141    1 warning generated.
     142    1 warning generated.
     143    1 warning generated.
     144    make[2]: Leaving directory '/tmp/yanghaoyu/spack-stage/spack-stage-aocl-spars
            e-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src/build/release'
  >> 145    make[1]: *** [CMakeFiles/Makefile2:101: library/CMakeFiles/aoclsparse.dir/all
            ] Error 2
     146    make[1]: Leaving directory '/tmp/yanghaoyu/spack-stage/spack-stage-aocl-spars
            e-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-src/build/release'
  >> 147    make: *** [Makefile:139: all] Error 2

See build log for details:
  /tmp/yanghaoyu/spack-stage/spack-stage-aocl-sparse-4.1-645nrc7vuhd74jdrjayhcymwwq7hjwzt/spack-build-out.txt

</pre></details>


### Information on your system

```
$ spack debug report

* **Spack:** 0.21.0.dev0
* **Python:** 3.11.4
* **Platform:** linux-opensusetumbleweed2.38-zen3
==> Warning: config:terminal_title has been replaced by install_status and is ignored
* **Concretizer:** clingo
```

### Additional information

[spack-build-out.txt](https://github.com/spack/spack/files/12505566/spack-build-out.txt)


Maintainers:
@amd-toolchain-support

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:
Thanks for identifying the issue, we will check and respond soon.
@DanielYang59  We have tested this internally and were unable to reproduce the bug.  However, the error `no rule to make target ../libflame.so` will occur if there is no `libflame.so` present at the given path.  

On that basis, could you please take a look in your `/home/yanghaoyu/opt/spack/packages/linux-opensusetumbleweed2.38-zen3/aocc-4.1.0/amdlibflame-4.1-oz6kkhynthdltqwtbupl23mhtetnrs2g/` directory and confirm that the library files are indeed present?

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/amdlibflame/package.py b/var/spack/repos/builtin/packages/amdlibflame/package.py
--- a/var/spack/repos/builtin/packages/amdlibflame/package.py
+++ b/var/spack/repos/builtin/packages/amdlibflame/package.py
@@ -77,6 +77,13 @@ def lapack_libs(self):
             "libflame", root=self.prefix, shared="+shared" in self.spec, recursive=True
         )
 
+    @property
+    def libs(self):
+        """find libflame libs function"""
+        return find_libraries(
+            "libflame", root=self.prefix, shared="+shared" in self.spec, recursive=True
+        )
+
     def flag_handler(self, name, flags):
         if name == "cflags":
             if self.spec.satisfies("%clang@16:") or self.spec.satisfies("%aocc@4.1.0:"):
diff --git a/var/spack/repos/builtin/packages/aocl-sparse/package.py b/var/spack/repos/builtin/packages/aocl-sparse/package.py
--- a/var/spack/repos/builtin/packages/aocl-sparse/package.py
+++ b/var/spack/repos/builtin/packages/aocl-sparse/package.py
@@ -98,13 +98,11 @@ def cmake_args(self):
             args.append(self.define_from_variant("BUILD_ILP64", "ilp64"))
 
         if self.spec.satisfies("@4.0:"):
-            args.append("-DAOCL_BLIS_LIB={0}/libblis.so".format(self.spec["amdblis"].prefix.lib))
+            args.append("-DAOCL_BLIS_LIB=" + str(self.spec["amdblis"].libs))
             args.append(
                 "-DAOCL_BLIS_INCLUDE_DIR={0}/blis".format(self.spec["amdblis"].prefix.include)
             )
-            args.append(
-                "-DAOCL_LIBFLAME={0}/libflame.so".format(self.spec["amdlibflame"].prefix.lib)
-            )
+            args.append("-DAOCL_LIBFLAME=" + str(self.spec["amdlibflame"].libs))
             args.append(
                 "-DAOCL_LIBFLAME_INCLUDE_DIR={0}".format(self.spec["amdlibflame"].prefix.include)
             )


Test patch: