#!/bin/bash #To get a list of what options there are: # cd BUILD && cmake .. -LAH > xxx ############################ DEPENDENCIES ######################################### # before this, consider installing UHD from script uhd. # We may want the gnuradio ControlPort stuff to work: # https://www.gnuradio.org/doc/doxygen/page_ctrlport.html added more # prerequisites like thrift and etc below. # We need to install thrift, python3, pybind11, volk (GNUradio > v3.9.1.0), and # uhd from scripts in this directory # apt install libcodec2-dev libgsm1-dev libqt5opengl5-dev libcairo2-dev\ libgirepository1.0-dev libzmq3-dev libsphinxbase-dev sphinxbase-utils\ sphinx-common libsdl2-dev sdlbasic libsdl-console-dev libgsl-dev\ libyaml-dev doxygen cmake swig libfftw3-dev\ qtdeclarative5-dev qml-module-qtquick-controls\ portaudio19-dev libqwt-qt5-dev librtlsdr-dev\ python2.7 cmake libboost-all-dev libncurses-dev\ libusb-dev swig libfftw3-dev texlive libqwt-qt5-dev libusb-1.0-0-dev # # sudo apt install log4cpp: FAILs installed log4cpp from APT. # We installed log4cpp from a bash script from here # That script can't download the source for log4cpp, # you need to do that via an interactive browser. # TODO: This pip3 install command does not pick particular versions # of the packages, so this could break everything if there are changes # to the packages. # # pip3 install bs4 cycler decorator html5lib lxml matplotlib networkx\ pygraphviz pyparsing scipy sip subprocess32 tz zmq qtgui pyyaml pygi\ pycairo pygobject pyqt5 click click-plugins mako pyqt5-tools six mako\ PyYAML numpy pygobject pyqt5 thrift wheel # After installing this consider installing gr-grnet gr-specst gr-osmosdr #tag=v3.7.14.0 #tag=v3.8.2.0 tag=v3.8.3.0 #tag=v3.9.1.0 tarname=gnuradio-$tag # Looks like pybind fucks up its' installation of Cmake files so we # must set this so we can find the py11bind Cmake crap. #export pybind11_DIR=/usr/local/lib/python3.9/site-packages/pybind11-2.6.2-py3.9.egg/pybind11/share/cmake/pybind11 # volk is pulled into gnuradio 3.9 automatically volksha512sum= #volktarfile=volk-v2.3.0.tar.gz #volkurl=https://github.com/gnuradio/volk/tarball/v2.3.0 volktarfile=volk-v2.4.1.xx0.tar.gz volkurl=https://github.com/gnuradio/volk/tarball/1299d72c396a88fd2679adfd7a919ac00d2cf678 set -exo pipefail cd "$(dirname ${BASH_SOURCE[0]})" topdir=$PWD try=0 tarnameTry=$tarname-try-$try while [ -d "${tarnameTry}" ] ; do let try=$try+1 tarnameTry=$tarname-try-$try done builddir="${tarnameTry}" url=https://github.com/gnuradio/gnuradio/tarball/$tag prefix=/usr/local/encap/$tarnameTry tarfile=$tarname.tar.gz sha512sum= case "$tag" in v3.8.2.0) sha512sum= ;; v3.8.1.0) sha512sum= ;; esac function GetVolk() { if [ ! -e $topdir/$volktarfile ] ; then wget --no-check-certificate $volkurl -O $topdir/$volktarfile fi if [ -n "$volksha512sum" ] ; then echo "$volksha512sum $topdir/$volktarfile" | sha512sum -c - else set +x sha512sum $topdir/$volktarfile set -x fi mkdir -p volk cd volk tar --strip-components=1 -xzf $topdir/$volktarfile cd - } if [ ! -e "$tarfile" ] ; then wget --no-check-certificate $url -O $tarfile fi if [ -n "$sha512sum" ] ; then echo "$sha512sum $tarfile" | sha512sum -c - else set +x sha512sum $tarfile set -x fi mkdir "$builddir" cd "$builddir" tar --strip-components=1 -xzf ../$tarfile # We can comment this out for version 3.9 and up? GetVolk mkdir BUILD cd BUILD #UHD=ON UHD=OFF # So that the python3 that we installed can run well: #export LD_LIBRARY_PATH=/usr/local/lib cmake .. -G"Unix Makefiles"\ -DPYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python3\ -DCMAKE_INSTALL_PREFIX:PATH="${prefix}"\ -DCMAKE_INSTALL_RPATH:PATH="${prefix}/lib:/usr/local/lib"\ -DENABLE_DOXYGEN=OFF\ -DENABLE_PYTHON=ON\ -DENABLE_GRC=ON\ -DENABLE_GR_FFT=ON\ -DENABLE_GR_UTILS=ON\ -DENABLE_GR_QTGUI=ON\ -DENABLE_GR_UTILS=ON\ -DENABLE_GR_UHD=$UHD\ -DENABLE_GR_ZEROMQ=ON\ -DENABLE_DEFAULT=ON\ -DENABLE_DOXYGEN=ON\ -DENABLE_GR_CTRLPORT=ON\ -DENABLE_PERFORMANCE_COUNTERS=ON\ -DENABLE_INTERNAL_VOLK=ON\ -DENABLE_SPHINX=ON\ -DENABLE_GR_VIDEO_SDL=ON\ -DENABLE_GR_WAVELET=ON\ -DENABLE_GR_MODTOOL=ON #-DGNURADIO_RUNTIME_PYTHONPATH="${prefix}/lib/python3/dist-packages/gnuradio:${prefix}/lib/python3/dist-packages/gnuradio/gr:${prefix}/lib/python3/dist-packages/gnuradio/uhd"\ #-DGR_RUNTIME_PYTHONPATH="${prefix}/lib/python3/dist-packages/gnuradio:${prefix}/lib/python3/dist-packages/gnuradio/gr:${prefix}/lib/python3/dist-packages/gnuradio/uhd"\ make VERBOSE=1 # parallel make fails. #make VERBOSE=1 -j $(nproc) make install # The program gnuradio-companion can find the block grc files that are in # installation prefix without us symlinking them. When we symlink them we # get a printed WARNING from gnuradio-companion because it finds its # installed blocks twice. echo "blocks" > ${prefix}/share/gnuradio/grc/encap.exclude set +x cat << EOF SUCCESSFULLY installed $tarname in $prefix EOF