Skip to content

Commit

Permalink
Enable multiple python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsokol committed Oct 25, 2024
1 parent 1d50acc commit 4013765
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ jobs:
cibuildwheel --output-dir ./wheelhouse
- name: Download cache from container ubuntu
if: (matrix.OS == 'ubuntu-20.04' && matrix.ARCH == 'x86_64') && (success() || failure())
working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
if: (matrix.os == 'ubuntu-20.04' && matrix.arch == 'x86_64') && (success() || failure())
#working-directory: ${{ steps.setup_base.outputs.WORKSPACE_ROOT }}
run: |
ccache -s
rm -rf $HOST_CCACHE_DIR
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ requires = [
"numpy",
"PyYAML",
]
build-backend = "setuptools.build_meta"
#build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
build-verbosity = 3
build-verbosity = 0
# manylinux-aarch64-image = "manylinux_2_28"
# manylinux-x86_64-image = "sameli/manylinux_2_28_x86_64_cuda_12.3"

[tool.cibuildwheel.linux]
build = "cp310-*"
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" }
Expand Down
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import subprocess
from pathlib import Path

import ninja
from setuptools import Extension, setup
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"]
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 @@ -30,6 +31,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name)
extdir = ext_fullpath.parent.resolve()
install_dir = extdir
ninja_executable_path = Path(ninja.BIN_DIR) / "ninja"

# BUILD LLVM
llvm_cmake_args = [
Expand All @@ -43,12 +45,13 @@ def build_extension(self, ext: CMakeExtension) -> None:
"-DLLVM_CCACHE_BUILD=ON",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON",
f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}",
]

subprocess.run(
["cmake", ext.llvm_source_dir, *llvm_cmake_args], cwd=llvm_build_dir, check=True,
)
subprocess.run(["ninja"], cwd=llvm_build_dir, check=True)
subprocess.run([ninja_executable_path], cwd=llvm_build_dir, check=True)

# INSTALL LLVM
subprocess.run(
Expand All @@ -64,12 +67,13 @@ def build_extension(self, ext: CMakeExtension) -> None:
f"-DMLIR_DIR={llvm_install_dir}/lib/cmake/mlir",
f"-DLLVM_EXTERNAL_LIT={llvm_build_dir}/bin/llvm-lit",
"-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON",
f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}",
]

subprocess.run(
["cmake", ext.finch_source_dir, *dialect_cmake_args], cwd=finch_build_dir, check=True,
)
subprocess.run(["ninja"], cwd=finch_build_dir, check=True)
subprocess.run([ninja_executable_path], cwd=finch_build_dir, check=True)

# INSTALL FINCH DIALECT
subprocess.run(
Expand Down

0 comments on commit 4013765

Please sign in to comment.