Skip to content

Commit c60b270

Browse files
committed
update build script
1 parent a33977c commit c60b270

File tree

1 file changed

+44
-38
lines changed

1 file changed

+44
-38
lines changed

build.ps1

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ function Build-Native {
160160
$outputName = "nornicdb-cuda-bge"
161161
Write-Host "[BUILD] CUDA + Local Embeddings + BGE Model" -ForegroundColor Cyan
162162
}
163+
"vulkan" {
164+
# Vulkan backend (pure-Go bindings, no CUDA)
165+
# Requires Vulkan SDK at runtime (set VULKAN_SDK if needed)
166+
$tags = "vulkan"
167+
$cgoEnabled = "1"
168+
$outputName = "nornicdb-vulkan"
169+
Write-Host "[BUILD] Vulkan GPU (cross-platform NVIDIA/AMD/Intel)" -ForegroundColor Cyan
170+
Write-Host " Requires Vulkan SDK: https://vulkan.lunarg.com/" -ForegroundColor Yellow
171+
}
163172
default {
164173
Write-Host "[ERROR] Unknown variant: $Variant" -ForegroundColor Red
165174
return
@@ -202,16 +211,14 @@ function Build-Native {
202211
function Build-AllNative {
203212
param([switch]$Headless)
204213

205-
@("cpu", "cpu-localllm", "cpu-bge", "cuda", "cuda-bge") | ForEach-Object {
214+
@("cpu", "cpu-localllm", "cpu-bge", "cuda", "cuda-bge", "vulkan") | ForEach-Object {
206215
Write-Host ""
207216
Build-Native -Variant $_ -Headless:$Headless
208217
}
209218

210-
Write-Host ""
211-
Write-Host "╔══════════════════════════════════════════════════════════════╗" -ForegroundColor Green
212-
Write-Host "║ All variants built! ║" -ForegroundColor Green
213-
Write-Host "╚══════════════════════════════════════════════════════════════╝" -ForegroundColor Green
214-
Get-ChildItem "$BinDir\nornicdb*.exe" | ForEach-Object { Write-Host " $_" }
219+
Write-Host ""
220+
Write-Host "=== All variants built! ===" -ForegroundColor Green
221+
Get-ChildItem "$BinDir\nornicdb*.exe" | ForEach-Object { Write-Host (" {0}" -f $_.Name) }
215222
}
216223

217224
# =============================================================================
@@ -270,7 +277,7 @@ function Build-DockerImage {
270277
Invoke-Expression $cmd
271278

272279
if ($LASTEXITCODE -eq 0) {
273-
Write-Host "[DONE] Built $image" -ForegroundColor Green
280+
Write-Host ("[DONE] Built {0}" -f $image) -ForegroundColor Green
274281
}
275282
}
276283

@@ -298,9 +305,9 @@ switch ($Mode.ToLower()) {
298305
} elseif ($Target) {
299306
Build-Native -Variant $Target -Headless:$Headless
300307
} else {
301-
Write-Host "Usage: .\build.ps1 native <variant> [-Headless]"
308+
Write-Host "Usage: .\build.ps1 native VARIANT [-Headless]"
302309
Write-Host ""
303-
Write-Host "Variants: cpu, cpu-localllm, cpu-bge, cuda, cuda-bge, all"
310+
Write-Host "Variants: cpu, cpu-localllm, cpu-bge, cuda, cuda-bge, vulkan, all"
304311
}
305312
}
306313
"docker" {
@@ -310,7 +317,7 @@ switch ($Mode.ToLower()) {
310317
Build-DockerImage -Target $args[0]
311318
Push-DockerImage -Target $args[0]
312319
} else {
313-
Write-Host "Usage: .\build.ps1 docker [build|deploy] <target>"
320+
Write-Host "Usage: .\build.ps1 docker [build|deploy] TARGET"
314321
Write-Host ""
315322
Write-Host "Targets: amd64-cuda, amd64-cuda-bge, amd64-cpu"
316323
}
@@ -327,33 +334,32 @@ switch ($Mode.ToLower()) {
327334
Write-Host "Done."
328335
}
329336
default {
330-
Write-Host "╔══════════════════════════════════════════════════════════════╗" -ForegroundColor Cyan
331-
Write-Host "║ NornicDB Build Script ║" -ForegroundColor Cyan
332-
Write-Host "╚══════════════════════════════════════════════════════════════╝" -ForegroundColor Cyan
333-
Write-Host ""
334-
Write-Host "NATIVE BUILDS (Windows .exe):"
335-
Write-Host " .\build.ps1 native cpu CPU-only (smallest, ~15MB)"
336-
Write-Host " .\build.ps1 native cpu-localllm CPU + embeddings, BYOM (~25MB)"
337-
Write-Host " .\build.ps1 native cpu-bge CPU + embeddings + BGE (~425MB)"
338-
Write-Host " .\build.ps1 native cuda CUDA + embeddings, BYOM (~30MB)"
339-
Write-Host " .\build.ps1 native cuda-bge CUDA + embeddings + BGE (~430MB)"
340-
Write-Host " .\build.ps1 native all Build all variants"
341-
Write-Host ""
342-
Write-Host " Add -Headless to build without web UI"
343-
Write-Host ""
344-
Write-Host "DOCKER BUILDS (Linux containers):"
345-
Write-Host " .\build.ps1 docker build amd64-cuda"
346-
Write-Host " .\build.ps1 docker deploy amd64-cuda-bge"
347-
Write-Host ""
348-
Write-Host "SETUP:"
349-
Write-Host " .\build.ps1 download-libs Get pre-built llama.cpp"
350-
Write-Host " .\build.ps1 download-model Get BGE-M3 model (~400MB)"
351-
Write-Host ""
352-
Write-Host "PREREQUISITES BY VARIANT:"
353-
Write-Host " cpu: Go 1.23+"
354-
Write-Host " cpu-localllm: Go 1.23+, llama.cpp libs"
355-
Write-Host " cpu-bge: Go 1.23+, llama.cpp libs, BGE model"
356-
Write-Host " cuda: Go 1.23+, llama.cpp CUDA libs, CUDA Toolkit"
357-
Write-Host " cuda-bge: Go 1.23+, llama.cpp CUDA libs, CUDA Toolkit, BGE model"
337+
Write-Host 'NornicDB Build Script' -ForegroundColor Cyan
338+
Write-Host ''
339+
Write-Host 'NATIVE BUILDS (Windows .exe):'
340+
Write-Host '.\build.ps1 native cpu CPU-only (smallest, ~15MB)'
341+
Write-Host '.\build.ps1 native cpu-localllm CPU + embeddings, BYOM (~25MB)'
342+
Write-Host '.\build.ps1 native cpu-bge CPU + embeddings + BGE (~425MB)'
343+
Write-Host '.\build.ps1 native cuda CUDA + embeddings, BYOM (~30MB)'
344+
Write-Host '.\build.ps1 native cuda-bge CUDA + embeddings + BGE (~430MB)'
345+
Write-Host '.\build.ps1 native vulkan Vulkan GPU (cross-platform, ~20MB)'
346+
Write-Host '.\build.ps1 native all Build all variants'
347+
Write-Host ''
348+
Write-Host ' Add -Headless to build without web UI'
349+
Write-Host ''
350+
Write-Host 'DOCKER BUILDS (Linux containers):'
351+
Write-Host '.\build.ps1 docker build amd64-cuda'
352+
Write-Host '.\build.ps1 docker deploy amd64-cuda-bge'
353+
Write-Host ''
354+
Write-Host 'SETUP:'
355+
Write-Host '.\build.ps1 download-libs Get pre-built llama.cpp'
356+
Write-Host '.\build.ps1 download-model Get BGE-M3 model (~400MB)'
357+
Write-Host ''
358+
Write-Host 'PREREQUISITES BY VARIANT:'
359+
Write-Host ' cpu: Go 1.23+'
360+
Write-Host ' cpu-localllm: Go 1.23+, llama.cpp libs'
361+
Write-Host ' cpu-bge: Go 1.23+, llama.cpp libs, BGE model'
362+
Write-Host ' cuda: Go 1.23+, llama.cpp CUDA libs, CUDA Toolkit'
363+
Write-Host ' cuda-bge: Go 1.23+, llama.cpp CUDA libs, CUDA Toolkit, BGE model'
358364
}
359365
}

0 commit comments

Comments
 (0)