Skip to content

Commit

Permalink
Merge pull request #43 from Notou/porting-3.9
Browse files Browse the repository at this point in the history
Brings compatibility with 3.9 (and hopefully 3.10)
  • Loading branch information
Notou committed Nov 26, 2021
2 parents bb9c9e7 + fc0b1d8 commit e324663
Show file tree
Hide file tree
Showing 64 changed files with 3,168 additions and 1,603 deletions.
104 changes: 104 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 90
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^"(gnuradio)/'
Priority: 1
- Regex: '^<(gnuradio)/'
Priority: 2
- Regex: '^<(boost)/'
Priority: 98
- Regex: '^<[a-z]*>$'
Priority: 99
- Regex: '^".*"$'
Priority: 0
- Regex: '.*'
Priority: 10

IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
42 changes: 27 additions & 15 deletions CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)

# Set the version information here
set(VERSION_MAJOR 1)
set(VERSION_API 0)
set(VERSION_ABI 0)
set(VERSION_PATCH git)
set(VERSION_API 0)
set(VERSION_ABI 0)
set(VERSION_PATCH 0)

set(PYTHON3_MIN_VERSION "3.6.5")
cmake_policy(SET CMP0011 NEW)

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


IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
ELSE()
message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
ENDIF()
Expand All @@ -87,6 +85,7 @@ ENDIF()
########################################################################
# Install directories
########################################################################
include(FindPkgConfig)
find_package(Gnuradio "3.9" REQUIRED runtime fft)
include(GrVersion)

Expand Down Expand Up @@ -127,8 +126,6 @@ endif(APPLE)
# Find gnuradio build dependencies
########################################################################
find_package(Doxygen)
find_package(PythonInterp ${PYTHON_MIN_VERSION} COMPONENTS Interpreter Development NumPy)


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

########################################################################
# PyBind11 Related
########################################################################

find_package(pybind11 REQUIRED)
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"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"
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR)
# format path in CMake-style for consistency with other path variables
# (a consistent style helps conda builds by using the same path separators)
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" PYTHON_NUMPY_INCLUDE_DIR)

########################################################################
# Setup doxygen option
Expand All @@ -149,7 +158,6 @@ else(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF)
endif(DOXYGEN_FOUND)


########################################################################
# Create uninstall target
########################################################################
Expand All @@ -162,17 +170,21 @@ add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)


########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include/bokehgui)
add_subdirectory(lib)
add_subdirectory(apps)
add_subdirectory(docs)
add_subdirectory(swig)
add_subdirectory(python)
add_subdirectory(grc)
# NOTE: manually update below to use GRC to generate C++ flowgraphs w/o python
if(ENABLE_PYTHON)
message(STATUS "PYTHON and GRC components are enabled")
add_subdirectory(python)
add_subdirectory(grc)
else(ENABLE_PYTHON)
message(STATUS "PYTHON and GRC components are disabled")
endif(ENABLE_PYTHON)

########################################################################
# Install cmake search helper for this library
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ The module provides various sinks and widgets to allow interaction with the live

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

## 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

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

## Installation
### Using PyBOMBS
Expand All @@ -35,7 +35,6 @@ $ mkdir build
$ cd build/
$ cmake ../
$ make
$ make test
$ sudo make install
```

Expand Down
5 changes: 3 additions & 2 deletions cmake/Modules/bokehguiConfig.cmake
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
INCLUDE(FindPkgConfig)
if(NOT PKG_CONFIG_FOUND)
INCLUDE(FindPkgConfig)
endif()
PKG_CHECK_MODULES(PC_BOKEHGUI bokehgui)

FIND_PATH(
Expand Down Expand Up @@ -29,4 +31,3 @@ include("${CMAKE_CURRENT_LIST_DIR}/bokehguiTarget.cmake")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BOKEHGUI DEFAULT_MSG BOKEHGUI_LIBRARIES BOKEHGUI_INCLUDE_DIRS)
MARK_AS_ADVANCED(BOKEHGUI_LIBRARIES BOKEHGUI_INCLUDE_DIRS)

1 change: 1 addition & 0 deletions docs/doxygen/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir)
set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
set(enable_html_docs YES)
set(enable_latex_docs NO)
set(enable_mathjax NO)
set(enable_xml_docs YES)

configure_file(
Expand Down
33 changes: 5 additions & 28 deletions docs/doxygen/Doxyfile.in
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,6 @@ TAB_SIZE = 8

ALIASES =

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding
# "class=itcl::class" will allow you to use the command class in the
# itcl::class meaning.

TCL_SUBST =

# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
Expand Down Expand Up @@ -723,8 +716,6 @@ EXCLUDE_PATTERNS = */.deps/* \

EXCLUDE_SYMBOLS = ad9862 \
numpy \
*swig* \
*Swig* \
*my_top_block* \
*my_graph* \
*app_top_block* \
Expand Down Expand Up @@ -1220,14 +1211,14 @@ FORMULA_TRANSPARENT = YES
# output. When enabled you may also need to install MathJax separately and
# configure the path to it using the MATHJAX_RELPATH option.

USE_MATHJAX = NO
USE_MATHJAX = @enable_mathjax@

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

MATHJAX_FORMAT = HTML-CSS
MATHJAX_FORMAT = SVG

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

MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_RELPATH = @MATHJAX2_PATH@

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

MATHJAX_EXTENSIONS =
MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols

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

EXTERNAL_PAGES = YES

# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').

PERL_PATH = /usr/bin/perl

#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
Expand All @@ -1697,15 +1683,6 @@ PERL_PATH = /usr/bin/perl

CLASS_DIAGRAMS = YES

# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see
# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.

MSCGEN_PATH =

# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
Expand Down Expand Up @@ -1834,7 +1811,7 @@ DIRECTORY_GRAPH = YES
# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
# visible in IE 9+ (other browsers do not have this requirement).

DOT_IMAGE_FORMAT = png
DOT_IMAGE_FORMAT = svg

# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
Expand Down
Empty file modified docs/doxygen/Doxyfile.swig_doc.in
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion docs/doxygen/doxyxml/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
u'Outputs the vital aadvark statistics.'
"""
from __future__ import unicode_literals

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

Expand Down
10 changes: 0 additions & 10 deletions docs/doxygen/doxyxml/doxyindex.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
Classes providing more user-friendly interfaces to the doxygen xml
docs than the generated classes provide.
"""
from __future__ import absolute_import
from __future__ import unicode_literals

import os

Expand Down Expand Up @@ -60,14 +58,6 @@ def _parse(self):
self._members.append(converted)


def generate_swig_doc_i(self):
"""
%feature("docstring") gr_make_align_on_samplenumbers_ss::align_state "
Wraps the C++: gr_align_on_samplenumbers_ss::align_state";
"""
pass


class DoxyCompMem(Base):


Expand Down
1 change: 0 additions & 1 deletion docs/doxygen/doxyxml/generated/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
resultant classes are not very friendly to navigate so the rest of the
doxyxml module processes them further.
"""
from __future__ import unicode_literals
3 changes: 1 addition & 2 deletions docs/doxygen/doxyxml/generated/compound.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from __future__ import absolute_import
from __future__ import unicode_literals


from xml.dom import minidom
from xml.dom import Node
Expand Down
Loading

0 comments on commit e324663

Please sign in to comment.