Wideband autonomous SDR analysis engine forked from sdr-visual-suite
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

46 wiersze
1.3KB

  1. $ErrorActionPreference = 'Stop'
  2. $gcc = 'C:\msys64\mingw64\bin'
  3. if (-not (Test-Path (Join-Path $gcc 'gcc.exe'))) {
  4. throw "gcc not found at $gcc"
  5. }
  6. $env:PATH = "$gcc;" + $env:PATH
  7. $env:CGO_ENABLED = '1'
  8. # SDRplay
  9. $env:CGO_CFLAGS = '-IC:\PROGRA~1\SDRplay\API\inc'
  10. $env:CGO_LDFLAGS = '-LC:\PROGRA~1\SDRplay\API\x64 -lsdrplay_api'
  11. # CUDA (cuFFT)
  12. # Prefer C:\CUDA if present (no spaces)
  13. $cudaInc = 'C:\CUDA\include'
  14. $cudaLib = 'C:\CUDA\lib\x64'
  15. $cudaBin = 'C:\CUDA\bin'
  16. if (-not (Test-Path $cudaInc)) {
  17. $cudaInc = 'C:\PROGRA~1\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include'
  18. $cudaLib = 'C:\PROGRA~1\NVIDIA GPU Computing Toolkit\CUDA\v13.2\lib\x64'
  19. $cudaBin = 'C:\PROGRA~1\NVIDIA GPU Computing Toolkit\CUDA\v13.2\bin'
  20. }
  21. if (Test-Path $cudaInc) {
  22. $env:CGO_CFLAGS = "$env:CGO_CFLAGS -I$cudaInc"
  23. }
  24. if (Test-Path $cudaLib) {
  25. $env:CGO_LDFLAGS = "$env:CGO_LDFLAGS -L$cudaLib -lcufft -lcudart"
  26. }
  27. if (Test-Path $cudaBin) {
  28. $env:PATH = "$cudaBin;" + $env:PATH
  29. }
  30. $cudaMingw = Join-Path $PSScriptRoot 'cuda-mingw'
  31. if (Test-Path $cudaMingw) {
  32. $env:CGO_LDFLAGS = "$env:CGO_LDFLAGS -L$cudaMingw"
  33. }
  34. Write-Host "Building with SDRplay + cuFFT support..." -ForegroundColor Cyan
  35. go build -tags "sdrplay,cufft" ./cmd/sdrd
  36. if ($LASTEXITCODE -ne 0) { throw "build failed" }
  37. Write-Host "Done." -ForegroundColor Green