diff --git a/build-windows.ps1 b/build-windows.ps1 index 0e3ad5a..155e410 100644 --- a/build-windows.ps1 +++ b/build-windows.ps1 @@ -13,11 +13,20 @@ $env:VCPKG_ROOT="" $cmakeArgs = @() if ($env:BUILD_WITH_ACCEL -eq "cpu") { - $cmakeArgs += ("-DWHISPERCPP_WITH_CUDA=OFF") + $cmakeArgs += ( + "-DWHISPERCPP_WITH_CUDA=OFF", + "-DWHISPERCPP_WITH_HIPBLAS=OFF", + "-DWHISPERCPP_WITH_VULKAN=OFF", + "-DWHISPERCPP_WITH_MKL=OFF", + "-DCMAKE_GENERATOR=Visual Studio 17 2022" + ) $zipFileName = "whispercpp-windows-cpu-$Version.zip" } elseif ($env:BUILD_WITH_ACCEL -eq "hipblas") { - $cmakeArgs += ("-DWHISPERCPP_WITH_CUDA=OFF", - "-DWHISPERCPP_WITH_HIPBLAS=ON", + $cmakeArgs += ( + "-DWHISPERCPP_WITH_CUDA=OFF", + "-DWHISPERCPP_WITH_HIPBLAS=ON", + "-DWHISPERCPP_WITH_VULKAN=OFF", + "-DWHISPERCPP_WITH_MKL=OFF", "-DCMAKE_GENERATOR=Unix Makefiles", "-DCMAKE_C_COMPILER='$env:HIP_PATH\bin\clang.exe'", "-DCMAKE_CXX_COMPILER='$env:HIP_PATH\bin\clang++.exe'") @@ -25,7 +34,10 @@ if ($env:BUILD_WITH_ACCEL -eq "cpu") { $env:HIP_PLATFORM="amd" } elseif ($env:BUILD_WITH_ACCEL -eq "vulkan") { $cmakeArgs += ( + "-DWHISPERCPP_WITH_CUDA=OFF", + "-DWHISPERCPP_WITH_HIPBLAS=OFF", "-DWHISPERCPP_WITH_VULKAN=ON", + "-DWHISPERCPP_WITH_MKL=OFF", "-DCMAKE_GENERATOR=Visual Studio 17 2022" ) $zipFileName = "whispercpp-windows-vulkan-$Version.zip" @@ -34,6 +46,9 @@ if ($env:BUILD_WITH_ACCEL -eq "cpu") { $env:VULKAN_SDK_PATH="$vulkanSdkPath" } elseif ($env:BUILD_WITH_ACCEL -eq "mkl") { $cmakeArgs += ( + "-DWHISPERCPP_WITH_CUDA=OFF", + "-DWHISPERCPP_WITH_HIPBLAS=OFF", + "-DWHISPERCPP_WITH_VULKAN=OFF", "-DWHISPERCPP_WITH_MKL=ON", "-DCMAKE_GENERATOR=Visual Studio 17 2022" ) @@ -42,21 +57,21 @@ if ($env:BUILD_WITH_ACCEL -eq "cpu") { $mklPath = Get-ChildItem -Path "C:\Program Files (x86)\Intel\oneAPI" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 $env:MKL_PATH="$mklPath" } elseif ($env:BUILD_WITH_ACCEL -eq "cuda") { - $cmakeArgs += ( - "-DWHISPERCPP_WITH_CUDA=ON", - "-DCMAKE_GENERATOR=Visual Studio 17 2022" - ) $zipFileName = "whispercpp-windows-cuda-$Version.zip" # find the CUDA path in C:\Program Files\NVIDIA GPU Computing Toolkit $cudaPath = Get-ChildItem -Path "C:\Program Files\NVIDIA GPU Computing Toolkit" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 $env:CUDA_TOOLKIT_ROOT_DIR="$cudaPath" -} else { $cmakeArgs += ( "-DWHISPERCPP_WITH_CUDA=ON", + "-DWHISPERCPP_WITH_HIPBLAS=OFF", + "-DWHISPERCPP_WITH_VULKAN=OFF", + "-DWHISPERCPP_WITH_MKL=OFF", "-DCMAKE_GENERATOR=Visual Studio 17 2022", "-DCUDA_TOOLKIT_ROOT_DIR=$env:CUDA_TOOLKIT_ROOT_DIR" ) - $zipFileName = "whispercpp-windows-cuda-$Version.zip" +} else { + Write-Host "Invalid BUILD_WITH_ACCEL value. Please set it to 'cpu', 'cuda', 'vulkan', `mkl` or 'hipblas'." + exit } # configure