Wideband autonomous SDR analysis engine forked from sdr-visual-suite
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

34 lignes
1.7KB

  1. $ErrorActionPreference = 'Stop'
  2. $msvcClDir = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64'
  3. $vcvars = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat'
  4. $cudaBin = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\bin'
  5. $cudaInc = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include'
  6. $sdrplayInc = 'C:\PROGRA~1\SDRplay\API\inc'
  7. $sdrplayLib = 'C:\PROGRA~1\SDRplay\API\x64'
  8. $cudaMingw = Join-Path $PSScriptRoot 'cuda-mingw'
  9. if (!(Test-Path (Join-Path $msvcClDir 'cl.exe'))) { throw "cl.exe not found at $msvcClDir" }
  10. if (!(Test-Path $vcvars)) { throw "vcvars64.bat not found at $vcvars" }
  11. if (!(Test-Path (Join-Path $cudaBin 'nvcc.exe'))) { throw "nvcc.exe not found at $cudaBin" }
  12. $env:PATH = "$msvcClDir;$cudaBin;" + $env:PATH
  13. $env:CGO_ENABLED = '1'
  14. $env:CC = 'cl.exe'
  15. $env:CXX = 'cl.exe'
  16. $env:CGO_CFLAGS = "-I$cudaInc -I$sdrplayInc"
  17. $env:CGO_LDFLAGS = "-L$sdrplayLib -lsdrplay_api -L$cudaMingw"
  18. Write-Host "Preparing CUDA kernel artifacts..." -ForegroundColor Cyan
  19. powershell -ExecutionPolicy Bypass -File tools\build-gpudemod-kernel.ps1
  20. if ($LASTEXITCODE -ne 0) { throw "kernel build failed" }
  21. Write-Host "Building Windows CUDA app with MSVC-oriented CGO path..." -ForegroundColor Cyan
  22. Write-Host "NOTE: This path is experimental. In this environment even 'go build runtime/cgo' emits GCC-style flags that MSVC rejects." -ForegroundColor Yellow
  23. & cmd.exe /c "call `"$vcvars`" && go build -x -tags `"sdrplay,cufft`" ./cmd/sdrd"
  24. if ($LASTEXITCODE -ne 0) {
  25. throw "windows cuda app build failed (current blocker: Go CGO emits GCC-style flags that cl.exe rejects, e.g. -Werror / -Wall / -fno-stack-protector)"
  26. }
  27. Write-Host "Done." -ForegroundColor Green