diff options
author | Kelly (KT) Thompson <kgt@lanl.gov> | 2016-10-10 18:57:35 -0600 |
---|---|---|
committer | Kelly (KT) Thompson <kgt@lanl.gov> | 2016-10-10 19:10:26 -0600 |
commit | 3553c8b9e92f81e53c607c574b1b746e03039ac7 (patch) | |
tree | 01c1ab9173583bbd4febd1623a57ff0baa85e19f /var | |
parent | 29fc9cd22c4d4cf600ec5982f2f43c9941539e7f (diff) | |
download | spack-3553c8b9e92f81e53c607c574b1b746e03039ac7.tar.gz spack-3553c8b9e92f81e53c607c574b1b746e03039ac7.tar.bz2 spack-3553c8b9e92f81e53c607c574b1b746e03039ac7.tar.xz spack-3553c8b9e92f81e53c607c574b1b746e03039ac7.zip |
On Cray machines, use the Cray compile wrappers instead of MPI wrappers.
+ Cray compile wrappers are MPI wrappers.
+ Packages that need to be compiled with MPI compile wrappers normally use
'mpicc', 'mpic++' and 'mpif90' provided by the MPI vendor. However, when using
cray-mpich as the MPI vendor, the compile wrappers 'CC', 'cc' and 'ftn' must
be used.
+ In this scenario, the mpich package is hijacked by specifying cray-mpich as an
external package under the 'mpich:' section of packages.yaml. For example:
packages:
mpich:
modules:
mpich@7.4.2%intel@16.0.3 arch=cray-CNL-haswell: cray-mpich/7.4.2
buildable: False
all:
providers:
mpi: [mpich]
+ This change allows packages like parmetis to be built using the Cray compile
wrappers. For example: 'spack install parmetis%intel@16.0.3 ^mpich@7.4.2 os=CNL'
+ This commit relies on the existence of the environment variable CRAYPE_VERSION
to determine if the current machine is running a Cray environment. This check is
insufficient, but I'm not sure how to improve this logic.
+ Fixes #1827
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/mpich/package.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/mpich/package.py b/var/spack/repos/builtin/packages/mpich/package.py index a36ab4206e..8f300d4ec7 100644 --- a/var/spack/repos/builtin/packages/mpich/package.py +++ b/var/spack/repos/builtin/packages/mpich/package.py @@ -62,10 +62,18 @@ class Mpich(Package): spack_env.set('MPICH_FC', spack_fc) def setup_dependent_package(self, module, dep_spec): - self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') - self.spec.mpicxx = join_path(self.prefix.bin, 'mpic++') - self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') - self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') + # Is this a Cray machine? (TODO: We need a better test than this.) + if os.environ.get('CRAYPE_VERSION'): + self.spec.mpicc = spack_cc + self.spec.mpicxx = spack_cxx + self.spec.mpifc = spack_fc + self.spec.mpif77 = spack_f77 + else: + self.spec.mpicc = join_path(self.prefix.bin, 'mpicc') + self.spec.mpicxx = join_path(self.prefix.bin, 'mpic++') + self.spec.mpifc = join_path(self.prefix.bin, 'mpif90') + self.spec.mpif77 = join_path(self.prefix.bin, 'mpif77') + self.spec.mpicxx_shared_libs = [ join_path(self.prefix.lib, 'libmpicxx.{0}'.format(dso_suffix)), join_path(self.prefix.lib, 'libmpi.{0}'.format(dso_suffix)) |