habdec/BuildInstructions.md

157 wiersze
4.8 KiB
Markdown

2018-11-02 15:06:08 +00:00
# Building HABDEC from source
Habdec relies on following dependencies:
- FFTW3
- boost (any version with boost-beast 1.66+)
- CMake version 3.8.2+ (make sure CMake version supports your boost version, otherwise CMake could fail finding stuff)
2018-11-02 15:06:08 +00:00
## Simplified Raspberry Pi Build
If you target RaspberryPi, consider starting with PiSDR image (https://github.com/luigifcruz/pisdr-image) or DragonOS image (https://cemaxecuter.com/).
These systems have all required libraries preinstalled.
You can also try starting with fresh/vanilla Raspberry Pi OS and download dependencies:
2023-05-16 21:42:10 +00:00
sudo apt install build-essential cmake pkg-config libfftw3-dev libfftw3-single3 libboost-dev
sudo apt install rtl-sdr libsoapysdr-dev soapysdr-tools soapysdr-module-rtlsdr
If all depencencies are preinstalled, use these commands to build habdec:
git clone --recurse-submodules https://github.com/ogre/habdec.git
cd habdec
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=Off ../code
make
make install
## Full Build With Dependencies
Below are instructions how to obtain and compile each library. Keep in mind, these are WIP and some adjustment to your build env may be needed.
2018-11-02 15:06:08 +00:00
For windows, you need to start 64bit build env, ie: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat`
## CMake
#### Windows
Just download and install binaries from https://cmake.org/download/
#### Linux
wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar -xf ./cmake-3.12.3.tar.gz
cd cmake-3.12.3
./configure --prefix=`pwd`/install
make -j4
2019-02-19 23:10:43 +00:00
make install
2018-11-02 15:06:08 +00:00
export PATH=$PATH:`pwd`/install
## boost
2018-11-02 15:06:08 +00:00
#### Linux
2022-10-09 18:57:57 +00:00
If you preffer using system installed boost, then remove `
set ( Boost_NO_SYSTEM_PATHS ON )` from websocketServer/CMakeLists.txt
To build your own boost:
2018-11-02 15:06:08 +00:00
wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
tar -xf ./boost_1_68_0.tar.gz
cd boost_1_68_0
./bootstrap.sh
./b2 -j 4 --layout=tagged --build-type=complete stage
#### Windows
2018-11-02 15:06:08 +00:00
Download from https://www.boost.org/users/download/ and unpack.
2018-11-02 15:06:08 +00:00
cd boost
bootstrap.bat
b2.exe --layout=tagged --build-type=complete --build-dir=build/static toolset=msvc address-model=64 link=static stage
## FFTW
You need to build FFTW with float (single precission) support. Also, enable neon optimizations for ARM.
#### Linux x86
wget http://fftw.org/fftw-3.3.8.tar.gz
tar -xf ./fftw-3.3.8.tar.gz
2018-11-02 15:06:08 +00:00
cd fftw-3.3.8
./configure --with-slow-timer --enable-single CFLAGS="-O4 -pipe -march=native -Wall" --prefix=`pwd`/install
make
make install
#### Linux ARM
wget http://fftw.org/fftw-3.3.8.tar.gz
tar -xf ./fftw-3.3.8.tar.gz
2018-11-02 15:06:08 +00:00
cd fftw-3.3.8
./configure --with-slow-timer --enable-single --enable-neon CFLAGS="-O4 -pipe -march=native -mfpu=neon -Wall" --prefix=`pwd`/install
make
make install
#### Windows
Download http://fftw.org/fftw-3.3.8.tar.gz and unpack.
cmake -D BUILD_SHARED_LIBS=0 -D ENABLE_FLOAT=1 -D CMAKE_INSTALL_PREFIX=d:\dev\c_libs\fftw\3.3.8\install -D CMAKE_BUILD_TYPE=Release -G "NMake Makefiles" ..\src
2018-11-02 15:06:08 +00:00
nmake
nmake install
## SoapySDR
#### Windows
Just go and install binaries from https://github.com/pothosware/PothosCore/wiki/Downloads
2018-11-13 20:59:52 +00:00
#### RaspberryPI
SoapySDR packages are available with apt on Raspbian, but I had problems with these.
You are encouraged to build from source, otherwise performance problems may arise.
2018-11-13 20:59:52 +00:00
tip: while building osmocom-rtlsdr driver, use this command:
cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
2018-11-02 15:06:08 +00:00
#### Linux
git clone https://github.com/pothosware/SoapySDR.git
cd SoapySDR
git pull origin master
mkdir build
cd build
cmake ..
2019-02-13 13:07:14 +00:00
make
2018-11-02 15:06:08 +00:00
sudo make install
sudo ldconfig
SoapySDRUtil --info
### SoapySDR AirSpy Support
git clone https://github.com/pothosware/SoapyAirspy.git
mkdir build
cd build
cmake ../SoapyAirspy
2018-11-02 15:06:08 +00:00
make
sudo make install
sudo ldconfig
### SoapySDR RTL-SDR Support
Refer to https://github.com/pothosware/SoapyRTLSDR
Tip: you might need to configure with:
`cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON`
2018-11-02 15:06:08 +00:00
## HABDEC Build
If you managed to build or install dependencies, you're ready do build habdec
2022-10-09 18:57:57 +00:00
git clone --recurse-submodules https://github.com/ogre/habdec.git
2018-11-02 15:06:08 +00:00
cd habdec
mkdir build
cd build
2022-10-09 18:57:57 +00:00
cmake -D BOOST_ROOT=/path/to/boost_1.68 -D FFTW_ROOT=/path/to/fftwf/install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=Off ../code
make -j 4
2018-11-02 15:06:08 +00:00
make install
You should end up with `install` dir that contains executable and a shell script that runs in loop (for cases where habdec crashes and you need continous run).