Repository: spack/spack

Issue:
cray-libsci support for NVHPC
### Summary

@haampie @becker33 

The cray-libsci directory now provides a `NVIDIA` subdirectory which i presume is the canonical name to refer nvhpc builds to use cray-libsci.

See content of root directory for libsci 21.08.1.2
```
siddiq90@login37> ls -l /opt/cray/pe/libsci/21.08.1.2/
total 27
lrwxrwxrwx. 1 root root     4 Oct 23  2019 aocc -> AOCC
drwxr-xr-x. 3 root root    36 Aug 24 11:10 AOCC
-rw-r--r--. 1 root root 14127 Jul 30 06:36 ATTRIBUTIONS_libsci21.08.1.2.txt
lrwxrwxrwx. 1 root root     4 Oct 11  2017 cray -> CRAY
drwxr-xr-x. 3 root root    36 Aug 24 13:12 CRAY
lrwxrwxrwx. 1 root root     3 Oct 11  2017 gnu -> GNU
drwxr-xr-x. 3 root root    36 Aug 24 13:12 GNU
-rw-r--r--. 1 root root    67 Oct 16  2019 lib_contents
drwxr-xr-x. 1 root root    68 Aug 24 13:12 man
lrwxrwxrwx. 1 root root     6 Nov 30  2020 nvidia -> NVIDIA
drwxr-xr-x. 3 root root    38 Aug 24 11:10 NVIDIA
-rw-r--r--. 1 root root  3539 Jul 30 06:38 release_info
-rwxr-xr--. 1 root root  1123 Aug 24 13:12 set_default_libsci_21.08.1.2
-rw-r--r--. 1 root root   137 Aug 24 13:12 set_pkgconfig_default_libsci
```

According to this code we dont have a mapping  for nvhpc https://github.com/spack/spack/blob/890095e876a85d91ae7359f9120082c4e2f6a249/var/spack/repos/builtin/packages/cray-libsci/package.py#L34-L40

I would think this causes issue when it tries to detect blas library because it depends on `self.canonical_names` which maps to compiler that is coming from `self.spec.compiler.name`


https://github.com/spack/spack/blob/890095e876a85d91ae7359f9120082c4e2f6a249/var/spack/repos/builtin/packages/cray-libsci/package.py#L55-L78

I am not sure if its just a matter of adding a `nvhpc` key to fix the issue. Most of the content looks the same 


```
    canonical_names = {
        'gcc': 'GNU',
        'cce': 'CRAY',
        'intel': 'INTEL',
        'clang': 'ALLINEA',
        'aocc': 'AOCC',
        'nvhpc': 'NVIDIA'
    }
```



### Rationale

_No response_

### Description

This is causing some builds to fail that depend on blas libraries. Currently we have `cray-libsci` on Perlmutter along with nvhpc compiler providing its blas libraries. That's all we have so i am trying to figure out why this is not working.
```
==> Installing amrex-21.08-xtm5oazrom3qmttrafsd6wezjkvkezxz
==> No binary for amrex-21.08-xtm5oazrom3qmttrafsd6wezjkvkezxz found: installing from source
==> Error: IndexError: list index out of range

/global/common/software/spackecp/perlmutter/e4s-21.08/spack/var/spack/repos/builtin/packages/cray-mpich/package.py:90, in headers:
         88    def headers(self):
         89        hdrs = find_headers('mpi', self.prefix.include, recursive=True)
  >>     90        hdrs.directories = os.path.dirname(hdrs[0])
         91        return hdrs


[+] /tmp/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_/cray-sles15-zen3/gcc-11.2.0/vtk-m-1.6.0-q2fiea2wlax5xqxtomhbp66d7zfuyfcb
[+] /tmp/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_/cray-sles15-zen3/gcc-11.2.0/perl-5.34.0-tn4lp27vgqeuuvjy3dg5f6cgpbre2i3n
==> Installing vtk-h-0.7.1-nlfzs7hejzitrfeaglozpv23en7sfvbo
==> No binary for vtk-h-0.7.1-nlfzs7hejzitrfeaglozpv23en7sfvbo found: installing from source
==> Error: IndexError: list index out of range

/global/common/software/spackecp/perlmutter/e4s-21.08/spack/var/spack/repos/builtin/packages/cray-mpich/package.py:90, in headers:
         88    def headers(self):
         89        hdrs = find_headers('mpi', self.prefix.include, recursive=True)
  >>     90        hdrs.directories = os.path.dirname(hdrs[0])
         91        return hdrs


==> Warning: Skipping build of ascent-0.7.1-e2u4yppxmxh7ohy2l2l55vlkoozcyd5k since vtk-h-0.7.1-nlfzs7hejzitrfeaglozpv23en7sfvbo failed
[+] /tmp/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_/cray-sles15-zen3/gcc-11.2.0/autoconf-2.69-jiczdztnkqv4vruoxh6x4kwpwkv3w4ou
[+] /tmp/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_/cray-sles15-zen3/gcc-11.2.0/automake-1.16.3-vdfwvgnd4zmahmpvxawdvfrjlp5zmhqk
[+] /tmp/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_/cray-sles15-zen3/gcc-11.2.0/numactl-2.0.14-npmzh2ajujcvhypnpnn3hsa5wpuxpwzz
==> Installing hdf5-1.8.22-t4k73drdvcuguetnzcb47okdotxbf4wx
==> No binary for hdf5-1.8.22-t4k73drdvcuguetnzcb47okdotxbf4wx found: installing from source
==> Error: IndexError: list index out of range

/global/common/software/spackecp/perlmutter/e4s-21.08/spack/var/spack/repos/builtin/packages/cray-mpich/package.py:90, in headers:
         88    def headers(self):
         89        hdrs = find_headers('mpi', self.prefix.include, recursive=True)
  >>     90        hdrs.directories = os.path.dirname(hdrs[0])
         91        return hdrs


==> Warning: Skipping build of conduit-0.7.2-6zhhfay4k53mpg7h2ocjj2hl3nv26yse since hdf5-1.8.22-t4k73drdvcuguetnzcb47okdotxbf4wx failed

```

### Additional information

_No response_

### General information

- [X] I have run `spack --version` and reported the version of Spack
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:
@lukebroskop looping you in on this issue. I couldn't get packages building with NVHPC when it required blas libraries, since cray-libsci is a blas provider i think there is an issue getting this detection in spack package. For time being ill have to use some other blas provider to workaround this issue.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/cray-libsci/package.py b/var/spack/repos/builtin/packages/cray-libsci/package.py
--- a/var/spack/repos/builtin/packages/cray-libsci/package.py
+++ b/var/spack/repos/builtin/packages/cray-libsci/package.py
@@ -38,6 +38,7 @@ class CrayLibsci(Package):
         'intel': 'INTEL',
         'clang': 'ALLINEA',
         'aocc': 'AOCC',
+        'nvhpc': 'NVIDIA',
         'rocmcc': 'AMD'
     }
 


Test patch: