diff --git a/.github/workflows/pip-mac.yml b/.github/workflows/pip-mac.yml index b127e70417..678208aac2 100644 --- a/.github/workflows/pip-mac.yml +++ b/.github/workflows/pip-mac.yml @@ -94,6 +94,7 @@ jobs: export PETSC_DIR="$PWD/pip_venv/src/petsc" export PETSC_ARCH=default export HDF5_DIR="$PETSC_DIR/$PETSC_ARCH" + export HDF5_MPI=ON export CC=/opt/homebrew/bin/mpicc export CXX=/opt/homebrew/bin/mpicxx export MPICC="$CC" diff --git a/setup.py b/setup.py index 36a5fe5082..cf970c1712 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,5 @@ -from dataclasses import dataclass, field -from setuptools import setup, find_packages, Extension -from glob import glob -from pathlib import Path -from Cython.Build import cythonize import os +import platform import sys import site import numpy as np @@ -11,6 +7,11 @@ import petsc4py import rtree import pkgconfig +from dataclasses import dataclass, field +from setuptools import setup, find_packages, Extension +from glob import glob +from pathlib import Path +from Cython.Build import cythonize # Define the compilers to use if not already set if "CC" not in os.environ: @@ -87,7 +88,14 @@ def __getitem__(self, key): # Pybind11 # example: # gcc -I/pyind11/include ... -pybind11_ = ExternalDependency(include_dirs=[pybind11.get_include()]) +pybind11_extra_compile_args = [] +if platform.uname().system == "Darwin": + # Clang needs to specify at least C++11 + pybind11_extra_compile_args.append("-std=c++11") +pybind11_ = ExternalDependency( + include_dirs=[pybind11.get_include()], + extra_compile_args=pybind11_extra_compile_args, +) # numpy # example: @@ -225,7 +233,6 @@ def extensions(): ## PYBIND11 EXTENSIONS pybind11_list = [] # tinyasm/tinyasm.cpp: petsc, pybind11 - # tinyasm/tinyasm.cpp: petsc, pybind11 pybind11_list.append(Extension( name="tinyasm._tinyasm", language="c++",