summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJonas Thies <16190001+jthies@users.noreply.github.com>2021-10-12 17:11:00 +0200
committerGitHub <noreply@github.com>2021-10-12 11:11:00 -0400
commitf66ae104bfdc2546780bf7a3556538642d57a380 (patch)
tree076d39d3262a44dbb9e3fc9ba4af4ec5128bde33 /var
parent1e382d6d209baeb3ccb30e0d787be515f5708a66 (diff)
downloadspack-f66ae104bfdc2546780bf7a3556538642d57a380.tar.gz
spack-f66ae104bfdc2546780bf7a3556538642d57a380.tar.bz2
spack-f66ae104bfdc2546780bf7a3556538642d57a380.tar.xz
spack-f66ae104bfdc2546780bf7a3556538642d57a380.zip
phist: force MPI compiler wrappers (#26312)
* packages/phist, re #26002: force phist to use MPI compiler wrappers (copied from trilinos package) * packages/phist re #26002, use cmake-provded FindMPI module only * packages/phist source code formatting * packages/phist: set MPI_HOME rather than MPI_BASE_DIR, thanks @sethri. * phist: delete own FindMPI.cmake for older versions (rather than patching it away) * packages/phist: remove blank line * phist: adjust sorting of imports * phist: change order of imports
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/phist/package.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/phist/package.py b/var/spack/repos/builtin/packages/phist/package.py
index 87ce1d2ae3..d0d46e12d7 100644
--- a/var/spack/repos/builtin/packages/phist/package.py
+++ b/var/spack/repos/builtin/packages/phist/package.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import os
import spack.hooks.sbang as sbang
from spack import *
@@ -107,6 +108,7 @@ class Phist(CMakePackage):
# error will occur unless -DNO_WARN_X86_INTRINSICS is defined.
patch('ppc64_sse.patch', when='@1.7.4:1.9.4')
patch('update_tpetra_gotypes.patch', when='@:1.8')
+ patch('update_tpetra_gotypes.patch', when='@:1.8.99')
patch('sbang.patch', when='+fortran')
# ###################### Dependencies ##########################
@@ -140,11 +142,18 @@ class Phist(CMakePackage):
# to compile some OpenMP statements
conflicts('%gcc@:4.9.1')
+ # the phist repo came with it's own FindMPI.cmake before, which may cause some other
+ # MPI installation to be used than the one spack wants.
+ @when('@:1.9.6')
+ def patch(self):
+ os.unlink('cmake/FindMPI.cmake')
+
def setup_build_environment(self, env):
env.set('SPACK_SBANG', sbang.sbang_install_path())
def cmake_args(self):
spec = self.spec
+ define = CMakePackage.define
kernel_lib = spec.variants['kernel_lib'].value
outlev = spec.variants['outlev'].value
@@ -173,6 +182,15 @@ class Phist(CMakePackage):
% ('64' if '+int64' in spec else '32'),
self.define_from_variant('PHIST_HOST_OPTIMIZE', 'host'),
]
+ # Force phist to use the MPI wrappers instead of raw compilers
+ # (see issue #26002 and the comment in the trilinos package.py)
+ if '+mpi' in spec:
+ args.extend(
+ [define('CMAKE_C_COMPILER', spec['mpi'].mpicc),
+ define('CMAKE_CXX_COMPILER', spec['mpi'].mpicxx),
+ define('CMAKE_Fortran_COMPILER', spec['mpi'].mpifc),
+ define('MPI_HOME', spec['mpi'].prefix),
+ ])
return args