From 31d0405b84e2130fa2113198e7f6773da50eebf8 Mon Sep 17 00:00:00 2001 From: Luigi Cruz Date: Tue, 11 Aug 2020 02:32:20 -0300 Subject: [PATCH] Add UHD support to GR3.7 --- builder/build.sh | 24 +++++++------ .../stage4/05-pisdr-gnuradio/00-packages-nr | 6 +++- builder/stage4/05-pisdr-gnuradio/00-run.sh | 34 +++++------------- builder/stage4/05-pisdr-gnuradio/01-run.sh | 35 +++++++++++++++++++ 4 files changed, 63 insertions(+), 36 deletions(-) create mode 100755 builder/stage4/05-pisdr-gnuradio/01-run.sh diff --git a/builder/build.sh b/builder/build.sh index 755b0c4..1d65bed 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -20,11 +20,13 @@ EOF PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-nr")" if [ -n "$PACKAGES" ]; then on_chroot << EOF -apt-get -m --ignore-missing --fix-missing install --no-install-recommends -y $PACKAGES || true -sleep 25 -apt-get -m --ignore-missing --fix-missing install --no-install-recommends -y $PACKAGES || true -sleep 25 -apt-get --ignore-missing --fix-missing install --no-install-recommends -y $PACKAGES +n=0 +until [ "$n" -ge 5 ] +do + apt-get --ignore-missing --fix-missing install --no-install-recommends -y $PACKAGES && break + n=$((n+1)) + sleep 15 +done EOF fi log "End ${SUB_STAGE_DIR}/${i}-packages-nr" @@ -34,11 +36,13 @@ EOF PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages")" if [ -n "$PACKAGES" ]; then on_chroot << EOF -apt-get -m --ignore-missing --fix-missing install -y $PACKAGES || true -sleep 25 -apt-get -m --ignore-missing --fix-missing install -y $PACKAGES || true -sleep 25 -apt-get --ignore-missing --fix-missing install -y $PACKAGES +n=0 +until [ "$n" -ge 5 ] +do + apt-get --ignore-missing --fix-missing install -y $PACKAGES && break + n=$((n+1)) + sleep 15 +done EOF fi log "End ${SUB_STAGE_DIR}/${i}-packages" diff --git a/builder/stage4/05-pisdr-gnuradio/00-packages-nr b/builder/stage4/05-pisdr-gnuradio/00-packages-nr index c858e2e..dfe2c7d 100644 --- a/builder/stage4/05-pisdr-gnuradio/00-packages-nr +++ b/builder/stage4/05-pisdr-gnuradio/00-packages-nr @@ -26,4 +26,8 @@ python-mako python3-mako python-dev python3-dev python-numpy python3-numpy python-sphinx python3-sphinx -python-cheetah python3-cheetah \ No newline at end of file +python-cheetah python3-cheetah + +libboost-all-dev +libusb-1.0-0-dev +python3-mako \ No newline at end of file diff --git a/builder/stage4/05-pisdr-gnuradio/00-run.sh b/builder/stage4/05-pisdr-gnuradio/00-run.sh index fe4ff70..bdb91d9 100755 --- a/builder/stage4/05-pisdr-gnuradio/00-run.sh +++ b/builder/stage4/05-pisdr-gnuradio/00-run.sh @@ -3,33 +3,17 @@ on_chroot << EOF mkdir -p "/home/${FIRST_USER_NAME}/PiSDR/Software" cd "/home/${FIRST_USER_NAME}/PiSDR/Software" - -if [ ! -d "volk" ]; then - git clone --recursive https://github.com/gnuradio/volk.git -fi - -cd volk -mkdir -p build -cd build -cmake -DCMAKE_BUILD_TYPE=Release ../ -make -j$(nproc) install -ldconfig -EOF - -on_chroot << EOF -mkdir -p "/home/${FIRST_USER_NAME}/PiSDR/Software" -cd "/home/${FIRST_USER_NAME}/PiSDR/Software" - -if [ ! -d "gnuradio" ]; then - git clone --recursive https://github.com/gnuradio/gnuradio.git +if [ ! -d "uhd" ]; then + git clone https://github.com/EttusResearch/uhd.git fi - -cd gnuradio -git checkout maint-3.7 +cd uhd/host +git checkout UHD-3.15.LTS mkdir -p build cd build -cmake -DENABLE_INTERNAL_VOLK=OFF -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python ../ +cmake -DCMAKE_CXX_FLAGS:STRING="-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15 -Wno-psabi" \ + -DCMAKE_C_FLAGS:STRING="-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15 -Wno-psabi" \ + -DCMAKE_ASM_FLAGS:STRING="-march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a15" \ + -DCMAKE_BUILD_TYPE=Release ../ make -j$(nproc) install ldconfig -EOF - +EOF \ No newline at end of file diff --git a/builder/stage4/05-pisdr-gnuradio/01-run.sh b/builder/stage4/05-pisdr-gnuradio/01-run.sh new file mode 100755 index 0000000..fe4ff70 --- /dev/null +++ b/builder/stage4/05-pisdr-gnuradio/01-run.sh @@ -0,0 +1,35 @@ +#!/bin/bash -e + +on_chroot << EOF +mkdir -p "/home/${FIRST_USER_NAME}/PiSDR/Software" +cd "/home/${FIRST_USER_NAME}/PiSDR/Software" + +if [ ! -d "volk" ]; then + git clone --recursive https://github.com/gnuradio/volk.git +fi + +cd volk +mkdir -p build +cd build +cmake -DCMAKE_BUILD_TYPE=Release ../ +make -j$(nproc) install +ldconfig +EOF + +on_chroot << EOF +mkdir -p "/home/${FIRST_USER_NAME}/PiSDR/Software" +cd "/home/${FIRST_USER_NAME}/PiSDR/Software" + +if [ ! -d "gnuradio" ]; then + git clone --recursive https://github.com/gnuradio/gnuradio.git +fi + +cd gnuradio +git checkout maint-3.7 +mkdir -p build +cd build +cmake -DENABLE_INTERNAL_VOLK=OFF -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python ../ +make -j$(nproc) install +ldconfig +EOF +