diff --git a/esc-time-capsule/Dockerfile b/esc-time-capsule/Dockerfile new file mode 100644 index 0000000..4dd8567 --- /dev/null +++ b/esc-time-capsule/Dockerfile @@ -0,0 +1,93 @@ +# ettusresearch/esc-time-capsule:18.04 + +# Provides a base Ubuntu (18.04) image with latest UHD installed + +FROM ubuntu:18.04 +MAINTAINER Robin Coxe + +# Last build date - this can be updated whenever there are security updates so +# that everything is rebuilt +ENV security_updates_as_of 2020-08-09 + +# This will make apt-get install without question +ARG DEBIAN_FRONTEND=noninteractive +ARG UHD_TAG=v3.14.0.0 +ARG MAKEWIDTH=2 + +# Install security updates and required packages +RUN apt-get update +RUN apt-get -y install -q \ + build-essential \ + ccache \ + git \ + python3-dev \ + python3-pip \ + curl +# Install UHD dependencies +RUN apt-get -y install -q \ + libboost-all-dev \ + libusb-1.0-0-dev \ + libudev-dev \ + python3-mako \ + doxygen \ + python3-docutils \ + cmake \ + python3-requests \ + python3-numpy \ + dpdk \ + libdpdk-dev +#Install Vivado XSIM and MIG dependencies +RUN apt-get install -y \ + wget \ + libglib2.0-0 \ + libsm6 \ + libxi6 \ + libxrender1 \ + libxrandr2 \ + libfreetype6 \ + libfontconfig + +RUN rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /usr/local/src +RUN git clone https://github.com/EttusResearch/uhd.git /usr/local/src/uhd +RUN cd /usr/local/src/uhd/ && git checkout $UHD_TAG +RUN mkdir -p /usr/local/src/uhd/host/build +WORKDIR /usr/local/src/uhd/host/build +RUN cmake .. -DENABLE_PYTHON3=ON -DUHD_RELEASE_MODE=release -DCMAKE_INSTALL_PREFIX=/usr +RUN make -j $MAKEWIDTH +RUN make install +WORKDIR / +# copy in config file +COPY install_config.txt / + +# download and run the Vivado install +ARG VIVADO_TAR_HOST=host_ip:8000 +ARG VIVADO_TAR_FILE=Xilinx_Vivado_SDK_2017.4_1216_1 +ARG VIVADO_VERSION=2017.4 +RUN echo "Downloading ${VIVADO_TAR_FILE} from ${VIVADO_TAR_HOST}" && \ + wget ${VIVADO_TAR_HOST}/${VIVADO_TAR_FILE}.tar.gz -q +#Can copy Vivado tarball directly as an alternative to wget. +#COPY ${VIVADO_TAR_FILE}.tar.gz / +RUN echo "Extracting Vivado tar file" && \ + tar xzf ${VIVADO_TAR_FILE}.tar.gz && \ + /${VIVADO_TAR_FILE}/xsetup --agree 3rdPartyEULA,WebTalkTerms,XilinxEULA --batch Install --config install_config.txt && \ + rm -rf ${VIVADO_TAR_FILE}* + +#add vivado tools to path (root) +RUN echo "source /opt/Xilinx/Vivado/${VIVADO_VERSION}/settings64.sh" >> /root/.profile + +#copy in the license file (root) +RUN mkdir -p /root/.Xilinx +COPY Xilinx.lic /root/.Xilinx/ + +#make a Vivado user +RUN adduser --disabled-password --gecos '' vivado +USER vivado +WORKDIR /home/vivado +#add vivado tools to path +RUN echo "source /opt/Xilinx/Vivado/${VIVADO_VERSION}/settings64.sh" >> /home/vivado/.bashrc + +#copy in the license file for vivado user +RUN mkdir /home/vivado/.Xilinx +COPY Xilinx.lic /home/vivado/.Xilinx/ diff --git a/esc-time-capsule/README b/esc-time-capsule/README new file mode 100644 index 0000000..8916015 --- /dev/null +++ b/esc-time-capsule/README @@ -0,0 +1,37 @@ +Installs +Ubuntu 18.04 +Vivado 2017.4 (required for UHD-v.3.14-- yes I know, it's ancient.) +UHD v.3.14.0.0 + + +HOW TO USE: + +Install Docker (assumes a Ubuntu Linux system): +sudo apt install docker.io + +Start Docker: +sudo systemctl enable --now docker + +Create UHD/GNU Radio Docker image: +1) Navigate to the location where the ettus-docker/esc-time-capsule/Dockerfile lives. +2) sudo docker build -t ettusresearch/esc-time-capsule ./ +3) Go for a run, bake some sourdough loaves, and have a few drinks-- this step takes a good long while. + +Run the Docker Image (text only): +sudo docker run --rm --interactive --tty ettusresearch/esc-time-capsule:latest /bin/bash + +If you'd like to use the Vivado GUI for some reason: +On your PC: xhost local:root +Then run the docker image: +sudo docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY ettusresearch/esc-time-capsule:latest /bin/bash + +List Docker Images: +sudo docker image list + +How to Delete the Docker Image: +sudo docker rmi --force ettusresearch/esc-time-capsule ettusresearch/esc-time-capsule + +If you don't want to run Docker as sudo, consult this webpage: +https://docs.docker.com/engine/install/linux-postinstall/ + + diff --git a/esc-time-capsule/Vivado_README.md b/esc-time-capsule/Vivado_README.md new file mode 100644 index 0000000..fa2ca19 --- /dev/null +++ b/esc-time-capsule/Vivado_README.md @@ -0,0 +1,18 @@ +# vivado-docker + +Vivado installed into a docker image for CI purposes. + +## Build instructions + +1. This docker file assumes the Vivado download is available on a webserver somewhere. This can easily be the build machine using the webserver in Python. + ```shell + cd /path/to/Vivado/download + python -m http.server + ``` +2. Copy your Vivado `Xilinx.lic` file into the directory. +3. Potentialy modify the `install_config.txt` to change the install options. +4. Build the image as described in README: sudo docker build -t ettusresearch/esc-time-capsule ./ + +## Running + +The `Dockerfile` sets up a `vivado` user to avoid running as root. I have only considered running Vivado in `batch` mode for running CI simulations and building bit files. For development work with the GUI you may have to fiddle with X11 settings. diff --git a/esc-time-capsule/install_config.txt b/esc-time-capsule/install_config.txt new file mode 100644 index 0000000..258be51 --- /dev/null +++ b/esc-time-capsule/install_config.txt @@ -0,0 +1,27 @@ +#### Vivado HL WebPACK Install Configuration #### +Edition=Vivado HL Design Edition + +# Path where Xilinx software will be installed. +Destination=/opt/Xilinx + +# Choose the Products/Devices the you would like to install. +Modules=Software Development Kit (SDK):0,DocNav:0,Kintex UltraScale:0,Zynq-7000:1,System Generator for DSP:0,Artix-7:0,Kintex-7:1 + +# Choose the post install scripts you'd like to run as part of the finalization step. Please note that some of these scripts may require user interaction during runtime. +InstallOptions=Acquire or Manage a License Key:0,Enable WebTalk for SDK to send usage statistics to Xilinx:0 + +## Shortcuts and File associations ## +# Choose whether Start menu/Application menu shortcuts will be created or not. +CreateProgramGroupShortcuts=0 + +# Choose the name of the Start menu/Application menu shortcut. This setting will be ignored if you choose NOT to create shortcuts. +ProgramGroupFolder=Xilinx Design Tools + +# Choose whether shortcuts will be created for All users or just the Current user. Shortcuts can be created for all users only if you run the installer as administrator. +CreateShortcutsForAllUsers=0 + +# Choose whether shortcuts will be created on the desktop or not. +CreateDesktopShortcuts=0 + +# Choose whether file associations will be created or not. +CreateFileAssociation=0 diff --git a/ubuntu-uhd-gnuradio/Dockerfile b/ubuntu-uhd-gnuradio/Dockerfile new file mode 100644 index 0000000..3a9a57f --- /dev/null +++ b/ubuntu-uhd-gnuradio/Dockerfile @@ -0,0 +1,176 @@ +# ettusresearch/ubuntu-uhd-gnuradio:18.04 + +# Provides a base Ubuntu (18.04) image with the latest (as of 2 May 2020) UHD and GNU Radio installed + +FROM ubuntu:18.04 +MAINTAINER Ettus Research + +# Last build date - this can be updated whenever there are security updates so +# that everything is rebuilt +ENV security_updates_as_of 2020-05-01 + +# This will make apt-get install without question +ARG DEBIAN_FRONTEND=noninteractive +ARG UHD_TAG=v3.15.0.0 +ARG GR_TAG=v3.8.1.0 +ARG MAKEWIDTH=2 + +# Install security updates and required packages +RUN apt-get update +RUN apt-get -y install -q \ + build-essential \ + apt-utils \ + ccache \ + git \ + python3-dev \ + python3-pip \ + curl +# Install UHD and GNU Radio dependencies for Ubuntu 18.04 +# Mostly based on the now-obsolete AN-445 on the Ettus Research Knowledge Base: +#https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux +# There are probably some unneeded Python2 and other random packages that get installed in this step. Meh. +RUN apt-get -y install -q \ + swig \ + cmake \ + doxygen \ + libboost-all-dev \ + libtool \ + libusb-1.0-0 \ + libusb-1.0-0-dev \ + libudev-dev \ + libncurses5-dev \ + libfftw3-bin \ + libfftw3-dev \ + libfftw3-doc \ + libcppunit-1.14-0 \ + libcppunit-dev \ + libcppunit-doc \ + ncurses-bin \ + cpufrequtils \ + python-numpy \ + python-numpy-doc \ + python-numpy-dbg \ + python-scipy \ + python-docutils \ + python3-numpy \ + python3-docutils \ + python3-mako \ + python3-requests\ + dpdk \ + libdpdk-dev \ + qt4-bin-dbg \ + qt4-default \ + qt4-doc \ + libqt4-dev \ + libqt4-dev-bin \ + python-qt4 \ + python-qt4-dbg \ + python-qt4-dev \ + python-qt4-doc \ + python-qt4-doc \ + libqwt6abi1 \ + libfftw3-bin \ + libfftw3-dev \ + libfftw3-doc \ + ncurses-bin \ + libncurses5 \ + libncurses5-dev \ + libncurses5-dbg \ + libfontconfig1-dev \ + libxrender-dev \ + libpulse-dev \ + g++ \ + automake \ + autoconf \ + python-dev \ + libcppunit-dev \ + fort77 \ + libsdl1.2-dev \ + python-wxgtk3.0 \ + ccache \ + python-opengl \ + libgsl-dev \ + python-cheetah \ + python-mako \ + python-lxml \ + doxygen \ + qt4-dev-tools \ + libqwtplot3d-qt5-dev \ + pyqt4-dev-tools \ + python-qwt5-qt4 \ + wget \ + libxi-dev \ + gtk2-engines-pixbuf \ + r-base-dev \ + python-tk \ + liborc-0.4-0 \ + liborc-0.4-dev \ + libasound2-dev \ + python-gtk2 \ + libzmq3-dev \ + libzmq5 python-requests \ + python-sphinx \ + libcomedi-dev \ + python-zmq \ + libqwt-dev \ + libqwt6abi1 \ + python-six \ + libgps-dev \ + libgps23 \ + gpsd \ + gpsd-clients \ + python-gps \ + liblog4cpp5-dev \ + thrift-compiler \ + python-thrift \ + jack \ + python-click \ + python-click-plugins \ + libcodec2-dev \ + portaudio19-dev \ + libgsm-tools \ + libgsm1-dev \ + libgmp10 \ + libgmp-dev \ + python-setuptools +# More dependencies brought to you by GNU Radio v3.8.x.x. +RUN apt-get -y install -q \ + python3-yaml \ + python3-gi \ + python3-gi-cairo \ + gir1.2-gtk-3.0 \ + libqt5opengl5-dev \ + python3-pyqt5 \ + pyqt5-dev-tools \ + qttools5-dev-tools \ + libqwt-qt5-dev \ + python3-click \ + python3-click-plugins +RUN rm -rf /var/lib/apt/lists/* +RUN git clone https://github.com/EttusResearch/uhd.git /usr/local/src/uhd +RUN cd /usr/local/src/uhd/ && git checkout $UHD_TAG +RUN mkdir -p /usr/local/src/uhd/host/build +WORKDIR /usr/local/src/uhd/host/build +RUN cmake .. -DUHD_RELEASE_MODE=release -DCMAKE_INSTALL_PREFIX=/usr +RUN make -j $MAKEWIDTH +RUN make install +RUN ldconfig +RUN uhd_images_downloader +RUN git clone https://github.com/gnuradio/volk.git /usr/local/src/volk +RUN cd /usr/local/src/volk +RUN mkdir -p /usr/local/src/volk/build +WORKDIR /usr/local/src/volk/build +RUN cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_INSTALL_PREFIX=/usr ../ +RUN make -j $MAKEWIDTH +RUN make install +RUN ldconfig +RUN git clone https://github.com/gnuradio/gnuradio.git /usr/local/src/gnuradio +RUN cd /usr/local/src/gnuradio && git checkout $GR_TAG +RUN mkdir -p /usr/local/src/gnuradio/build +WORKDIR /usr/local/src/gnuradio/build +RUN cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_INTERNAL_VOLK=OFF ../ +RUN make -j $MAKEWIDTH +RUN make install +RUN ldconfig +WORKDIR / + diff --git a/ubuntu-uhd-gnuradio/README b/ubuntu-uhd-gnuradio/README new file mode 100644 index 0000000..c1c21e1 --- /dev/null +++ b/ubuntu-uhd-gnuradio/README @@ -0,0 +1,41 @@ +Since the release of UHD v3.15.0.0 and GNU Radio v.3.8.1.0, the Ubuntu 18.04 dependencies to build from source have changed +and the UHD and GNU Radio documentation has not been updated accordingly (as of 2 May 2020). + +The path of least resistance is to undoubtedly to upgrade your PC to Ubuntu 20.04 and install UHD and GNU Radio as follows: +sudo apt install libuhd3.15.0 +sudo apt install gnuradio + +However, if you would like to build from source and are running Ubuntu 18.04, you can either use the dependencies in this +Dockerfile as a reference without using Docker or you could just deploy the container. + +HOW TO USE: + +Install Docker (assumes a Ubuntu Linux system): +sudo apt install docker.io + +Start Docker: +sudo systemctl enable --now docker + +Create UHD/GNU Radio Docker image: +1) Navigate to the location where the ettus-docker/ubuntu-uhd-gnuradio/Dockerfile lives. +2) sudo docker build -t ettusresearch/ubuntu-uhd-gnuradio ./ +3) Go for a run, bake some sourdough loaves, and have a few drinks-- this step takes a good long while. + +Run the Docker Image (text only): +sudo docker run --rm --interactive --tty ettusresearch/ubuntu-uhd-gnuradio:latest /bin/bash + +If you'd like to use gnuradio-companion: +On your PC: xhost local:root +Then run the docker image: +sudo docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY ettusresearch/ubuntu-uhd-gnuradio:latest /bin/bash + +List Docker Images: +sudo docker image list + +How to Delete the Docker Image: +sudo docker rmi --force ettusresearch/ubuntu-uhd-gnuradio ettusresearch/ubuntu-uhd-gnuradio + +If you don't want to run Docker as sudo, consult this webpage: +https://docs.docker.com/engine/install/linux-postinstall/ + +