| @@ -34,7 +34,7 @@ go build -tags sdrplay ./cmd/sdrd | |||||
| ``` | ``` | ||||
| #### Windows (GPU / CUDA + SDRplay) | #### Windows (GPU / CUDA + SDRplay) | ||||
| Recommended build path: | |||||
| The only supported Windows build path in this repository is: | |||||
| ```powershell | ```powershell | ||||
| powershell -ExecutionPolicy Bypass -File .\build-cuda-windows.ps1 | powershell -ExecutionPolicy Bypass -File .\build-cuda-windows.ps1 | ||||
| @@ -48,8 +48,8 @@ This path uses: | |||||
| Important: | Important: | ||||
| - `gpudemod_kernels.dll` must be present next to `sdrd.exe` or in `internal/demod/gpudemod/build/` | - `gpudemod_kernels.dll` must be present next to `sdrd.exe` or in `internal/demod/gpudemod/build/` | ||||
| - `build-sdrplay.ps1` copies the DLL to the repo root after a successful app build when available | |||||
| - this avoids directly linking MSVC CUDA kernel objects into the MinGW-linked Go binary | |||||
| - `build-sdrplay.ps1` prepares the runtime DLL placement and PATH setup for SDRplay + CUDA DLLs | |||||
| - older experimental Windows build scripts were removed to avoid confusion | |||||
| ### Linux | ### Linux | ||||
| ```bash | ```bash | ||||
| @@ -1,33 +0,0 @@ | |||||
| $ErrorActionPreference = 'Stop' | |||||
| $msvcClDir = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64' | |||||
| $vcvars = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat' | |||||
| $cudaBin = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\bin' | |||||
| $cudaInc = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.2\include' | |||||
| $sdrplayInc = 'C:\PROGRA~1\SDRplay\API\inc' | |||||
| $sdrplayLib = 'C:\PROGRA~1\SDRplay\API\x64' | |||||
| $cudaMingw = Join-Path $PSScriptRoot 'cuda-mingw' | |||||
| if (!(Test-Path (Join-Path $msvcClDir 'cl.exe'))) { throw "cl.exe not found at $msvcClDir" } | |||||
| if (!(Test-Path $vcvars)) { throw "vcvars64.bat not found at $vcvars" } | |||||
| if (!(Test-Path (Join-Path $cudaBin 'nvcc.exe'))) { throw "nvcc.exe not found at $cudaBin" } | |||||
| $env:PATH = "$msvcClDir;$cudaBin;" + $env:PATH | |||||
| $env:CGO_ENABLED = '1' | |||||
| $env:CC = 'cl.exe' | |||||
| $env:CXX = 'cl.exe' | |||||
| $env:CGO_CFLAGS = "-I$cudaInc -I$sdrplayInc" | |||||
| $env:CGO_LDFLAGS = "-L$sdrplayLib -lsdrplay_api -L$cudaMingw" | |||||
| Write-Host "Preparing CUDA kernel artifacts..." -ForegroundColor Cyan | |||||
| powershell -ExecutionPolicy Bypass -File tools\build-gpudemod-kernel.ps1 | |||||
| if ($LASTEXITCODE -ne 0) { throw "kernel build failed" } | |||||
| Write-Host "Building Windows CUDA app with MSVC-oriented CGO path..." -ForegroundColor Cyan | |||||
| Write-Host "NOTE: This path is experimental. In this environment even 'go build runtime/cgo' emits GCC-style flags that MSVC rejects." -ForegroundColor Yellow | |||||
| & cmd.exe /c "call `"$vcvars`" && go build -x -tags `"sdrplay,cufft`" ./cmd/sdrd" | |||||
| if ($LASTEXITCODE -ne 0) { | |||||
| 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)" | |||||
| } | |||||
| Write-Host "Done." -ForegroundColor Green | |||||
| @@ -1,38 +0,0 @@ | |||||
| $ErrorActionPreference = 'Stop' | |||||
| $llvm = 'C:\Program Files\LLVM\bin' | |||||
| $mingw = 'C:\msys64\mingw64' | |||||
| $gccBin = Join-Path $mingw 'bin' | |||||
| if (!(Test-Path (Join-Path $llvm 'clang.exe'))) { throw "clang.exe not found at $llvm" } | |||||
| if (!(Test-Path (Join-Path $gccBin 'gcc.exe'))) { throw "gcc.exe not found at $gccBin" } | |||||
| $cudaInc = 'C:\PROGRA~1\NVIDIA~2\CUDA\v13.2\include' | |||||
| $sdrplayInc = 'C:\PROGRA~1\SDRplay\API\inc' | |||||
| $sdrplayLib = 'C:\PROGRA~1\SDRplay\API\x64' | |||||
| $env:PATH = "$llvm;$gccBin;" + $env:PATH | |||||
| $env:CGO_ENABLED = '1' | |||||
| $env:CC = 'clang --target=x86_64-w64-windows-gnu --sysroot=C:/msys64/mingw64' | |||||
| $env:CXX = 'clang++ --target=x86_64-w64-windows-gnu --sysroot=C:/msys64/mingw64' | |||||
| $env:CPATH = "$cudaInc;$sdrplayInc" | |||||
| $env:C_INCLUDE_PATH = "$cudaInc;$sdrplayInc" | |||||
| $env:CPLUS_INCLUDE_PATH = "$cudaInc;$sdrplayInc" | |||||
| $env:CGO_CFLAGS = "--sysroot=C:/msys64/mingw64 -I$cudaInc -I$sdrplayInc" | |||||
| $env:CGO_CPPFLAGS = "--sysroot=C:/msys64/mingw64 -I$cudaInc -I$sdrplayInc" | |||||
| $env:CGO_CXXFLAGS = "--sysroot=C:/msys64/mingw64 -I$cudaInc -I$sdrplayInc" | |||||
| $env:CGO_LDFLAGS = "--sysroot=C:/msys64/mingw64 -L$sdrplayLib -lsdrplay_api" | |||||
| Write-Host "Testing runtime/cgo with clang GNU target..." -ForegroundColor Cyan | |||||
| go build runtime/cgo | |||||
| if ($LASTEXITCODE -ne 0) { throw "runtime/cgo build failed" } | |||||
| Write-Host "Preparing CUDA kernel artifacts..." -ForegroundColor Cyan | |||||
| powershell -ExecutionPolicy Bypass -File tools\build-gpudemod-kernel.ps1 | |||||
| if ($LASTEXITCODE -ne 0) { throw "kernel build failed" } | |||||
| Write-Host "Building Windows CUDA + SDRplay app with clang GNU target..." -ForegroundColor Cyan | |||||
| go build -tags "sdrplay,cufft" ./cmd/sdrd | |||||
| if ($LASTEXITCODE -ne 0) { throw "windows cuda clang build failed" } | |||||
| Write-Host "Done." -ForegroundColor Green | |||||
| @@ -1,14 +0,0 @@ | |||||
| $ErrorActionPreference = 'Stop' | |||||
| $gcc = 'C:\msys64\mingw64\bin' | |||||
| if (-not (Test-Path (Join-Path $gcc 'gcc.exe'))) { | |||||
| throw "gcc not found at $gcc" | |||||
| } | |||||
| $env:PATH = "$gcc;" + $env:PATH | |||||
| $env:CGO_ENABLED = '1' | |||||
| Write-Host "Building default Windows app path (no CUDA artifact integration assumptions)..." -ForegroundColor Cyan | |||||
| go build ./cmd/sdrd | |||||
| if ($LASTEXITCODE -ne 0) { throw "default windows build failed" } | |||||
| Write-Host "Done." -ForegroundColor Green | |||||
| @@ -20,6 +20,8 @@ The DLL split keeps that boundary at runtime instead of link time. | |||||
| ## Current Windows build flow | ## Current Windows build flow | ||||
| This is the only supported Windows build flow in the repository: | |||||
| ```powershell | ```powershell | ||||
| powershell -ExecutionPolicy Bypass -File .\build-cuda-windows.ps1 | powershell -ExecutionPolicy Bypass -File .\build-cuda-windows.ps1 | ||||
| powershell -ExecutionPolicy Bypass -File .\build-sdrplay.ps1 | powershell -ExecutionPolicy Bypass -File .\build-sdrplay.ps1 | ||||