Skip to content

Commit

Permalink
Enable macos jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsokol committed Oct 26, 2024
1 parent 4013765 commit a24dcc4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
build-wheel:
strategy:
matrix:
os: ['ubuntu-24.04'] #['macos-13', 'macos-14'] # 'ubuntu-24.04', , 'windows-2022'
os: ['macos-12'] #['macos-13', 'macos-14'] # 'ubuntu-24.04', , 'windows-2022'
arch: ['x86_64'] # , 'aarch64'
python: ['3.10'] # , '3.11', '3.12'
exclude:
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
cibuildwheel --output-dir ./wheelhouse
- name: Download cache from container ubuntu
if: (matrix.os == 'ubuntu-20.04' && matrix.arch == 'x86_64') && (success() || failure())
if: (matrix.os == 'ubuntu-24.04' && matrix.arch == 'x86_64') && (success() || failure())
#working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
ccache -s
Expand Down
39 changes: 16 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@ build-verbosity = 0
build = "cp310-* cp311-* cp312-*"
skip = ["*-manylinux_i686", "*-musllinux*"]
environment = { PATH = "/usr/lib/ccache:/usr/lib64/ccache:/usr/lib/ccache/bin:$PATH" }
# environment = { PATH = "/usr/lib/ccache:/usr/lib64/ccache:/usr/lib/ccache/bin:$PATH", PIP_FIND_LINKS = "https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest" }
before-build = [
"pip install -r requirements.txt",
"{project}/Finch-mlir/scripts/docker_prepare_ccache.sh"
]
# # "{project}/scripts/install_cuda.sh",
# "{project}/scripts/install_vulkan.sh",
# "{project}/scripts/apply_patches.sh",
# ]
#before-test = "ccache --show-stats"
environment-pass = [
#"CIBW_ARCHS",
# "CIBW_ARCHS",
"HOST_CCACHE_DIR",
]
# environment-pass = [
Expand Down Expand Up @@ -58,20 +52,19 @@ environment-pass = [
# "auditwheel repair -w {dest_dir} {wheel} --exclude libcuda.so.1 --exclude libvulkan.so.1 --exclude libomp.so --exclude libompd.so"
# ]

# [tool.cibuildwheel.macos]
# environment = { PATH = "/usr/local/opt/ccache/libexec:$PATH", PIP_FIND_LINKS = "https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest" }
# before-build = [
# "{project}/scripts/install_vulkan.sh",
# "{project}/scripts/apply_patches.sh",
# ]
# repair-wheel-command = [
# "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} --ignore-missing-dependencies"
# ]
[tool.cibuildwheel.macos]
build = "cp310-* cp311-* cp312-*"
environment = { PATH = "/usr/local/opt/ccache/libexec:$PATH" }
before-build = [
"pip install -r requirements.txt",
]
repair-wheel-command = [
"delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} --ignore-missing-dependencies"
]

# [tool.cibuildwheel.windows]
# environment = { PIP_FIND_LINKS = "https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest" }
# before-build = [
# "pip install delvewheel",
# "bash {project}\\scripts\\install_vulkan.sh",
# "bash {project}\\scripts\\apply_patches.sh",
# ]
[tool.cibuildwheel.windows]
build = "cp310-* cp311-* cp312-*"
before-build = [
"pip install delvewheel",
"pip install -r requirements.txt",
]
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from setuptools.command.build_ext import build_ext


LLVM_SOURCE_DIR = "./llvm-project" # os.environ["LLVM_SOURCE_DIR"]
FINCH_MLIR_SOURCE_DIR = "./Finch-mlir" # os.environ["FINCH_MLIR_SOURCE_DIR"]
PYTHON_EXECUTABLE = str(Path(sys.executable))


Expand All @@ -33,6 +31,10 @@ def build_extension(self, ext: CMakeExtension) -> None:
install_dir = extdir
ninja_executable_path = Path(ninja.BIN_DIR) / "ninja"

extra_flags = []
if sys.platform.startswith("darwin"):
extra_flags.append("-DCMAKE_OSX_DEPLOYMENT_TARGET=11.6")

# BUILD LLVM
llvm_cmake_args = [
"-G Ninja",
Expand All @@ -46,6 +48,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON",
f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}",
*extra_flags,
]

subprocess.run(
Expand All @@ -68,6 +71,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
f"-DLLVM_EXTERNAL_LIT={llvm_build_dir}/bin/llvm-lit",
"-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON",
f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}",
*extra_flags,
]

subprocess.run(
Expand Down Expand Up @@ -109,8 +113,8 @@ def create_dir(name: str) -> Path:
long_description_content_type="text/markdown",
ext_modules=[CMakeExtension(
"mlir_finch_ext",
llvm_source_dir=f"{LLVM_SOURCE_DIR}/llvm",
finch_source_dir=FINCH_MLIR_SOURCE_DIR,
llvm_source_dir=f"./llvm-project/llvm",
finch_source_dir="./Finch-mlir",
)],
cmdclass={"build_ext": CMakeBuild},
zip_safe=False,
Expand Down

0 comments on commit a24dcc4

Please sign in to comment.