Skip to content

Commit 90b985e

Browse files
committed
compilable with libboost1.74 and gnuradio-dev=3.8.2.0-14 (gnuradio-dev=3.10.5 from debian is broken)
1 parent 0208fd3 commit 90b985e

File tree

10 files changed

+53
-26
lines changed

10 files changed

+53
-26
lines changed

CMakeLists.txt

+7-6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ endif()
4545
########################################################################
4646
# Find boost
4747
########################################################################
48+
if(UNIX AND EXISTS "/usr/lib")
49+
list(APPEND BOOST_LIBRARYDIR "/usr/lib")
50+
endif(UNIX AND EXISTS "/usr/lib")
4851
if(UNIX AND EXISTS "/usr/lib64")
4952
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
5053
endif(UNIX AND EXISTS "/usr/lib64")
@@ -56,12 +59,10 @@ set(Boost_ADDITIONAL_VERSIONS
5659
"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"
5760
"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"
5861
"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"
62+
"1.74.0" "1.74" "1.81.0" "1.81"
5963
)
60-
find_package(Boost "1.35" COMPONENTS filesystem system)
61-
62-
if(NOT Boost_FOUND)
63-
message(FATAL_ERROR "Boost required to compile fsk4")
64-
endif()
64+
find_package(Boost "1.74" REQUIRED COMPONENTS filesystem system)
65+
add_definitions(-DBOOST_NO_CXX11_SCOPED_ENUMS)
6566

6667
########################################################################
6768
# Install directories
@@ -112,7 +113,7 @@ find_package(Doxygen)
112113
# caps such as FILTER or FFT) and change the version to the minimum
113114
# API compatible version required.
114115
set(GR_REQUIRED_COMPONENTS RUNTIME)
115-
find_package(Gnuradio "3.7.2" REQUIRED)
116+
find_package(GnuradioRuntime REQUIRED)
116117

117118
if(NOT CPPUNIT_FOUND)
118119
message(FATAL_ERROR "CppUnit required to compile fsk4")

cmake/Modules/FindGnuradioRuntime.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
INCLUDE(FindPkgConfig)
22
PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime)
33

4+
find_package(Gnuradio REQUIRED)
5+
46
if(PC_GNURADIO_RUNTIME_FOUND)
57
# look for include files
68
FIND_PATH(
@@ -28,6 +30,8 @@ if(PC_GNURADIO_RUNTIME_FOUND)
2830
)
2931

3032
set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND})
33+
else()
34+
message("findGnuradioRuntime not set PC_GNURADIO_RUNTIME_FOUND")
3135
endif(PC_GNURADIO_RUNTIME_FOUND)
3236

3337
INCLUDE(FindPackageHandleStandardArgs)

cmake/Modules/GrSwig.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ macro(GR_SWIG_MAKE name)
159159
list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${tag_file})
160160

161161
#setup the swig flags with flags and include directories
162-
set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS})
162+
set(CMAKE_SWIG_FLAGS -fvirtual -keyword -w511 -module ${name} ${GR_SWIG_FLAGS})
163163
foreach(dir ${GR_SWIG_INCLUDE_DIRS})
164164
list(APPEND CMAKE_SWIG_FLAGS "-I${dir}")
165165
endforeach(dir)

include/fsk4/apco25_f.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
#include <gnuradio/msg_queue.h>
2828
#include <gnuradio/message.h>
2929

30-
namespace gr {
31-
namespace fsk4 {
30+
namespace gr::fsk4 {
3231

3332
/*!
3433
* \brief <+description of block+>
@@ -38,7 +37,7 @@ namespace gr {
3837
class FSK4_API apco25_f : virtual public gr::block
3938
{
4039
public:
41-
typedef std::shared_ptr<apco25_f> sptr;
40+
typedef boost::shared_ptr<apco25_f> sptr;
4241

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

54-
} // namespace fsk4
55-
} // namespace gr
53+
} // namespace gr
5654

5755
#endif /* INCLUDED_FSK4_APCO25_F_H */
5856

include/fsk4/demod_ff.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
#include <gnuradio/msg_queue.h>
2828
#include <gnuradio/message.h>
2929

30-
namespace gr {
31-
namespace fsk4 {
30+
namespace gr::fsk4 {
3231

3332
/*!
3433
* \brief <+description of block+>
@@ -38,7 +37,7 @@ namespace gr {
3837
class FSK4_API demod_ff : virtual public gr::block
3938
{
4039
public:
41-
typedef std::shared_ptr<demod_ff> sptr;
40+
typedef boost::shared_ptr<demod_ff> sptr;
4241

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

54-
} // namespace fsk4
55-
} // namespace gr
53+
} // namespace gr
5654

5755
#endif /* INCLUDED_FSK4_DEMOD_FF_H */
5856

include/fsk4/generic_f.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace gr {
3838
class FSK4_API generic_f : virtual public gr::block
3939
{
4040
public:
41-
typedef std::shared_ptr<generic_f> sptr;
41+
typedef boost::shared_ptr<generic_f> sptr;
4242

4343
/*!
4444
* \brief Return a shared_ptr to a new instance of fsk4::generic_f.

include/fsk4/rdlap_f.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace gr::fsk4 {
3737
class FSK4_API rdlap_f : virtual public gr::block
3838
{
3939
public:
40-
typedef std::shared_ptr<rdlap_f> sptr;
40+
typedef boost::shared_ptr<rdlap_f> sptr;
4141

4242
/*!
4343
* \brief Return a shared_ptr to a new instance of fsk4::rdlap_f.

lib/CMakeLists.txt

+23
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,28 @@
2222
########################################################################
2323
include(GrPlatform) #define LIB_SUFFIX
2424

25+
########################################################################
26+
# Find boost
27+
########################################################################
28+
if(UNIX AND EXISTS "/usr/lib")
29+
list(APPEND BOOST_LIBRARYDIR "/usr/lib")
30+
endif(UNIX AND EXISTS "/usr/lib")
31+
if(UNIX AND EXISTS "/usr/lib64")
32+
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
33+
endif(UNIX AND EXISTS "/usr/lib64")
34+
set(Boost_ADDITIONAL_VERSIONS
35+
"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"
36+
"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"
37+
"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"
38+
"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"
39+
"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"
40+
"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"
41+
"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"
42+
"1.74.0" "1.74" "1.81.0" "1.81"
43+
)
44+
find_package(Boost "1.74" REQUIRED COMPONENTS filesystem system)
45+
add_definitions(-DBOOST_NO_CXX11_SCOPED_ENUMS)
46+
2547
include_directories(${Boost_INCLUDE_DIR})
2648
link_directories(${Boost_LIBRARY_DIRS})
2749

@@ -39,6 +61,7 @@ if(NOT fsk4_sources)
3961
endif(NOT fsk4_sources)
4062

4163
add_library(gnuradio-fsk4 SHARED ${fsk4_sources})
64+
message("adding boost libraries ${Boost_LIBRARIES}")
4265
target_link_libraries(gnuradio-fsk4 ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES})
4366
set_target_properties(gnuradio-fsk4 PROPERTIES DEFINE_SYMBOL "gnuradio_fsk4_EXPORTS")
4467

lib/test_fsk4.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626

2727
#include <cppunit/TextTestRunner.h>
2828
#include <cppunit/XmlOutputter.h>
29-
29+
#include <boost/filesystem.hpp>
30+
// unittests.h was missing for me in debian, gnuradio-dev=3.10.5.0-1, fixed by copying over from different version
3031
#include <gnuradio/unittests.h>
32+
3133
#include "qa_fsk4.h"
3234
#include <iostream>
3335
#include <fstream>
@@ -37,7 +39,7 @@ main (int argc, char **argv)
3739
{
3840
CppUnit::TextTestRunner runner;
3941
std::ofstream xmlfile(get_unittest_path("fsk4.xml").c_str());
40-
CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
42+
auto *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
4143

4244
runner.addTest(qa_fsk4::suite());
4345
runner.setOutputter(xmlout);

swig/CMakeLists.txt

+6-5
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,21 @@ endif(NOT fsk4_sources)
2828
########################################################################
2929
# Include swig generation macros
3030
########################################################################
31-
find_package(SWIG)
32-
find_package(PythonLibs 3)
33-
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
34-
return()
35-
endif()
31+
find_package(SWIG REQUIRED)
32+
find_package(PythonLibs 3 REQUIRED)
33+
find_package(GnuradioRuntime REQUIRED)
3634

3735
include(GrSwig)
3836
include(GrPython)
3937
include(GrMiscUtils)
38+
include(FindGnuradioRuntime)
4039

4140
########################################################################
4241
# Setup swig generation
4342
########################################################################
43+
message("before gr_swig ${GNURADIO_RUNTIME_INCLUDE_DIRS}")
4444
foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS})
45+
message("inside gr_swig ${incdir}")
4546
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
4647
endforeach(incdir)
4748

0 commit comments

Comments
 (0)