# Configure, build and test on Windows (PowerShell). # # scripts\build.ps1 CUDA if the toolkit is installed, else CPU # scripts\build.ps1 cpu CPU only # scripts\build.ps1 cuda CUDA required # # Needs: Visual Studio 2022 with "Desktop development with C++", CMake 3.24+, # and for the GPU the CUDA toolkit 12.8 or newer (RTX 50 series need 12.8+). # Install the CUDA toolkit AFTER Visual Studio so it adds its build integration. # The tests need Python 3 with NumPy: pip install numpy tiktoken regex param([string]$Preset = "default") $ErrorActionPreference = "Stop" Set-Location (Join-Path $PSScriptRoot "..") cmake --preset $Preset if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } cmake --build --preset $Preset --parallel if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ($Preset -ne "portable" -and $Preset -ne "debug") { ctest --preset $Preset if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } } Write-Host "" Write-Host "built. Find hkimi.exe under the build folder (build\Release\hkimi.exe with Visual Studio)."