Skip to content

Commit

Permalink
compilable with libboost1.74 and gnuradio-dev=3.8.2.0-14 (gnuradio-de…
Browse files Browse the repository at this point in the history
…v=3.10.5 from debian is broken)
  • Loading branch information
smarek committed Jan 5, 2023
1 parent 0208fd3 commit 90b985e
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 26 deletions.
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ endif()
########################################################################
# Find boost
########################################################################
if(UNIX AND EXISTS "/usr/lib")
list(APPEND BOOST_LIBRARYDIR "/usr/lib")
endif(UNIX AND EXISTS "/usr/lib")
if(UNIX AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
endif(UNIX AND EXISTS "/usr/lib64")
Expand All @@ -56,12 +59,10 @@ set(Boost_ADDITIONAL_VERSIONS
"1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
"1.74.0" "1.74" "1.81.0" "1.81"
)
find_package(Boost "1.35" COMPONENTS filesystem system)

if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost required to compile fsk4")
endif()
find_package(Boost "1.74" REQUIRED COMPONENTS filesystem system)
add_definitions(-DBOOST_NO_CXX11_SCOPED_ENUMS)

########################################################################
# Install directories
Expand Down Expand Up @@ -112,7 +113,7 @@ find_package(Doxygen)
# caps such as FILTER or FFT) and change the version to the minimum
# API compatible version required.
set(GR_REQUIRED_COMPONENTS RUNTIME)
find_package(Gnuradio "3.7.2" REQUIRED)
find_package(GnuradioRuntime REQUIRED)

if(NOT CPPUNIT_FOUND)
message(FATAL_ERROR "CppUnit required to compile fsk4")
Expand Down
4 changes: 4 additions & 0 deletions cmake/Modules/FindGnuradioRuntime.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime)

find_package(Gnuradio REQUIRED)

if(PC_GNURADIO_RUNTIME_FOUND)
# look for include files
FIND_PATH(
Expand Down Expand Up @@ -28,6 +30,8 @@ if(PC_GNURADIO_RUNTIME_FOUND)
)

set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND})
else()
message("findGnuradioRuntime not set PC_GNURADIO_RUNTIME_FOUND")
endif(PC_GNURADIO_RUNTIME_FOUND)

INCLUDE(FindPackageHandleStandardArgs)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/GrSwig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ macro(GR_SWIG_MAKE name)
list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${tag_file})

#setup the swig flags with flags and include directories
set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS})
set(CMAKE_SWIG_FLAGS -fvirtual -keyword -w511 -module ${name} ${GR_SWIG_FLAGS})
foreach(dir ${GR_SWIG_INCLUDE_DIRS})
list(APPEND CMAKE_SWIG_FLAGS "-I${dir}")
endforeach(dir)
Expand Down
8 changes: 3 additions & 5 deletions include/fsk4/apco25_f.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#include <gnuradio/msg_queue.h>
#include <gnuradio/message.h>

namespace gr {
namespace fsk4 {
namespace gr::fsk4 {

/*!
* \brief <+description of block+>
Expand All @@ -38,7 +37,7 @@ namespace gr {
class FSK4_API apco25_f : virtual public gr::block
{
public:
typedef std::shared_ptr<apco25_f> sptr;
typedef boost::shared_ptr<apco25_f> sptr;

/*!
* \brief Return a shared_ptr to a new instance of fsk4::apco25_f.
Expand All @@ -51,8 +50,7 @@ namespace gr {
static sptr make(gr::msg_queue::sptr queue, int processing_flags);
};

} // namespace fsk4
} // namespace gr
} // namespace gr

#endif /* INCLUDED_FSK4_APCO25_F_H */

8 changes: 3 additions & 5 deletions include/fsk4/demod_ff.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#include <gnuradio/msg_queue.h>
#include <gnuradio/message.h>

namespace gr {
namespace fsk4 {
namespace gr::fsk4 {

/*!
* \brief <+description of block+>
Expand All @@ -38,7 +37,7 @@ namespace gr {
class FSK4_API demod_ff : virtual public gr::block
{
public:
typedef std::shared_ptr<demod_ff> sptr;
typedef boost::shared_ptr<demod_ff> sptr;

/*!
* \brief Return a shared_ptr to a new instance of fsk4::demod_ff.
Expand All @@ -51,8 +50,7 @@ namespace gr {
static sptr make(gr::msg_queue::sptr queue, float sample_rate, float symbol_rate);
};

} // namespace fsk4
} // namespace gr
} // namespace gr

#endif /* INCLUDED_FSK4_DEMOD_FF_H */

2 changes: 1 addition & 1 deletion include/fsk4/generic_f.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace gr {
class FSK4_API generic_f : virtual public gr::block
{
public:
typedef std::shared_ptr<generic_f> sptr;
typedef boost::shared_ptr<generic_f> sptr;

/*!
* \brief Return a shared_ptr to a new instance of fsk4::generic_f.
Expand Down
2 changes: 1 addition & 1 deletion include/fsk4/rdlap_f.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace gr::fsk4 {
class FSK4_API rdlap_f : virtual public gr::block
{
public:
typedef std::shared_ptr<rdlap_f> sptr;
typedef boost::shared_ptr<rdlap_f> sptr;

/*!
* \brief Return a shared_ptr to a new instance of fsk4::rdlap_f.
Expand Down
23 changes: 23 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@
########################################################################
include(GrPlatform) #define LIB_SUFFIX

########################################################################
# Find boost
########################################################################
if(UNIX AND EXISTS "/usr/lib")
list(APPEND BOOST_LIBRARYDIR "/usr/lib")
endif(UNIX AND EXISTS "/usr/lib")
if(UNIX AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
endif(UNIX AND EXISTS "/usr/lib64")
set(Boost_ADDITIONAL_VERSIONS
"1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
"1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
"1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49"
"1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
"1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
"1.74.0" "1.74" "1.81.0" "1.81"
)
find_package(Boost "1.74" REQUIRED COMPONENTS filesystem system)
add_definitions(-DBOOST_NO_CXX11_SCOPED_ENUMS)

include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})

Expand All @@ -39,6 +61,7 @@ if(NOT fsk4_sources)
endif(NOT fsk4_sources)

add_library(gnuradio-fsk4 SHARED ${fsk4_sources})
message("adding boost libraries ${Boost_LIBRARIES}")
target_link_libraries(gnuradio-fsk4 ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES})
set_target_properties(gnuradio-fsk4 PROPERTIES DEFINE_SYMBOL "gnuradio_fsk4_EXPORTS")

Expand Down
6 changes: 4 additions & 2 deletions lib/test_fsk4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@

#include <cppunit/TextTestRunner.h>
#include <cppunit/XmlOutputter.h>

#include <boost/filesystem.hpp>
// unittests.h was missing for me in debian, gnuradio-dev=3.10.5.0-1, fixed by copying over from different version
#include <gnuradio/unittests.h>

#include "qa_fsk4.h"
#include <iostream>
#include <fstream>
Expand All @@ -37,7 +39,7 @@ main (int argc, char **argv)
{
CppUnit::TextTestRunner runner;
std::ofstream xmlfile(get_unittest_path("fsk4.xml").c_str());
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
auto *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);

runner.addTest(qa_fsk4::suite());
runner.setOutputter(xmlout);
Expand Down
11 changes: 6 additions & 5 deletions swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,21 @@ endif(NOT fsk4_sources)
########################################################################
# Include swig generation macros
########################################################################
find_package(SWIG)
find_package(PythonLibs 3)
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
return()
endif()
find_package(SWIG REQUIRED)
find_package(PythonLibs 3 REQUIRED)
find_package(GnuradioRuntime REQUIRED)

include(GrSwig)
include(GrPython)
include(GrMiscUtils)
include(FindGnuradioRuntime)

########################################################################
# Setup swig generation
########################################################################
message("before gr_swig ${GNURADIO_RUNTIME_INCLUDE_DIRS}")
foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS})
message("inside gr_swig ${incdir}")
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
endforeach(incdir)

Expand Down

0 comments on commit 90b985e

Please sign in to comment.