Skip to content

Commit

Permalink
pybind: Switch from SWIG to PyBind11
Browse files Browse the repository at this point in the history
After the Python interface, now we also move to Pybind11 for the GR
interface. Beware, we rely on Pybind11 2.4.3 and do not use a submodule
anymore.
  • Loading branch information
jdemel committed Jun 25, 2020
1 parent 05dc0eb commit f1c08ae
Show file tree
Hide file tree
Showing 85 changed files with 3,878 additions and 3,719 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Formatting

on:
push:
paths-ignore:
- 'swig/'
pull_request:
paths-ignore:
- 'swig/'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: gnuradio/[email protected]
with:
source: '.'
exclude: './swig'
extensions: 'c,cc,cpp,cxx,h,hh'
57 changes: 14 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,14 @@
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-gfdm
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 3.8)
project(gr-gfdm CXX C)
include(CTest)
enable_testing()

# Install to PyBOMBS target prefix if defined
Expand All @@ -44,8 +31,8 @@ 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_API 0)
set(VERSION_ABI 0)
set(VERSION_PATCH git)

cmake_policy(SET CMP0011 NEW)
Expand Down Expand Up @@ -86,17 +73,7 @@ ENDIF()
########################################################################
# Install directories
########################################################################
message(STATUS "Searching for GNU Radio installation ...")
find_package(Gnuradio "3.8" QUIET)
if(NOT GNURADIO_FOUND)
message(STATUS "Searching for GNU Radio 3.9 ...")
find_package(Gnuradio "3.9" REQUIRED blocks analog fft filter digital)
else()
message(STATUS "Searching for GNU Radio 3.8 ...")
find_package(Gnuradio "3.8" REQUIRED blocks analog fft filter digital)
endif()
message(STATUS "Found GNU Radio ${Gnuradio_VERSION}")

find_package(Gnuradio "3.9" REQUIRED blocks analog fft filter digital)
include(GrVersion)

include(GrPlatform) #define LIB_SUFFIX
Expand Down Expand Up @@ -140,27 +117,23 @@ find_package(FFTW3f)
find_package(Volk REQUIRED 2.1)

########################################################################
# Setup doxygen option
########################################################################
if(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" ON)
else(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF)
endif(DOXYGEN_FOUND)


########################################################################
# PyBind11
# PyBind11 Related
########################################################################
add_subdirectory(pybind11)
# Probably the preferred way long term:
# find_package(pybind11 REQUIRED)

find_package(pybind11 REQUIRED)
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"from __future__ import print_function\ntry:\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)

########################################################################
# Setup doxygen option
########################################################################
if(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" ON)
else(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF)
endif(DOXYGEN_FOUND)

########################################################################
# Create uninstall target
Expand All @@ -174,15 +147,13 @@ add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)


########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include/gfdm)
add_subdirectory(lib)
add_subdirectory(apps)
add_subdirectory(docs)
add_subdirectory(swig)
add_subdirectory(python)
add_subdirectory(grc)

Expand Down
7 changes: 5 additions & 2 deletions MANIFEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ tags:
- synchronization
author:
- Andrej Rode <[email protected]>
- Johannes Demel <[email protected]>
copyright_owner:
- Andrej Rode
- Andrej Rode
- Johannes Demel
license:
- GPLv3
repo: https://github.com/kit-cel/gr-gfdm.git
gr_supported_version: 3.8, 3.9
repo: https://github.com/jdemel/gr-gfdm.git
#website: <module_website> # If you have a separate project website, put it here
#icon: <icon_url> # Put a URL to a square image here that will be used as an icon on CGRAN
---
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Synchronization algorithms are not part of this OOT. Instead we rely on `XFDMSyn
Requirements
------------
- GNU Radio OOT
- GNU Radio 3.8 (verified)
- GR 3.8 API
- GNU Radio 3.9 (verified)
- GR 3.9 API
- GR-FFT
- GR-FILTER
- VOLK
Expand Down Expand Up @@ -95,4 +95,4 @@ Code formatting
--------
We follow the GNU Radio coding guidelines. This is the current way to format everything:

`find . -regex '.*\.\(c\|cc\|cpp\|cxx\|h\|hh\)' -not -path "*build*" -exec clang-format -style=file -i {} \;`
`find . -regex '.*\.\(c\|cc\|cpp\|cxx\|h\|hh\)' -not -path "*build*" -exec clang-format -style=file -i {} \;`
17 changes: 3 additions & 14 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-gfdm
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

include(GrPython)

Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/CMakeParseArgumentsCopy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
# the new option.
# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefore.

#=============================================================================
# Copyright 2010 Alexander Neundorf <[email protected]>
Expand Down
14 changes: 1 addition & 13 deletions cmake/Modules/targetConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

include(CMakeFindDependencyMacro)

Expand Down
17 changes: 3 additions & 14 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-gfdm
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

########################################################################
# Setup dependencies
Expand Down
17 changes: 3 additions & 14 deletions docs/doxygen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-gfdm
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

########################################################################
# Create the doxygen configuration file
Expand Down
Loading

0 comments on commit f1c08ae

Please sign in to comment.