Skip to content

Commit e324663

Browse files
authored
Merge pull request #43 from Notou/porting-3.9
Brings compatibility with 3.9 (and hopefully 3.10)
2 parents bb9c9e7 + fc0b1d8 commit e324663

File tree

64 files changed

+3168
-1603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3168
-1603
lines changed

.clang-format

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlinesLeft: true
9+
AlignOperands: true
10+
AlignTrailingComments: true
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: All
15+
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakBeforeMultilineStrings: false
20+
AlwaysBreakTemplateDeclarations: true
21+
BinPackArguments: false
22+
BinPackParameters: false
23+
BreakBeforeBraces: Custom
24+
BraceWrapping:
25+
AfterClass: true
26+
AfterControlStatement: false
27+
AfterEnum: false
28+
AfterFunction: true
29+
AfterNamespace: false
30+
AfterObjCDeclaration: false
31+
AfterStruct: false
32+
AfterUnion: false
33+
BeforeCatch: false
34+
BeforeElse: false
35+
IndentBraces: false
36+
BreakBeforeBinaryOperators: None
37+
BreakBeforeTernaryOperators: true
38+
BreakConstructorInitializersBeforeComma: false
39+
BreakAfterJavaFieldAnnotations: false
40+
BreakStringLiterals: true
41+
ColumnLimit: 90
42+
CommentPragmas: '^ IWYU pragma:'
43+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
44+
ConstructorInitializerIndentWidth: 4
45+
ContinuationIndentWidth: 4
46+
Cpp11BracedListStyle: false
47+
DerivePointerAlignment: false
48+
DisableFormat: false
49+
ExperimentalAutoDetectBinPacking: false
50+
ForEachMacros:
51+
- foreach
52+
- Q_FOREACH
53+
- BOOST_FOREACH
54+
IncludeCategories:
55+
- Regex: '^"(gnuradio)/'
56+
Priority: 1
57+
- Regex: '^<(gnuradio)/'
58+
Priority: 2
59+
- Regex: '^<(boost)/'
60+
Priority: 98
61+
- Regex: '^<[a-z]*>$'
62+
Priority: 99
63+
- Regex: '^".*"$'
64+
Priority: 0
65+
- Regex: '.*'
66+
Priority: 10
67+
68+
IncludeIsMainRegex: '(Test)?$'
69+
IndentCaseLabels: false
70+
IndentWidth: 4
71+
IndentWrappedFunctionNames: false
72+
JavaScriptQuotes: Leave
73+
JavaScriptWrapImports: true
74+
KeepEmptyLinesAtTheStartOfBlocks: true
75+
MacroBlockBegin: ''
76+
MacroBlockEnd: ''
77+
MaxEmptyLinesToKeep: 2
78+
NamespaceIndentation: None
79+
ObjCBlockIndentWidth: 2
80+
ObjCSpaceAfterProperty: false
81+
ObjCSpaceBeforeProtocolList: true
82+
PenaltyBreakBeforeFirstCallParameter: 19
83+
PenaltyBreakComment: 300
84+
PenaltyBreakFirstLessLess: 120
85+
PenaltyBreakString: 1000
86+
PenaltyExcessCharacter: 1000000
87+
PenaltyReturnTypeOnItsOwnLine: 60
88+
PointerAlignment: Left
89+
ReflowComments: true
90+
SortIncludes: true
91+
SpaceAfterCStyleCast: false
92+
SpaceAfterTemplateKeyword: true
93+
SpaceBeforeAssignmentOperators: true
94+
SpaceBeforeParens: ControlStatements
95+
SpaceInEmptyParentheses: false
96+
SpacesBeforeTrailingComments: 1
97+
SpacesInAngles: false
98+
SpacesInContainerLiterals: true
99+
SpacesInCStyleCastParentheses: false
100+
SpacesInParentheses: false
101+
SpacesInSquareBrackets: false
102+
Standard: Cpp11
103+
TabWidth: 8
104+
UseTab: Never

CMakeLists.txt

100644100755
Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
4343

4444
# Set the version information here
4545
set(VERSION_MAJOR 1)
46-
set(VERSION_API 0)
47-
set(VERSION_ABI 0)
48-
set(VERSION_PATCH git)
46+
set(VERSION_API 0)
47+
set(VERSION_ABI 0)
48+
set(VERSION_PATCH 0)
4949

50-
set(PYTHON3_MIN_VERSION "3.6.5")
5150
cmake_policy(SET CMP0011 NEW)
5251

5352
# Enable generation of compile_commands.json for code completion engines
@@ -63,13 +62,12 @@ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
6362
add_definitions(-fvisibility=hidden)
6463
endif()
6564

66-
6765
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
68-
SET(CMAKE_CXX_STANDARD 11)
66+
SET(CMAKE_CXX_STANDARD 14)
6967
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
70-
SET(CMAKE_CXX_STANDARD 11)
68+
SET(CMAKE_CXX_STANDARD 14)
7169
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
72-
SET(CMAKE_CXX_STANDARD 11)
70+
SET(CMAKE_CXX_STANDARD 14)
7371
ELSE()
7472
message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
7573
ENDIF()
@@ -87,6 +85,7 @@ ENDIF()
8785
########################################################################
8886
# Install directories
8987
########################################################################
88+
include(FindPkgConfig)
9089
find_package(Gnuradio "3.9" REQUIRED runtime fft)
9190
include(GrVersion)
9291

@@ -127,8 +126,6 @@ endif(APPLE)
127126
# Find gnuradio build dependencies
128127
########################################################################
129128
find_package(Doxygen)
130-
find_package(PythonInterp ${PYTHON_MIN_VERSION} COMPONENTS Interpreter Development NumPy)
131-
132129

133130
########################################################################
134131
# Check if boheh module exists
@@ -139,6 +136,18 @@ if(NOT BOKEH_FOUND)
139136
message(FATAL_ERROR "Bokeh library required to compile gr-bokehgui")
140137
endif()
141138

139+
########################################################################
140+
# PyBind11 Related
141+
########################################################################
142+
143+
find_package(pybind11 REQUIRED)
144+
execute_process(
145+
COMMAND "${PYTHON_EXECUTABLE}" -c
146+
"try:\n import numpy\n import os\n inc_path = numpy.get_include()\n if os.path.exists(os.path.join(inc_path, 'numpy', 'arrayobject.h')):\n print(inc_path, end='')\nexcept:\n pass"
147+
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR)
148+
# format path in CMake-style for consistency with other path variables
149+
# (a consistent style helps conda builds by using the same path separators)
150+
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" PYTHON_NUMPY_INCLUDE_DIR)
142151

143152
########################################################################
144153
# Setup doxygen option
@@ -149,7 +158,6 @@ else(DOXYGEN_FOUND)
149158
option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF)
150159
endif(DOXYGEN_FOUND)
151160

152-
153161
########################################################################
154162
# Create uninstall target
155163
########################################################################
@@ -162,17 +170,21 @@ add_custom_target(uninstall
162170
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
163171
)
164172

165-
166173
########################################################################
167174
# Add subdirectories
168175
########################################################################
169176
add_subdirectory(include/bokehgui)
170177
add_subdirectory(lib)
171178
add_subdirectory(apps)
172179
add_subdirectory(docs)
173-
add_subdirectory(swig)
174-
add_subdirectory(python)
175-
add_subdirectory(grc)
180+
# NOTE: manually update below to use GRC to generate C++ flowgraphs w/o python
181+
if(ENABLE_PYTHON)
182+
message(STATUS "PYTHON and GRC components are enabled")
183+
add_subdirectory(python)
184+
add_subdirectory(grc)
185+
else(ENABLE_PYTHON)
186+
message(STATUS "PYTHON and GRC components are disabled")
187+
endif(ENABLE_PYTHON)
176188

177189
########################################################################
178190
# Install cmake search helper for this library

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ The module provides various sinks and widgets to allow interaction with the live
88

99
The module was developed as a part of Google Summer of Code 2017 by Kartik Patel.
1010

11-
## Warning: The master branch does not yet support GNU Radio 3.9 since the change to pybind11. Please use the main-3.8 branch with GNU Radio 3.8
1211

1312
## Dependency
1413
1. GNU Radio 3.9
1514
2. [Bokeh library v1](https://docs.bokeh.org/en/1.4.0/)
1615
(Tested on v1.4.0)
16+
3. NodeJS
1717

1818
## Installation
1919
### Using PyBOMBS
@@ -35,7 +35,6 @@ $ mkdir build
3535
$ cd build/
3636
$ cmake ../
3737
$ make
38-
$ make test
3938
$ sudo make install
4039
```
4140

cmake/Modules/bokehguiConfig.cmake

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
INCLUDE(FindPkgConfig)
1+
if(NOT PKG_CONFIG_FOUND)
2+
INCLUDE(FindPkgConfig)
3+
endif()
24
PKG_CHECK_MODULES(PC_BOKEHGUI bokehgui)
35

46
FIND_PATH(
@@ -29,4 +31,3 @@ include("${CMAKE_CURRENT_LIST_DIR}/bokehguiTarget.cmake")
2931
INCLUDE(FindPackageHandleStandardArgs)
3032
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BOKEHGUI DEFAULT_MSG BOKEHGUI_LIBRARIES BOKEHGUI_INCLUDE_DIRS)
3133
MARK_AS_ADVANCED(BOKEHGUI_LIBRARIES BOKEHGUI_INCLUDE_DIRS)
32-

docs/doxygen/CMakeLists.txt

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir)
2929
set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
3030
set(enable_html_docs YES)
3131
set(enable_latex_docs NO)
32+
set(enable_mathjax NO)
3233
set(enable_xml_docs YES)
3334

3435
configure_file(

docs/doxygen/Doxyfile.in

100644100755
Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ TAB_SIZE = 8
199199

200200
ALIASES =
201201

202-
# This tag can be used to specify a number of word-keyword mappings (TCL only).
203-
# A mapping has the form "name=value". For example adding
204-
# "class=itcl::class" will allow you to use the command class in the
205-
# itcl::class meaning.
206-
207-
TCL_SUBST =
208-
209202
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
210203
# sources only. Doxygen will then generate output that is more tailored for C.
211204
# For instance, some of the names that are used will be different. The list
@@ -723,8 +716,6 @@ EXCLUDE_PATTERNS = */.deps/* \
723716

724717
EXCLUDE_SYMBOLS = ad9862 \
725718
numpy \
726-
*swig* \
727-
*Swig* \
728719
*my_top_block* \
729720
*my_graph* \
730721
*app_top_block* \
@@ -1220,14 +1211,14 @@ FORMULA_TRANSPARENT = YES
12201211
# output. When enabled you may also need to install MathJax separately and
12211212
# configure the path to it using the MATHJAX_RELPATH option.
12221213

1223-
USE_MATHJAX = NO
1214+
USE_MATHJAX = @enable_mathjax@
12241215

12251216
# When MathJax is enabled you can set the default output format to be used for
12261217
# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
12271218
# SVG. The default value is HTML-CSS, which is slower, but has the best
12281219
# compatibility.
12291220

1230-
MATHJAX_FORMAT = HTML-CSS
1221+
MATHJAX_FORMAT = SVG
12311222

12321223
# When MathJax is enabled you need to specify the location relative to the
12331224
# HTML output directory using the MATHJAX_RELPATH option. The destination
@@ -1239,12 +1230,12 @@ MATHJAX_FORMAT = HTML-CSS
12391230
# However, it is strongly recommended to install a local
12401231
# copy of MathJax from http://www.mathjax.org before deployment.
12411232

1242-
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
1233+
MATHJAX_RELPATH = @MATHJAX2_PATH@
12431234

12441235
# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
12451236
# names that should be enabled during MathJax rendering.
12461237

1247-
MATHJAX_EXTENSIONS =
1238+
MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
12481239

12491240
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript
12501241
# pieces of code that will be used on startup of the MathJax code.
@@ -1680,11 +1671,6 @@ EXTERNAL_GROUPS = YES
16801671

16811672
EXTERNAL_PAGES = YES
16821673

1683-
# The PERL_PATH should be the absolute path and name of the perl script
1684-
# interpreter (i.e. the result of `which perl').
1685-
1686-
PERL_PATH = /usr/bin/perl
1687-
16881674
#---------------------------------------------------------------------------
16891675
# Configuration options related to the dot tool
16901676
#---------------------------------------------------------------------------
@@ -1697,15 +1683,6 @@ PERL_PATH = /usr/bin/perl
16971683

16981684
CLASS_DIAGRAMS = YES
16991685

1700-
# You can define message sequence charts within doxygen comments using the \msc
1701-
# command. Doxygen will then run the mscgen tool (see
1702-
# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
1703-
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
1704-
# the mscgen tool resides. If left empty the tool is assumed to be found in the
1705-
# default search path.
1706-
1707-
MSCGEN_PATH =
1708-
17091686
# If set to YES, the inheritance and collaboration graphs will hide
17101687
# inheritance and usage relations if the target is undocumented
17111688
# or is not a class.
@@ -1834,7 +1811,7 @@ DIRECTORY_GRAPH = YES
18341811
# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
18351812
# visible in IE 9+ (other browsers do not have this requirement).
18361813

1837-
DOT_IMAGE_FORMAT = png
1814+
DOT_IMAGE_FORMAT = svg
18381815

18391816
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
18401817
# enable generation of interactive SVG images that allow zooming and panning.

docs/doxygen/Doxyfile.swig_doc.in

100644100755
File mode changed.

docs/doxygen/doxyxml/__init__.py

100644100755
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
u'Outputs the vital aadvark statistics.'
6565
6666
"""
67-
from __future__ import unicode_literals
6867

6968
from .doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
7069

docs/doxygen/doxyxml/doxyindex.py

100644100755
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
Classes providing more user-friendly interfaces to the doxygen xml
2424
docs than the generated classes provide.
2525
"""
26-
from __future__ import absolute_import
27-
from __future__ import unicode_literals
2826

2927
import os
3028

@@ -60,14 +58,6 @@ def _parse(self):
6058
self._members.append(converted)
6159

6260

63-
def generate_swig_doc_i(self):
64-
"""
65-
%feature("docstring") gr_make_align_on_samplenumbers_ss::align_state "
66-
Wraps the C++: gr_align_on_samplenumbers_ss::align_state";
67-
"""
68-
pass
69-
70-
7161
class DoxyCompMem(Base):
7262

7363

docs/doxygen/doxyxml/generated/__init__.py

100644100755
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
resultant classes are not very friendly to navigate so the rest of the
66
doxyxml module processes them further.
77
"""
8-
from __future__ import unicode_literals

0 commit comments

Comments
 (0)