Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjward committed Dec 3, 2024
1 parent e96527c commit 3eb9800
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pip-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 14 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
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
import pybind11
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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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++",
Expand Down

0 comments on commit 3eb9800

Please sign in to comment.