diff options
-rw-r--r-- | var/spack/repos/builtin/packages/mumps/package.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py index 2b5d6a333e..83b25ba140 100644 --- a/var/spack/repos/builtin/packages/mumps/package.py +++ b/var/spack/repos/builtin/packages/mumps/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import glob import os import sys @@ -44,6 +45,8 @@ class Mumps(Package): description='Activate the compilation of cmumps and/or zmumps') variant('int64', default=False, description='Use int64_t/integer*8 as default index type') + variant("incfort", default=False, + description="Use explicit types size in fortran headers") variant('shared', default=True, description='Build shared libraries') variant('openmp', default=True, description='Compile MUMPS with OpenMP support') @@ -76,6 +79,20 @@ class Mumps(Package): conflicts('+blr_mt', when='~openmp', msg="You cannot use the blr_mt variant without openmp") + @when("+incfort") + def patch(self): + """Set the effective integer type used during compilation. + Usual usecase: building mumps with int and compiling a program that + includes these headers with '-fdefault-integer-8'. + """ + headers = glob.glob("include/*.h") + intsize = 8 if "+int64" in self.spec else 4 + filter_file("INTEGER *,", "INTEGER({0}),".format(intsize), *headers) + filter_file("INTEGER *::", "INTEGER({0}) ::".format(intsize), *headers) + for typ in ("REAL", "COMPLEX", "LOGICAL"): + filter_file("{0} *,".format(typ), "{0}(4),".format(typ), *headers) + filter_file("{0} *::".format(typ), "{0}(4) ::".format(typ), *headers) + def write_makefile_inc(self): # The makefile variables LIBBLAS, LSCOTCH, LMETIS, and SCALAP are only # used to link the examples, so if building '+shared' there is no need |