Replace compiler in f90 and f77 wrappers if they exist

This commit is contained in:
David Beckingsale 2015-10-22 09:50:02 -07:00
parent 41c01b523f
commit 9f496e5efa

View File

@ -30,6 +30,7 @@ def setup_dependent_environment(self, module, spec, dep_spec):
os.environ['OMPI_CC'] = 'cc'
os.environ['OMPI_CXX'] = 'c++'
os.environ['OMPI_FC'] = 'f90'
os.environ['OMPI_F77'] = 'f77'
def install(self, spec, prefix):
@ -58,8 +59,8 @@ def filter_compilers(self):
"""Run after install to make the MPI compilers use the
compilers that Spack built the package with.
If this isn't done, they'll have CC, CXX, F77, and FC set
to Spack's generic cc, c++, f77, and f90. We want them to
If this isn't done, they'll have CC, CXX and FC set
to Spack's generic cc, c++ and f90. We want them to
be bound to whatever compiler they were built with.
"""
kwargs = { 'ignore_absent' : True, 'backup' : False, 'string' : False }
@ -68,7 +69,8 @@ def filter_compilers(self):
cc_wrappers = ['mpicc-vt-wrapper-data.txt', 'mpicc-wrapper-data.txt',
'ortecc-wrapper-data.txt', 'shmemcc-wrapper-data.txt']
cxx_wrappers = ['mpic++-vt-wrapper-data.txt', 'mpic++-wrapper-data.txt']
cxx_wrappers = ['mpic++-vt-wrapper-data.txt', 'mpic++-wrapper-data.txt',
'ortec++-wrapper-data.txt']
fc_wrappers = ['mpifort-vt-wrapper-data.txt',
'mpifort-wrapper-data.txt', 'shmemfort-wrapper-data.txt']
@ -84,3 +86,20 @@ def filter_compilers(self):
for wrapper in fc_wrappers:
filter_file('compiler=.*', 'compiler=%s' % self.compiler.fc,
os.path.join(dir, wrapper), **kwargs)
# These are symlinks in newer versions, so check that here
f77_wrappers = ['mpif77-vt-wrapper-data.txt', 'mpif77-wrapper-data.txt']
f90_wrappers = ['mpif90-vt-wrapper-data.txt', 'mpif90-wrapper-data.txt']
for wrapper in f77_wrappers:
path = os.path.join(dir, wrapper)
if not os.path.islink(path):
filter_file('compiler=.*', 'compiler=%s' % self.compiler.f77,
path, **kwargs)
for wrapper in f90_wrappers:
path = os.path.join(dir, wrapper)
if not os.path.islink(path):
filter_file('compiler=.*', 'compiler=%s' % self.compiler.fc,
path, **kwargs)