igneum/proto-cuda/build.bat
igneum-labs ff263245ac Igneum: design docs, Metal lottery-hash prototype, CUDA test pack, finality simulation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-03 15:06:01 +00:00

39 lines
1.5 KiB
Batchfile

@echo off
rem Build igneum-bench-cuda for one program pack (Windows).
rem Run from an "x64 Native Tools Command Prompt for VS 2022" so cl.exe is on PATH,
rem with CUDA Toolkit 12.8 or newer installed (nvcc on PATH).
rem Usage: build.bat [pack] [arch]
rem pack directory name under packs\ (default igneum-genesis)
rem arch nvcc -arch value (default sm_120 = RTX 50 series / Blackwell; "native" picks the installed GPU)
setlocal
cd /d "%~dp0"
set PACK=%1
if "%PACK%"=="" set PACK=igneum-genesis
set ARCH=%2
if "%ARCH%"=="" set ARCH=sm_120
where cl >nul 2>nul
if errorlevel 1 (
echo cl.exe not found. Open an "x64 Native Tools Command Prompt for VS 2022" ^(Visual Studio Build Tools, Desktop development with C++^) and run this again.
exit /b 1
)
where nvcc >nul 2>nul
if errorlevel 1 (
echo nvcc not found. Install CUDA Toolkit 12.8 or newer; the installer puts nvcc on PATH.
exit /b 1
)
if not exist "packs\%PACK%\kernel.cu" (
echo no pack at packs\%PACK% ^(expected kernel.cu, program.h, vectors.h^)
exit /b 1
)
nvcc --version
echo nvcc -O3 -std=c++17 -arch=%ARCH% -I "packs\%PACK%" -o "igneum-bench-cuda-%PACK%.exe" host.cu "packs\%PACK%\kernel.cu"
nvcc -O3 -std=c++17 -arch=%ARCH% -I "packs\%PACK%" -o "igneum-bench-cuda-%PACK%.exe" host.cu "packs\%PACK%\kernel.cu"
if errorlevel 1 (
echo build failed. If nvcc complains about an unsupported host compiler version, add -allow-unsupported-compiler to the command above.
exit /b 1
)
echo built igneum-bench-cuda-%PACK%.exe
endlocal