Skip to content

Commit aa0f4b9

Browse files
authored
cray-mpich: fix, it was not using spack compiler wrappers (#57)
In the migration to spack 1.0 with #30 we inadvertently switch from using spack compiler wrappers (with all their support for correctly setting build flags) to using the "plain" regular compiler. This ended up with build problems (see spack/spack-packages#1193) because not using the spack compiler wrapper means not using `SPACK_STORE_*` variables that contains information about include/libs of all dependencies. This was more damaging for some build systems than others, but it might be that this triggered also subtle problems (possibly #51?).
1 parent 30cd663 commit aa0f4b9

File tree

1 file changed

+2
-22
lines changed
  • site/spack_repo/alps/packages/cray_mpich

1 file changed

+2
-22
lines changed

site/spack_repo/alps/packages/cray_mpich/package.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import platform
88

99
from spack_repo.builtin.build_systems.generic import Package
10+
from spack_repo.builtin.packages.mpich.package import MpichEnvironmentModifications
1011

1112
import spack.compilers
1213
from spack.package import *
@@ -55,7 +56,7 @@
5556
}
5657

5758

58-
class CrayMpich(Package):
59+
class CrayMpich(MpichEnvironmentModifications, Package):
5960
"""Install cray-mpich as a binary package"""
6061

6162
"""Intended to override the main cray-mpich"""
@@ -129,27 +130,6 @@ class CrayMpich(Package):
129130
conflicts("%gcc@:7")
130131
conflicts("%gcc@:11", when="@8.1.28:")
131132

132-
def setup_run_environment(self, env):
133-
env.set("MPICC", join_path(self.prefix.bin, "mpicc"))
134-
env.set("MPICXX", join_path(self.prefix.bin, "mpic++"))
135-
env.set("MPIF77", join_path(self.prefix.bin, "mpif77"))
136-
env.set("MPIF90", join_path(self.prefix.bin, "mpif90"))
137-
138-
def setup_dependent_build_environment(self, env, dependent_spec):
139-
self.setup_run_environment(env)
140-
if "c" in dependent_spec:
141-
env.set("MPICH_CC", dependent_spec["c"].package.cc)
142-
if"cxx" in dependent_spec:
143-
env.set("MPICH_CXX", dependent_spec["cxx"].package.cxx)
144-
if "fortran" in dependent_spec:
145-
env.set("MPICH_FC", dependent_spec["fortran"].package.fortran)
146-
147-
def setup_dependent_package(self, module, dependent_spec):
148-
self.spec.mpicc = join_path(self.prefix.bin, "mpicc")
149-
self.spec.mpicxx = join_path(self.prefix.bin, "mpic++")
150-
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
151-
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
152-
153133
def get_rpaths(self):
154134
# Those rpaths are already set in the build environment, so
155135
# let's just retrieve them.

0 commit comments

Comments
 (0)