Updated Windows build instructions with the pthread-win32 dependency

Vincent Sonnier 2018-05-19 15:45:48 +02:00
parent 8fdf16761c
commit e514a50967
1 changed files with 35 additions and 7 deletions

@ -88,23 +88,49 @@ Configure variables to indicate CubicSDR that modules files will be searched in
# Build Support Modules and dependencies
## Getting or Building low-level dependencies (`libusb`, `librtlsdr`...)
## Getting or building low-level dependencies
`libusb` is a low-level USB 'driver' used by the `librtlsdr` used in turn by the SoapySDR module below to talk to the hardware. There are 2 way to get them:
SoapySDR modules need hardware-specific libraries to communicate with the hardware. Such libraries either come from Open Source Software or are provided by the hardware vendor.
For instance,
* SoapyRTLSDR needs:
- `pthreads-win32` : POSIX threads emulation for Windows,
- `libusb` : low-level USB 'driver',
- `librtlsdr` which use the 2 libraries above to communicate with the RTL-SDR device.
* SoapySDRPlay needs:
- `mir_sdr_api` : SDRPlay provides binaries for most common platforms (see SoapySDRPlay section below)
### pthreads-win32
* Download the ZIP of pre-compiled binaries from ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip
* Unpack it as the following:
````
C:\MSVCDev\pthreads-win32\lib\x64\pthreadVC2.lib
C:\MSVCDev\pthreads-win32\include\*.h
C:\MSVCDev\pthreads-win32\dll\x64\pthreadVC2.dll
````
Copy the file `pthreadVC2.dll` in the `C:\MSVCDev\CubicSDR_win64\x64\` directory where CubicSDR can find it.
### libusb
Easiest way: use a pre-compiled `librtlsdr` binary which also package `libusb` from the [librtlsdr Releases](https://github.com/librtlsdr/librtlsdr/releases) page and choose the "x64" version.
Or compile it from source:
Or re-compile both libraries : (not complete)
* Clone or download https://github.com/libusb/libusb to C:\MSVCDev\libusb
* Build it using `C:\MSVCDev\libusb\msvc\libusb_2017.sln` choosing the `Release` and `x64` configuration.
Copy the file `libusb-1.0.dll` in the `C:\MSVCDev\CubicSDR_win64\x64\` directory where CubicSDR can find it.
### librtlsdr
* Clone or download https://github.com/libusb/libusb to C:\MSVCDev\libusb and build it using `C:\MSVCDev\libusb\msvc\libusb_2017.sln` choosing the `Release` and `x64` configuration.
* Clone or download https://github.com/librtlsdr/librtlsdr to C:\MSVCDev\librtlsdr
* Launch CMake, set source path to C:/MSVCDev/librtlsdr/
* Set destination to C:/MSVCDev/librtlsdr_win64/
* Click "Configure" and choose "Visual Studio 15 2017 Win64" and Finish
* Set LIBUSB_INCLUDE_DIR to C:/MSVCDev/libusb/
* Set LIBUSB_LIBRARIES to C:/MSVCDev/libusb/x64/Release/dll/libusb-1.0.lib
* Set THREADS_PTHREADS_INCLUDE_DIR to (TODO, decribe pthreads-win32 installation)
* Set THREADS_PTHREADS_WIN32_LIBRARY to (TODO, decribe pthreads-win32 installation)
* Set THREADS_PTHREADS_INCLUDE_DIR to C:/MSVCDev/pthreads-win32/include
* Set THREADS_PTHREADS_WIN32_LIBRARY to C:/MSVCDev/pthreads-win32/lib/x64/pthreadVC2.lib
* Click "Configure" again and then click "Generate"
Open "Developer Command Prompt for VS2017" by right-clicking and "Run as Administrator".
@ -118,7 +144,7 @@ C:\MSVCDEV> cmake --build librtlsdr_win64 --config Release --target install
0 Error(s)
```
Either way, copy the files `rtlsdr.dll` and `libusb-1.0.dll` in the `C:\MSVCDev\CubicSDR_win64\x64\` directory where CubicSDR can find them.
Copy the file `rtlsdr.dll` in the `C:\MSVCDev\CubicSDR_win64\x64\` directory where CubicSDR can find it.
## SoapyRTLSDR
@ -168,6 +194,8 @@ C:\MSVCDEV> cmake --build SoapySDRPlay_win64 --config Release --target install
Copy the generated module file `sdrPlaySupport.dll` in the C:\MSVCDev\CubicSDR_win64\x64\modules directory where CubicSDR can find it.
Don't forget to also copy the `C:\Program Files\SDRplay\API\x64\mir_sdr_api.dll` library file in the C:\MSVCDev\CubicSDR_win64\x64 directory where CubicSDR can find it.
# Debugging CubicSDR
Although all binaries are compiled in `Release`, it doesn't prevent debugging with it.