diff options
author | Mathias Jacquelin <mjacquelin@lbl.gov> | 2019-09-24 13:25:06 -0700 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2019-09-24 13:25:05 -0700 |
commit | 7a11a2ccdb2a6a698c8df81beb230a4d210c3ff5 (patch) | |
tree | 3f314dd72fad1278b376770b6c4828d5a6c452fd | |
parent | 065cbe89fed448fcc64593f679867a7a7ad3cbd1 (diff) | |
download | spack-7a11a2ccdb2a6a698c8df81beb230a4d210c3ff5.tar.gz spack-7a11a2ccdb2a6a698c8df81beb230a4d210c3ff5.tar.bz2 spack-7a11a2ccdb2a6a698c8df81beb230a4d210c3ff5.tar.xz spack-7a11a2ccdb2a6a698c8df81beb230a4d210c3ff5.zip |
Upcxx package: remove warning, add version 2019.9.0 (#12880)
A function added to this package ran as part of importing it and
printed a warning for most Spack invocations, this removes the
warning message.
Also:
* Use compilers directly instead of Spack compiler wrappers (since
references to the compiler are embedded in text and binary files
of the installation)
* Add 'cross' variant for setting CROSS environment variable for
build
* Set UPCXX_INSTALL for generated module files
* Set UPCXX_GASNET_CONDUIT/UPCXX_NETWORK in generated module files
on Cray systems
* Also set UPCXX_NETWORK in build environment for Cray systems
-rw-r--r-- | var/spack/repos/builtin/packages/upcxx/package.py | 66 |
1 files changed, 28 insertions, 38 deletions
diff --git a/var/spack/repos/builtin/packages/upcxx/package.py b/var/spack/repos/builtin/packages/upcxx/package.py index fa0874ed7e..bf78c3d27b 100644 --- a/var/spack/repos/builtin/packages/upcxx/package.py +++ b/var/spack/repos/builtin/packages/upcxx/package.py @@ -4,31 +4,15 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * -import llnl.util.tty as tty -import os - - -def detect_scheduler(): - if (os.environ.get('CROSS') is None): - srunbin = which('srun') - if srunbin is None: - aprunbin = which('aprun') - if aprunbin is None: - tty.warn("CROSS has not been set, however " - "cannot detect scheduler.") - return 'none' - else: - tty.warn("CROSS has not been set, however " - "aprun has been found, assuming alps scheduler.") - return 'alps' - else: - tty.warn("CROSS has not been set, however " - "srun has been found, assuming slurm scheduler.") - return 'slurm' - else: - tty.warn("CROSS has been set to %s by the user." - % os.environ.get('CROSS')) - return 'user' + + +def cross_detect(): + if spack.architecture.platform().name == 'cray': + if which('srun'): + return 'cray-aries-slurm' + if which('alps'): + return 'cray-aries-alps' + return 'none' class Upcxx(Package): @@ -40,15 +24,16 @@ class Upcxx(Package): homepage = "https://upcxx.lbl.gov" + version('2019.9.0', '7642877e05300e38f6fa0afbc6062788') version('2019.3.2', '844722cb0e8c0bc649017fce86469457') variant('cuda', default=False, description='Builds a CUDA-enabled version of UPC++') - variant('scheduler', values=('slurm', 'alps', 'user', 'none'), - default=detect_scheduler(), - description="Resource manager to use") - conflicts('scheduler=none', when='platform=cray', + variant('cross', default=cross_detect(), + description="UPC++ cross-compile target (autodetect by default)") + + conflicts('cross=none', when='platform=cray', msg='None is unacceptable on Cray.') depends_on('cuda', when='+cuda') @@ -63,18 +48,20 @@ class Upcxx(Package): def setup_environment(self, spack_env, run_env): if 'platform=cray' in self.spec: spack_env.set('GASNET_CONFIGURE_ARGS', '--enable-mpi=probe') - if "scheduler=slurm" in self.spec: - tty.warn("CROSS has been automatically set to %s." - % 'cray-aries-slurm') - spack_env.set('CROSS', 'cray-aries-slurm') - elif "scheduler=alps" in self.spec: - tty.warn("CROSS has been automatically set to %s." - % 'cray-aries-alps') - spack_env.set('CROSS', 'cray-aries-alps') + + if 'cross=none' not in self.spec: + spack_env.set('CROSS', self.spec.variants['cross'].value) + if '+cuda' in self.spec: spack_env.set('UPCXX_CUDA', '1') spack_env.set('UPCXX_CUDA_NVCC', self.spec['cuda'].prefix.bin.nvcc) + run_env.set('UPCXX_INSTALL', self.prefix) + run_env.set('UPCXX', self.prefix.bin.upcxx) + if 'platform=cray' in self.spec: + run_env.set('UPCXX_GASNET_CONDUIT', 'aries') + run_env.set('UPCXX_NETWORK', 'aries') + def setup_dependent_package(self, module, dep_spec): dep_spec.upcxx = self.prefix.bin.upcxx @@ -83,7 +70,10 @@ class Upcxx(Package): spack_env.set('UPCXX', self.prefix.bin.upcxx) if 'platform=cray' in self.spec: spack_env.set('UPCXX_GASNET_CONDUIT', 'aries') + spack_env.set('UPCXX_NETWORK', 'aries') def install(self, spec, prefix): - installsh = Executable('./install') + env['CC'] = self.compiler.cc + env['CXX'] = self.compiler.cxx + installsh = Executable("./install") installsh(prefix) |