2022-11-07 02:48:38 +08:00
|
|
|
# Uncomment if you want to install Python. GHA provides this
|
|
|
|
|
|
|
|
#Write-Host "Installing python"
|
|
|
|
|
|
|
|
#Start-Process choco 'install python --version=3.10.8' -wait -NoNewWindow
|
|
|
|
|
|
|
|
#Write-Host "python installation completed successfully"
|
|
|
|
|
|
|
|
#Write-Host "Reload environment variables"
|
|
|
|
#$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
|
|
|
|
#Write-Host "Reloaded environment variables"
|
|
|
|
|
|
|
|
Write-Host "Installing Build Dependencies"
|
|
|
|
python -m venv .\mlir_venv\
|
2023-01-07 10:41:43 +08:00
|
|
|
.\mlir_venv\Scripts\Activate.PS1
|
2022-11-07 02:48:38 +08:00
|
|
|
pip install -r .\requirements.txt
|
2023-01-22 18:47:26 +08:00
|
|
|
pip install delvewheel
|
2022-11-07 02:48:38 +08:00
|
|
|
Write-Host "Build Deps installation completed successfully"
|
|
|
|
|
|
|
|
Write-Host "Building torch-mlir"
|
|
|
|
$env:CMAKE_GENERATOR='Ninja'
|
|
|
|
$env:TORCH_MLIR_ENABLE_LTC='0'
|
|
|
|
python -m pip wheel -v -w wheelhouse ./ -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html -r whl-requirements.txt
|
|
|
|
|
|
|
|
Write-Host "Build completed successfully"
|
2023-01-22 18:47:26 +08:00
|
|
|
|
|
|
|
Write-Host "Fixing up wheel dependencies"
|
|
|
|
delvewheel repair --add-path .\build\cmake_build\tools\torch-mlir\python_packages\torch_mlir\torch_mlir\_mlir_libs --add-dll TorchMLIRAggregateCAPI.dll --no-dll 'c10.dll;torch_python.dll;torch_cpu.dll' -v (get-item .\wheelhouse\torch_mlir*.whl).FullName
|
|
|
|
Write-Host "All Done."
|