Repository: spack/spack

Issue:
openfoam does not find fujitsu mpi header
As noted by @t-karatsu on [OpenFOAM issue 16719](https://develop.openfoam.com/Development/openfoam/-/issues/1671) the recipe does not find `mpi.h` for Fujitsu MPI.

The OpenFOAM recipe still uses  `prefix.include` from the mpi spec instead of `headers.directories` (as per the change #7267), which means that it does not find the mpi header buried a few levels deeper.


openfoam does not find fujitsu mpi header
As noted by @t-karatsu on [OpenFOAM issue 16719](https://develop.openfoam.com/Development/openfoam/-/issues/1671) the recipe does not find `mpi.h` for Fujitsu MPI.

The OpenFOAM recipe still uses  `prefix.include` from the mpi spec instead of `headers.directories` (as per the change #7267), which means that it does not find the mpi header buried a few levels deeper.




Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/openfoam/package.py b/var/spack/repos/builtin/packages/openfoam/package.py
--- a/var/spack/repos/builtin/packages/openfoam/package.py
+++ b/var/spack/repos/builtin/packages/openfoam/package.py
@@ -214,11 +214,12 @@ def mplib_content(spec, pre=None):
     """The mpi settings (from spack) for the OpenFOAM wmake includes, which
     allows later reuse within OpenFOAM.
 
-    Optional parameter 'pre' to provide alternative prefix
+    Optional parameter 'pre' to provide alternative prefix for
+    bin and lib directories.
     """
     mpi_spec = spec['mpi']
     bin = mpi_spec.prefix.bin
-    inc = mpi_spec.prefix.include
+    inc = mpi_spec.headers.directories[0]  # Currently only need first one
     lib = pkglib(mpi_spec)
 
     libname = 'mpi'
@@ -283,6 +284,8 @@ class Openfoam(Package):
 
     variant('float32', default=False,
             description='Use single-precision')
+    variant('spdp', default=False,
+            description='Use single/double mixed precision')
     variant('int64', default=False,
             description='With 64-bit labels')
     variant('knl', default=False,
@@ -317,6 +320,7 @@ class Openfoam(Package):
     # introduced by the restriction within scotch!
     depends_on('flex@:2.6.1,2.6.4:')
     depends_on('cmake', type='build')
+    depends_on('m4', type='build')
 
     # Require scotch with ptscotch - corresponds to standard OpenFOAM setup
     depends_on('scotch~metis+mpi~int64', when='+scotch~int64')
@@ -848,7 +852,7 @@ def __init__(self, spec, **kwargs):
         self.compiler         = None   # <- %compiler
         self.arch_option      = ''     # Eg, -march=knl
         self.label_size       = None   # <- +int64
-        self.precision_option = 'DP'   # <- +float32
+        self.precision_option = 'DP'   # <- +float32 | +spdp
         self.compile_option   = kwargs.get('compile-option', '-spack')
         self.arch             = None
         self.options          = None
@@ -860,12 +864,11 @@ def __init__(self, spec, **kwargs):
         elif kwargs.get('label-size', True):
             self.label_size = '32'
 
-        if '+float32' in spec:
+        if '+spdp' in spec:
+            self.precision_option = 'SPDP'
+        elif '+float32' in spec:
             self.precision_option = 'SP'
 
-        # TDB: mixed precision?
-        # self.precision_option = 'SPDP'
-
         # Processor/architecture-specific optimizations
         if '+knl' in spec:
             self.arch_option = '-march=knl'
diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py
--- a/var/spack/repos/builtin/packages/scotch/package.py
+++ b/var/spack/repos/builtin/packages/scotch/package.py
@@ -14,6 +14,7 @@ class Scotch(Package):
     url      = "http://gforge.inria.fr/frs/download.php/latestfile/298/scotch_6.0.4.tar.gz"
     list_url = "http://gforge.inria.fr/frs/?group_id=248"
 
+    version('6.0.9', sha256='622b4143cf01c480bb15708b3651b29c25e4aeb00c8c6447ff196aca2eca5c93')
     version('6.0.8', sha256='0ba3f145026174304f910c8770a3cbb034f213c91d939573751cfbb4fd46d45e')
     version('6.0.6', sha256='686f0cad88d033fe71c8b781735ff742b73a1d82a65b8b1586526d69729ac4cf')
     version('6.0.5a', sha256='5b21b95e33acd5409d682fa7253cefbdffa8db82875549476c006d8cbe7c556f')


Test patch: