summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authormcourtois <mathieu.courtois@gmail.com>2022-04-13 18:45:47 +0200
committerGitHub <noreply@github.com>2022-04-13 09:45:47 -0700
commit10a3822728a6b84731696b0362bc63fd09dc0e2a (patch)
treeee3c54167f4f1f03518a3073bb052e4b641fd5fe /var
parent586df30f9ab017e906e55570704bf14f7ceec9ba (diff)
downloadspack-10a3822728a6b84731696b0362bc63fd09dc0e2a.tar.gz
spack-10a3822728a6b84731696b0362bc63fd09dc0e2a.tar.bz2
spack-10a3822728a6b84731696b0362bc63fd09dc0e2a.tar.xz
spack-10a3822728a6b84731696b0362bc63fd09dc0e2a.zip
mumps: install header files as compiled (#29940)
Co-authored-by: Mathieu Courtois <mathieu.courtois@edf.fr>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/mumps/package.py17
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