Archive | GNU Radio RSS feed for this section

CMakeLists.txt for dial_tone.cc

30 May

If you want to compile dial_tone.cc outside of either the GR source tree or OOT module, this is the minimum required CMakeLists.txt (courtesy of Johnathan Corgan)

https://github.com/gnuradio/gnuradio/blob/64a702e19d1e8e1b948e6ef76e98dff41837bb92/gr-audio/examples/c%2B%2B/dial_tone.cc


cmake_minimum_required(VERSION 2.6)
project(dialtone CXX)

find_package(Boost "1.35" COMPONENTS system)
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG AUDIO)
find_package(Gnuradio "3.7.2" REQUIRED)

include_directories(${GNURADIO_ALL_INCLUDE_DIRS})

add_executable(dialtone dial_tone.cc)
target_link_libraries(dialtone ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES})

Advertisements

GNURadio Tricks

20 Apr

Dynamic recording of files
Create a QT GUI Check Box with ID “Record” and set type to Boolean, and Default Value to False.

Create a variable with ID “file_name” and set Value to:
'data.bin' if Record==True else '/dev/null'

Create a File Sink with file “file_name”

GNU Radio and Ettus UHD Build Notes

8 Feb

Fedora 29 x86_64 with Python 3.7
Instructions at http://gnuradio.org/redmine/projects/gnuradio/wiki/BuildGuide

Dependencies
Dependencies listed at http://gnuradio.org/doc/doxygen/build_guide.html

Add to .profile
export PYTHONPATH=/usr/local/lib64/python3.7/site-packages:/usr/local/lib/python3.7/dist-packages
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

Dependencies for UHD 3.14
sudo dnf install
git
cmake
boost-devel
boost-python3-devel
ncurses-devel
libudev-devel
libusbx-devel
python3-devel
python3-mako

Build UHD
cd /usr/local/src/
git clone https://github.com/EttusResearch/uhd.git
cd uhd/host/
mkdir build
cd build
cmake -DENABLE_PYTHON3=ON -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DRUNTIME_PYTHON_EXECUTABLE=/usr/bin/python3 ../
make
make test
sudo make install

Files will be installed in:
/usr/local/bin
/usr/local/include/uhd
/usr/local/lib64

Additional dependencies for GNU Radio 3.8

swig
python3-sphinx
fftw-devel
gsl-devel
gmp-devel
mpir-devel
qwt-qt5-devel
python3-qt5-devel
portaudio-devel
orc-devel
zeromq-devel
cppzmq-devel
python3-zmq
texlive-dvips
xmlto
log4cpp-devel
SDL-devel
python3-click-plugins

Reboot the machine as there is something screwed up with the linker finding log4cpp on Fedora 29

Build GNU Radio
cd /usr/local/src
git clone --recursive https://github.com/gnuradio/gnuradio.git
cd gnuradio
mkdir build
cd build
cmake -DENABLE_PYTHON3=ON -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DRUNTIME_PYTHON_EXECUTABLE=/usr/bin/python3 ../
make
make test
sudo make install

Update and rebuild
cd build
sudo make uninstall
cd ..
rm -rf build
git pull --recurse-submodules=on
git submodule update
mkdir build
cd build
cmake -DENABLE_PYTHON3=ON -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DRUNTIME_PYTHON_EXECUTABLE=/usr/bin/python3 ../
make
make test
sudo make install