openmpi, mvapich2, mpich : filtered out "--Wl,--enable-new-dtag" in wrappers, as it turns RPATH into RUNPATH

Apart from that turned `os.path.join` into `join_path` and `os.environ` into `env` in the packages
This commit is contained in:
alalazo
2016-06-15 13:16:29 +02:00
parent 1b28991e0a
commit b59d4f243b
3 changed files with 58 additions and 53 deletions

View File

@@ -23,7 +23,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
import os
class Mvapich2(Package):
@@ -245,15 +244,15 @@ def filter_compilers(self):
be bound to whatever compiler they were built with.
"""
bin = self.prefix.bin
mpicc = os.path.join(bin, 'mpicc')
mpicxx = os.path.join(bin, 'mpicxx')
mpif77 = os.path.join(bin, 'mpif77')
mpif90 = os.path.join(bin, 'mpif90')
mpicc = join_path(bin, 'mpicc')
mpicxx = join_path(bin, 'mpicxx')
mpif77 = join_path(bin, 'mpif77')
mpif90 = join_path(bin, 'mpif90')
spack_cc = os.environ['CC']
spack_cxx = os.environ['CXX']
spack_f77 = os.environ['F77']
spack_fc = os.environ['FC']
spack_cc = env['CC']
spack_cxx = env['CXX']
spack_f77 = env['F77']
spack_fc = env['FC']
kwargs = {
'ignore_absent': True,
@@ -261,6 +260,8 @@ def filter_compilers(self):
'string': True
}
# Substitute Spack compile wrappers for the real
# underlying compiler
filter_file('CC="%s"' % spack_cc,
'CC="%s"' % self.compiler.cc, mpicc, **kwargs)
filter_file('CXX="%s"' % spack_cxx,
@@ -269,3 +270,8 @@ def filter_compilers(self):
'F77="%s"' % self.compiler.f77, mpif77, **kwargs)
filter_file('FC="%s"' % spack_fc,
'FC="%s"' % self.compiler.fc, mpif90, **kwargs)
# Remove this linking flag if present
# (it turns RPATH into RUNPATH)
for wrapper in (mpicc, mpicxx, mpif77, mpif90):
filter_file('-Wl,--enable-new-dtags', '', wrapper, **kwargs)