Skip to content

Instantly share code, notes, and snippets.

@timcardenuto
Last active July 15, 2020 15:12
Show Gist options
  • Save timcardenuto/bc2f16f96c546fc3f57df2194c1608c2 to your computer and use it in GitHub Desktop.
Save timcardenuto/bc2f16f96c546fc3f57df2194c1608c2 to your computer and use it in GitHub Desktop.
Process to build Redhawk from source on CentOS 8.
# CentOS 8 Redhawk Build
FROM centos:8
# enable PowerTools repo
RUN sed -i "s/enabled=0/enabled=1/g" /etc/yum.repos.d/CentOS-PowerTools.repo
RUN dnf -y update && \
dnf -y install epel-release
RUN dnf -y install bzip2 gcc-c++ make libtool expat-devel python2 python2-devel xsd apr-devel apr-util-devel sqlite-devel libuuid-devel boost-devel diffutils git cmake libusb1-devel libusb-devel uhd-devel fftw-devel && \
if [ ! -L /usr/bin/python ]; then ln -s python2 /usr/bin/python; fi && \
pip2 install numpy lxml
# build/install omniORB
RUN curl -L https://sourceforge.net/projects/omniorb/files/omniORB/omniORB-4.2.4/omniORB-4.2.4.tar.bz2/download --output omniORB-4.2.4.tar.bz2 && \
tar -xjf omniORB-4.2.4.tar.bz2 && \
cd omniORB-4.2.4 && \
./configure && \
make -j4 && \
make install && \
cd ../ && \
rm -rf omniORB-4.2.4*
# build/install omniEvents
RUN git clone https://github.com/RedhawkSDR/omniEvents.git && \
cd omniEvents && \
./reconf && \
./configure && \
make && \
make install && \
cd ../ && \
rm -rf omniEvents
# build/install omniORBpy
RUN curl -L https://sourceforge.net/projects/omniorb/files/omniORBpy/omniORBpy-4.2.4/omniORBpy-4.2.4.tar.bz2/download --output omniORBpy-4.2.4.tar.bz2 && \
tar -xjf omniORBpy-4.2.4.tar.bz2 && \
cd omniORBpy-4.2.4 && \
./configure && \
make -j4 && \
make install && \
cd ../ && \
rm -rf omniORBpy-4.2.4*
# build/install log4cxx
RUN curl -L https://github.com/apache/logging-log4cxx/archive/master.zip --output logging-log4cxx-master.zip && \
unzip logging-log4cxx-master.zip && \
cd logging-log4cxx-master && \
./autogen.sh && \
./configure && \
make -j4 && \
make install && \
cd ../ && \
rm -rf logging-log4cxx-master*
# build/install cppunit
RUN curl -L https://sourceforge.net/projects/cppunit/files/cppunit/1.12.1/cppunit-1.12.1.tar.gz/download --output cppunit-1.12.1.tar.gz && \
tar -zxf cppunit-1.12.1.tar.gz && \
cd cppunit-1.12.1 && \
./configure && \
make -j4 && \
make install && \
cd ../ && \
rm -rf cppunit-1.12.1*
ENV PATH=$PATH:/usr/local/redhawk/core/bin
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/redhawk/core/lib
ENV PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib64/python2.7/site-packages:/usr/local/redhawk/core/lib/python
ENV OSSIEHOME=/usr/local/redhawk/core
ENV SDRROOT=/var/redhawk/sdr
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
ENV JAVA_HOME=/usr/lib/jvm/java
ENV CXXFLAGS="--std=gnu++98"
# build/install Redhawk
RUN curl -L -O https://github.com/RedhawkSDR/redhawk/releases/download/2.2.6/redhawk-src-2.2.6.tar.gz && \
tar -zxf redhawk-src-2.2.6.tar.gz && \
cd redhawk-src-2.2.6/ && \
grep -rl "aclocal -I" . | xargs sed -i 's/aclocal -I \${OSSIE_AC_INCLUDE}/aclocal -I \${OSSIE_AC_INCLUDE} -I \/usr\/local\/share\/aclocal/g' && \
grep -rl "aclocal -I" . | xargs sed -i 's/aclocal -I acinclude/aclocal -I acinclude -I \/usr\/local\/share\/aclocal/g' && \
grep -rl "ACLOCAL_AMFLAGS = " . | xargs sed -i 's/^ACLOCAL_AMFLAGS = -I m4 -I \${OSSIEHOME}\/share\/aclocal\/ossie/ACLOCAL_AMFLAGS = -I m4 -I \${OSSIEHOME}\/share\/aclocal\/ossie -I \/usr\/local\/share\/aclocal/g' && \
grep -rl "ACLOCAL_AMFLAGS = " . | xargs sed -i 's/^ACLOCAL_AMFLAGS = -I m4 -I\${OSSIEHOME}\/share\/aclocal\/ossie/ACLOCAL_AMFLAGS = -I m4 -I\${OSSIEHOME}\/share\/aclocal\/ossie -I \/usr\/local\/share\/aclocal/g' && \
sed -i "s/configure/configure --disable-java/g" redhawk-install.sh && \
yes | ./redhawk-install.sh
# Setup for omniORB
RUN mkdir /var/omninames && \
mkdir /var/lib/omniEvents && \
echo "InitRef = NameService=corbaname::127.0.0.1:2809" >> /etc/omniORB.cfg && \
echo "supportBootstrapAgent = 1" >> /etc/omniORB.cfg
# Run omniNames
#omniNames -always -start
# Run omniEvents
#omniEvents -f
RUN git clone https://github.com/steve-m/librtlsdr.git && \
cd librtlsdr && \
git checkout v0.5.2 && \
mkdir build && \
cd build && \
cmake .. && \
make install
# Install assets
RUN if [ ! -L /usr/bin/python ]; then ln -s python2 /usr/bin/python; fi && \
git clone https://github.com/RedhawkSDR/assets.git && \
cd assets/sdr/libraries/dsp && \
./build.sh install && \
cd ../fftlib && \
./build.sh install && \
cd ../blueFileLib && \
./build.sh install && \
cd ../VITA49 && \
./build.sh install && \
cd ../RedhawkDevUtils && \
./build.sh install
# Need this script to build all the assets
RUN echo $'for d in ./*/ ;\n\
do\n\
cd "$d"\n\
sed -i "s/configure/configure --disable-java/g" build.sh\n\
./build.sh install\n\
if [ "$?" -ne 0 ]; then\n\
exit 1\n\
fi\n\
cd ..\n\
done\n'\
>> /buildall.sh
RUN if [ ! -L /usr/bin/python ]; then ln -s python2 /usr/bin/python; fi && \
cp /buildall.sh /assets/sdr/components && \
cd /assets/sdr/components && \
bash buildall.sh
RUN if [ ! -L /usr/bin/python ]; then ln -s python2 /usr/bin/python; fi && \
cp /buildall.sh /assets/sdr/devices && \
cd /assets/sdr/devices && \
bash buildall.sh
CMD ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment