summaryrefslogtreecommitdiff
path: root/lib/spack/spack/compilers/cce.py
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-05-05 13:58:46 -0700
committerGitHub <noreply@github.com>2020-05-05 13:58:46 -0700
commitdd3762d0f936aca41d11deb033e56d68d2036f2f (patch)
tree5e06d774eabd7ec362e34eade9292c92559dc5d4 /lib/spack/spack/compilers/cce.py
parent7be7d672b788f807ec9ca8fdead07538806236a3 (diff)
downloadspack-dd3762d0f936aca41d11deb033e56d68d2036f2f.tar.gz
spack-dd3762d0f936aca41d11deb033e56d68d2036f2f.tar.bz2
spack-dd3762d0f936aca41d11deb033e56d68d2036f2f.tar.xz
spack-dd3762d0f936aca41d11deb033e56d68d2036f2f.zip
cray platform: support cray Cluster and XC type machines (#12989)
Cray has two machine types. "XC" machines are the larger machines more common in HPC, but "Cluster" machines are also cropping up at some HPC sites. Cluster machines run a slightly different form of the CrayPE programming environment, and often come without default modules loaded. Cluster machines also run different versions of some software, and run a linux distro on the backend nodes instead of running Compute Node Linux (CNL). Below are the changes made to support "Cluster" machines in Spack. Some of these changes are semi-related general upkeep of the cray platform. * cray platform: detect properly after module purge * cray platform: support machines running OSs other than CNL Make Cray backend OS delegate to LinuxDistro when no cle_release file favor backend over frontend OS when name clashes * cray platform: target detection uses multiple strategies This commit improves the robustness of target detection on Cray by trying multiple strategies. The first one that produces results wins. If nothing is found only the generic family of the frontend host is used as a target. * cray-libsci: add package from NERSC * build_env: unload cray-libsci module when not explicitly needed cray-libsci is a package in Spack. The cray PrgEnv modules load it implicitly when we set up the compiler. We now unload it after setting up the compiler and only reload it when requested via external package. * util/module_cmd: more robust module parsing Cray modules have documentation inside the module that is visible to the `module show` command. Spack module parsing is now robust to documentation inside modules. * cce compiler: uses clang flags for versions >= 9.0 * build_env: push CRAY_LD_LIBRARY_PATH into everything Some Cray modules add paths to CRAY_LD_LIBRARY_PATH instead of LD_LIBRARY_PATH. This has performance benefits at load time, but leads to Spack builds not finding their dependencies from external modules. Spack now prepends CRAY_LD_LIBRARY_PATH to LD_LIBRARY_PATH before beginning the build. * mvapich2: setup cray compilers when on cray previously, mpich was the only mpi implementation to support cray systems (because it is the MPI on Cray XC systems). Cray cluster systems use mvapich2, which now supports cray compiler wrappers. * build_env: clean pkgconf from environment Cray modules silently add pkgconf to the user environment This can break builds that do not user pkgconf. Now we remove it frmo the environment and add it again if it is in the spec. * cray platform: cheat modules for rome/zen2 module on naples/zen node Cray modules for naples/zen architecture currently specify rome/zen2. For now, we detect this and return zen for modules named `craype-x86-rome`. * compiler: compiler default versions When detecting compiler default versions for target/compiler compatibility checks, Spack previously ran the compiler without setting up its environment. Now we setup a temporary environment to run the compiler with its modules to detect its version. * compilers/cce: improve logic to determine C/C++ std flags * tests: fix existing tests to play nicely with new cray support * tests: test new functionality Some new functionality can only be tested on a cray system. Add tests for what can be tested on a linux system. Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Diffstat (limited to 'lib/spack/spack/compilers/cce.py')
-rw-r--r--lib/spack/spack/compilers/cce.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/spack/spack/compilers/cce.py b/lib/spack/spack/compilers/cce.py
index 7aedb55a5d..0d30a69d3e 100644
--- a/lib/spack/spack/compilers/cce.py
+++ b/lib/spack/spack/compilers/cce.py
@@ -32,7 +32,12 @@ class Cce(Compiler):
'f77': 'cce/ftn',
'fc': 'cce/ftn'}
- version_argument = '-V'
+ @property
+ def version_argument(self):
+ if self.version >= ver('9.0'):
+ return '--version'
+ return '-V'
+
version_regex = r'[Vv]ersion.*?(\d+(\.\d+)+)'
@classmethod
@@ -41,17 +46,23 @@ class Cce(Compiler):
@property
def openmp_flag(self):
+ if self.version >= ver('9.0'):
+ return '-fopenmp'
return "-h omp"
@property
def cxx11_flag(self):
+ if self.version >= ver('9.0'):
+ return '-std=c++11'
return "-h std=c++11"
@property
def c99_flag(self):
- if self.version >= ver('8.4'):
- return '-h stc=c99,noconform,gnu'
- if self.version >= ver('8.1'):
+ if self.version >= ver('9.0'):
+ return '-std=c99'
+ elif self.version >= ver('8.4'):
+ return '-h std=c99,noconform,gnu'
+ elif self.version >= ver('8.1'):
return '-h c99,noconform,gnu'
raise UnsupportedCompilerFlag(self,
'the C99 standard',
@@ -60,7 +71,9 @@ class Cce(Compiler):
@property
def c11_flag(self):
- if self.version >= ver('8.5'):
+ if self.version >= ver('9.0'):
+ return '-std=c11'
+ elif self.version >= ver('8.5'):
return '-h std=c11,noconform,gnu'
raise UnsupportedCompilerFlag(self,
'the C11 standard',