From 9f496e5efa0559dc1eccf26e20963eaf6755c00f Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 22 Oct 2015 09:50:02 -0700 Subject: Replace compiler in f90 and f77 wrappers if they exist --- var/spack/packages/openmpi/package.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/packages/openmpi/package.py b/var/spack/packages/openmpi/package.py index d2d095979e..c48d0557e5 100644 --- a/var/spack/packages/openmpi/package.py +++ b/var/spack/packages/openmpi/package.py @@ -30,6 +30,7 @@ class Openmpi(Package): 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 @@ class Openmpi(Package): """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 @@ class Openmpi(Package): 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 @@ class Openmpi(Package): 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) + + -- cgit v1.2.3-60-g2f50