summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/mumps/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/mumps/package.py')
-rw-r--r--var/spack/repos/builtin/packages/mumps/package.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py
index 51fe2a9f06..b5fce95017 100644
--- a/var/spack/repos/builtin/packages/mumps/package.py
+++ b/var/spack/repos/builtin/packages/mumps/package.py
@@ -53,6 +53,9 @@ class Mumps(Package):
patch('examples.patch', when='@5.1.1%clang^spectrum-mpi')
patch('gfortran8.patch', when='@5.1.2')
+ # The following patches src/Makefile to fix some dependency
+ # issues in lib[cdsz]mumps.so
+ patch('mumps.src-makefile.patch', when='+shared')
def write_makefile_inc(self):
if ('+parmetis' in self.spec or '+ptscotch' in self.spec) and (
@@ -74,6 +77,8 @@ class Mumps(Package):
lapack_blas.ld_flags if not shared else '']
orderings = ['-Dpord']
+ # All of the lib[cdsz]mumps.* libs depend on mumps_common
+ extra_libs4mumps = ['-L$(topdir)/lib', '-lmumps_common']
if '+ptscotch' in self.spec or '+scotch' in self.spec:
makefile_conf.extend([
@@ -131,6 +136,10 @@ class Mumps(Package):
# TODO: test this part, it needs a full blas, scalapack and
# partitionning environment with 64bit integers
+ # The mumps.src-makefile.patch wants us to set these PIC variables
+ makefile_conf.append('FC_PIC_FLAG={0}'.format(fpic))
+ makefile_conf.append('CC_PIC_FLAG={0}'.format(cpic))
+
opt_level = '3' if using_xl else ''
if '+int64' in self.spec:
@@ -178,6 +187,8 @@ class Mumps(Package):
"FC = {0}".format(spack_fc),
"FL = {0}".format(spack_fc),
"MUMPS_TYPE = seq"])
+ # For sequential MUMPS, we need to link to a fake MPI lib
+ extra_libs4mumps += ['-L$(topdir)/libseq', '-lmpiseq']
# TODO: change the value to the correct one according to the
# compiler possible values are -DAdd_, -DAdd__ and/or -DUPPER
@@ -247,6 +258,10 @@ class Mumps(Package):
'RANLIB = ranlib'
])
+ # The mumps.src-makefile.patch wants EXTRA_LIBS4MUMPS defined
+ makefile_conf.extend([
+ 'EXTRA_LIBS4MUMPS = {0}'.format(' '.join(extra_libs4mumps))
+ ])
makefile_inc_template = join_path(
os.path.dirname(self.module.__file__), 'Makefile.inc')
with open(makefile_inc_template, "r") as fh: