Skip to content

Commit

Permalink
Try response files
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsokol committed Nov 5, 2024
1 parent 9d0995c commit 49efb87
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .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: ['windows-2022'] # TODO: , 'ubuntu-24.04', 'macos-12', 'macos-14'
os: ['windows-2022', 'macos-12'] # TODO: , 'ubuntu-24.04', 'macos-12', 'macos-14'
arch: ['x86_64', 'aarch64']
python: ['3.10']
exclude:
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if(MLIR_ENABLE_BINDINGS_PYTHON)
message(STATUS "Enabling Python API")
add_subdirectory(python)
endif()
add_subdirectory(test)
add_subdirectory(finch-opt)
add_subdirectory(finch-plugin)
add_subdirectory(finch-translate)
#add_subdirectory(test)
#add_subdirectory(finch-opt)
#add_subdirectory(finch-plugin)
#add_subdirectory(finch-translate)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ requires = [
]

[tool.cibuildwheel]
build = "cp310-* cp311-* cp312-* cp313-*"
build = "cp310-*"
build-verbosity = 1
test-requires = ["pytest", "pytest-cov", "PyYAML", "scipy"]
before-test = "pip install --no-deps sparse@git+https://github.com/pydata/sparse@updated-llvm-nightly-test"
Expand Down
24 changes: 15 additions & 9 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ declare_mlir_python_extension(FinchPythonSources.Extension
ADD_TO_PARENT FinchPythonSources
SOURCES
FinchExtension.cpp
PRIVATE_LINK_LIBS
LLVMSupport
EMBED_CAPI_LINK_LIBS
FinchCAPI
MLIRCAPIIR
)

################################################################################
Expand All @@ -44,11 +43,18 @@ add_mlir_python_common_capi_library(FinchPythonCAPI
FinchPythonSources
# TODO: Remove this in favor of showing fine grained registration once
# available.
MLIRPythonExtension.ExecutionEngine
#MLIRPythonExtension.RegisterEverything
#MLIRPythonExtension.ExecutionEngine
MLIRPythonExtension.RegisterEverything
# MLIRFuncDialect
# MLIRAffineDialect
# MLIRArithDialect
# MLIRTensorDialect
# MLIRTransforms
# MLIRPass
# MLIRCAPIIR
#MLIRPythonSources.ExecutionEngine
#MLIRPythonSources.Dialects
MLIRPythonSources #.Core
#MLIRPythonSources #.Core
#LLVMSupport
#EMBED_CAPI_LINK_LIBS
#MLIRCAPIConversion
Expand All @@ -67,12 +73,12 @@ add_mlir_python_modules(FinchPythonModules
FinchPythonSources
# TODO: Remove this in favor of showing fine grained registration once
# available.
MLIRPythonExtension.Core
MLIRPythonSources
MLIRPythonExtension.RegisterEverything
#MLIRPythonExtension.Core
MLIRPythonExtension.ExecutionEngine
MLIRPythonSources.ExecutionEngine
MLIRPythonExtension.RegisterEverything
MLIRPythonSources
COMMON_CAPI_LINK_LIBS
FinchPythonCAPI
MLIRCAPIRegisterEverything
#MLIRCAPIRegisterEverything
)
19 changes: 18 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ def build_extension(self, ext: CMakeExtension) -> None:

llvm_lit = "llvm-lit.py" if platform.system() == "Windows" else "llvm-lit"

extra_flags_dialect = []
if platform.system() == "Windows":
extra_flags_dialect += [
"-DCMAKE_C_COMPILER=cl",
"-DCMAKE_CXX_COMPILER=cl",
"-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded",
"-DCMAKE_C_FLAGS=/MT",
"-DCMAKE_CXX_FLAGS=/MT",
"-DCMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES=ON",
"-DCMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES=ON",
"-DCMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES=ON",
"-DCMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES=ON",
"-DCMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS=ON",
"-DCMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON",
"-DCMAKE_NINJA_FORCE_RESPONSE_FILE=ON",
]

# BUILD FINCH DIALECT
dialect_cmake_args = [
"-G Ninja",
Expand All @@ -86,7 +103,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
"-DLLVM_ENABLE_ZLIB=OFF",
"-DLLVM_ENABLE_ZSTD=OFF",
f"-DPython3_EXECUTABLE={PYTHON_EXECUTABLE}",
*extra_flags,
*extra_flags_dialect,
]

subprocess.run(
Expand Down

0 comments on commit 49efb87

Please sign in to comment.