Enable PowerTools repo:
$ sudo sed -i "s/enabled=0/enabled=1/g" /etc/yum.repos.d/CentOS-PowerTools.repo
Enable EPEL repo:
$ sudo dnf -y update
$ sudo dnf -y install epel-release
Install some deps:
$ sudo 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 git
$ sudo ln -s python2 /usr/bin/python
$ pip2 --user install numpy lxml
Build/install omniORB
$ 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
$ sudo make install
$ cd ../
Build/install omniEvents:
$ git clone https://github.com/RedhawkSDR/omniEvents.git
$ cd omniEvents
$ ./configure
$ make -j4
$ sudo make install
$ cd ../
Build/install omniORBpy
$ sudo 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
$ sudo make install
$ cd ../
Build/install log4cxx:
$ sudo 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
$ sudo make install
$ cd ../
Build/install cppunit:
$ sudo 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
$ sudo make install
cd ../
Evironment variables:
$ export PATH=$PATH:/usr/local/redhawk/core/bin
$ export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/redhawk/core/lib
$ export PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib64/python2.7/site-packages:/usr/local/redhawk/core/lib/python
$ export OSSIEHOME=/usr/local/redhawk/core
$ export SDRROOT=/var/redhawk/sdr
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
$ export JAVA_HOME=/usr/lib/jvm/java
Pull the source code for Redhawk 2.2.6 and fix some aclocale issues first so you can actually run make and see errors:
$ 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'
I also disable java build since I'm really just trying to update C++ and build the core stuff (I never use Java anyway).
$ sed -i "s/configure/configure --disable-java/g" redhawk-install.sh
At this point you could just build the source using C++98 and everything should go fine:
$ CXXFLAGS="--std=gnu++98"
$ ./redhawk-install.sh
However we want to use C++14 instead, since it's the default for GCC 8.3 which is the version on CentOS 8. To build to this C++ version you need a few mods to get rid of errors and optionally warnings. A fork of Redhawk with these patches is here. A description of each issue is attempted here:
- Error in
redhawk/src/control/framework/nodebooter.cpp
logging message at line 144:Should be:LOG_ERROR(nodebooter, "Failed to parse PRF file " << prfStream<< ". " << parser_error_line << "The XML parser returned the following error: " << ex.what());
LOG_ERROR(nodebooter, "Failed to parse PRF file " << prfFile << ". " << parser_error_line << "The XML parser returned the following error: " << ex.what());
- Error in
GPP/cpp/GPP.cpp
andredhawk/src/testing/sdr/dev/devices/GPP/cpp/GPP.cpp
:Changed to:errstr << "Unable to read "<<stat_filename<<". The process is no longer there";
errstr << "Unable to read "<<stat_filename.str()<<". The process is no longer there";
- There were 2 errors in
redhawk/src/control/sdr/dommgr/ApplicationFactory_impl.cpp
related to an error log message at line 1922 and 1990. I just commented them out, but should be fixed.RH_ERROR(_createHelperLog, message);
The following mods were needed to remove warnings and improve the code. Some of these end up being errors in C++17 or newer standards so they need to be fixed eventually anyway.
-
Removed all
throw
from function definitions based on dynamic exception specifications warnings. Turning things like this:void FileManager_impl::mount (const char* mountPoint, CF::FileSystem_ptr fileSystem) throw (CORBA::SystemException, CF::InvalidFileName, CF::FileManager::InvalidFileSystem, CF::FileManager::MountPointAlreadyExists) { ...
Into this:
void FileManager_impl::mount (const char* mountPoint, CF::FileSystem_ptr fileSystem) { ...
-
Fixed
catch
statements that throw catching polymorphic type warnings by replacing things like this:catch(boost::bad_lexical_cast){ }
With this:
catch(const boost::bad_lexical_cast &){ }
-
Converted
std::auto_ptr
tostd::unique_ptr
. See here. You can do this with a basic find/replace accross all files:$ grep -rl "std::auto_ptr" . | xargs sed -i 's/std::auto_ptr/std::unique_ptr/g'
Then wherever a copy of these pointer is made you'll need to use the
std::move
function. For example, converting this function withinDomainManagerConfiguration.cpp
:DomainManagerConfiguration& DomainManagerConfiguration::operator=(DomainManagerConfiguration other) { // Pass ownership this->_dmd = std::move(other._dmd); return *this; }
Into this:
DomainManagerConfiguration& DomainManagerConfiguration::operator=(DomainManagerConfiguration other) { // Pass ownership this->_dmd = std::move(other._dmd); return *this; }
You'll also need to initialize
unique_ptr
objects withnullptr
instead of0
(i.e. NULL). Based on info here. From:optional_property() : _p(0) { }
To:
optional_property() : _p(nullptr) { }
This has to be done in a number of places. The compiler errors make it pretty clear where these issues are. There are a few pointers that couldn't be converted because of the issue below related to boost.
-
Convert use of
boost::ptr_map
to normalstd::map
. This should be possible once you've converted to usingstd::unique_ptr
instead ofstd::auto_ptr
. See more info here. It seems like the definitions are inredhawk/src/control/include/ossie/ossieparser.h
. I left them alone b/c I didn't want to do all this work right now... Once this is fixed the last fewstd::auto_ptr
can be replaced within the filesspd-pimpl.cpp
,prf-pimpl.cpp
,sad-pimpl.cpp
,scd-pimpl.cpp
,dcd-pimpl.cpp
anddmd-pimpl.cpp
.
With all the patches done you can just build/install like this:
$ ./redhawk-install.sh
You might have to run as root for the 'install' part to work unless you pre-create and change permissions for certain directories.
Running the test_GPP.py
test script on this build:
Ran 37 tests in 185.819s
FAILED (failures=2, skipped=7)
Running the runtests.py
test script on this build:
Ran 1014 tests in 2363.660s
FAILED (failures=4, errors=11, skipped=88)
Building the Redhawk assets with C++14 also requires some mods.
Deps:
$ sudo dnf install fftw-devel
Patches:
- The following error:
Fixed by following advice here, and replacing the line with:
./include/am_fm_pm_baseband_demod.h:38:23: error: ‘constexpr’ needed for in-class initialization of static data member ‘const Real AmFmPmBasebandDemod::oneOver2Pi’ of non-integral type [-fpermissive] static const Real oneOver2Pi=1.0/(2*M_PI);
static constexpr Real oneOver2Pi=1.0/(2*M_PI);
- The following error:
Appears to come from
/usr/include/boost/bind/bind.hpp:309:42: error: no match for call to ‘(boost::_mfi::mf1<float, LanczosKernel<float, float>, float&>) (LanczosKernel<float, float>*&, float)’ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
src/resampler.cpp
, the usage ofboost::bind
... Not really sure how to fix this.ArbitraryRateResamplerClass::ArbitraryRateResamplerClass(float inputRate, float outputRate, size_t a, size_t quantizationPts, std::vector<float>& real_out, std::vector<std::complex<float> >& complex_out, float* startTime, std::deque<float>* realHistory, std::deque<std::complex<float> >* cmplxHistory): kernel(a), cache(boost::bind(&LanczosKernel<float,float>::getValue,&kernel, _1), quantizationPts, -a, a), inRate(inputRate), outRate(outputRate), rateFactor(inputRate/outputRate), filterDelay(-float(a)/inputRate), realOut(real_out), cmplxOut(complex_out) {