@@ -54,6 +54,14 @@ def __getitem__(self, key):
5454 raise KeyError (f"Key { key } not present" )
5555
5656
57+ # MPI
58+ # strip the leading 'gcc' or equivalent
59+ mpi_args = petsctools .get_petscvariables ()["MPICC_SHOW" ].split ()[1 :]
60+ mpi_ = ExternalDependency (
61+ extra_compile_args = mpi_args ,
62+ )
63+
64+
5765# Pybind11
5866# example:
5967# gcc -I/pyind11/include ...
@@ -158,56 +166,56 @@ def extensions():
158166 name = "firedrake.cython.dmcommon" ,
159167 language = "c" ,
160168 sources = [os .path .join ("firedrake" , "cython" , "dmcommon.pyx" )],
161- ** (petsc_ + numpy_ )
169+ ** (mpi_ + petsc_ + numpy_ )
162170 ))
163171 # firedrake/cython/extrusion_numbering.pyx: petsc, numpy
164172 cython_list .append (Extension (
165173 name = "firedrake.cython.extrusion_numbering" ,
166174 language = "c" ,
167175 sources = [os .path .join ("firedrake" , "cython" , "extrusion_numbering.pyx" )],
168- ** (petsc_ + numpy_ )
176+ ** (mpi_ + petsc_ + numpy_ )
169177 ))
170178 # firedrake/cython/hdf5interface.pyx: petsc, numpy, hdf5
171179 cython_list .append (Extension (
172180 name = "firedrake.cython.hdf5interface" ,
173181 language = "c" ,
174182 sources = [os .path .join ("firedrake" , "cython" , "hdf5interface.pyx" )],
175- ** (petsc_ + numpy_ + hdf5_ )
183+ ** (mpi_ + petsc_ + numpy_ + hdf5_ )
176184 ))
177185 # firedrake/cython/mgimpl.pyx: petsc, numpy
178186 cython_list .append (Extension (
179187 name = "firedrake.cython.mgimpl" ,
180188 language = "c" ,
181189 sources = [os .path .join ("firedrake" , "cython" , "mgimpl.pyx" )],
182- ** (petsc_ + numpy_ )
190+ ** (mpi_ + petsc_ + numpy_ )
183191 ))
184192 # firedrake/cython/patchimpl.pyx: petsc, numpy
185193 cython_list .append (Extension (
186194 name = "firedrake.cython.patchimpl" ,
187195 language = "c" ,
188196 sources = [os .path .join ("firedrake" , "cython" , "patchimpl.pyx" )],
189- ** (petsc_ + numpy_ )
197+ ** (mpi_ + petsc_ + numpy_ )
190198 ))
191199 # firedrake/cython/spatialindex.pyx: numpy, spatialindex
192200 cython_list .append (Extension (
193201 name = "firedrake.cython.spatialindex" ,
194202 language = "c" ,
195203 sources = [os .path .join ("firedrake" , "cython" , "spatialindex.pyx" )],
196- ** (numpy_ + spatialindex_ )
204+ ** (mpi_ + numpy_ + spatialindex_ )
197205 ))
198206 # firedrake/cython/supermeshimpl.pyx: petsc, numpy, supermesh
199207 cython_list .append (Extension (
200208 name = "firedrake.cython.supermeshimpl" ,
201209 language = "c" ,
202210 sources = [os .path .join ("firedrake" , "cython" , "supermeshimpl.pyx" )],
203- ** (petsc_ + numpy_ + libsupermesh_ )
211+ ** (mpi_ + petsc_ + numpy_ + libsupermesh_ )
204212 ))
205213 # pyop2/sparsity.pyx: petsc, numpy,
206214 cython_list .append (Extension (
207215 name = "pyop2.sparsity" ,
208216 language = "c" ,
209217 sources = [os .path .join ("pyop2" , "sparsity.pyx" )],
210- ** (petsc_ + numpy_ )
218+ ** (mpi_ + petsc_ + numpy_ )
211219 ))
212220 # PYBIND11 EXTENSIONS
213221 pybind11_list = []
@@ -216,7 +224,7 @@ def extensions():
216224 name = "tinyasm._tinyasm" ,
217225 language = "c++" ,
218226 sources = sorted (glob ("tinyasm/*.cpp" )), # Sort source files for reproducibility
219- ** (petsc_ + pybind11_ )
227+ ** (mpi_ + petsc_ + pybind11_ )
220228 ))
221229 return cythonize (cython_list ) + pybind11_list
222230
0 commit comments