Giter Club home page Giter Club logo

gr-cyberradio's Introduction

GR-CYBERRADIO

Compatibility

This software has been built and tested against Ubuntu 16.04 and Ubuntu 18.04

Build and Install

git clone [email protected]:CyberRadio/gr-cyberradio.git

libcyberradio

cd gr-cyberradio && cd libcyberradio && mkdir build && cd build
cmake ../
make && sudo make install
cd ../

cyberradiodriver

cd cyberradiodriver
sudo python setup.py install
cd ../

gr-CyberRadio

cd gr-CyberRadio && mkdir build && cd build
cmake ../
make && sudo make install

gr-cyberradio's People

Contributors

crs-bs avatar crs-da avatar der-christian-wagner avatar jwmelto avatar blsmit5728 avatar cyberradio avatar githubuser avatar

Stargazers

Anthony Frazier avatar  avatar  avatar Mark Cooke avatar Timothy avatar

Watchers

 avatar James Cloos avatar  avatar  avatar  avatar

gr-cyberradio's Issues

Custom install locations not supported

Using the maint-3.8 branch, if I try to install in a non-standard location (/opt/foss) then gr-CyberRadio can't find libcyberradio.

The following commands are in my Dockerfile:

ARG NPROC=2

ENV CMAKE_FLAGS="--log-level=ERROR --parallel ${NPROC}"
ENV CMAKE_FLAGS+=" -DCMAKE_COLOR_MAKEFILE=NO"
ENV CMAKE_FLAGS+=" -DCMAKE_PREFIX_PATH=/opt/foss"
ENV cmake_INSTALL_FLAGS="-DCMAKE_INSTALL_PREFIX=/opt/foss"
ENV MAKEFLAGS="--silent --no-print-directory --jobs=${NPROC}"

RUN echo "Installing CyberRadio"                                \
 && date                                                        \
 && pip install ${PIP_OPTS}                                     \
        requests                                                \
 && (cd /tmp                                                    \
     ; git clone                                                \
           --quiet                                              \
           --config advice.detachedHead=false                   \
           --branch maint-3.8                                   \
           https://github.com/CyberRadio/gr-cyberradio.git      \
     ; cd /tmp/gr-cyberradio                                    \
     ; git rev-parse HEAD                                       \
     ; sed -i -e 's|jsoncpp/json|json|g'                        \
           libcyberradio/libcyberradio/Driver/RadioTransport.cpp\
     ; sed -i -e 's|^#\(find_package(Boost "1.53"\)|\1|g'       \
              -e 's|^\(find_package(Boost "1.55"\)|#\1|g'       \
           gr-CyberRadio/CMakeLists.txt                         \
    ) && date                                                   \
 && echo "building..."                                          \
 && /usr/bin/scl enable devtoolset-8 -- sh -c '                 \
     cd /tmp/gr-cyberradio                                      \
                                                                \
     && (cd libcyberradio                                       \
         ; echo -e \"\\n\\n\\n\\nBuilding libcyberradio\\n\\n\\n\"      \
         ; mkdir build ; cd build                               \
         ; ${CMAKE}                                             \
           ${CMAKE_FLAGS}                                       \
           ${cmake_INSTALL_FLAGS}                               \
           -DCMAKE_BUILD_TYPE=Release                           \
           -S ..                                                \
         ; make ${MAKEFLAGS} install                            \
        )                                                       \

     && (cd gr-CyberRadio                                       \
         ; echo -e \"\\n\\n\\n\\nBuilding gr-CyberRadio\\n\\n\\n\"      \
         ; mkdir build ; cd build                               \
         ; ${CMAKE} -Wno-dev                                            \
           ${CMAKE_FLAGS}                                       \
           ${cmake_INSTALL_FLAGS}                               \
           -DCMAKE_BUILD_TYPE=Release                           \
           -DENABLE_DOXYGEN=OFF                                 \
           -S ..                                                \
         ; make ${MAKEFLAGS}                                    \
         ; make ${MAKEFLAGS} test                               \
         ; make ${MAKEFLAGS} install                            \
        )                                                       \
                                                                \
     && (cd /tmp                                                \
         ; rm -rf gr-cyberradio                                  \
        )                                                       \
     ' && date

If I try to build with this configuration, libcyberradio builds and installs just fine, but gr-CyberRadio fails with

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIBCYBERRADIO_LIB (ADVANCED)
    linked by target "gnuradio-CyberRadio" in directory /tmp/gr-cyberradio/gr-CyberRadio/lib

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

The issue is in LibCyberRadioConfig.cmake as installed in /opt/foss/lib64/cmake/libcyberradio. I don't think there is any reason for the NO_DEFAULT_PATH statement in the FIND_PATH and FIND_LIBRARY statements. If I remove those lines, the build works properly.

Fix python binding (3.10)

From maint-3.10 branch, run make install.

bash-4.2$ python -c 'import CyberRadio'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/foss/lib64/python3.8/site-packages/CyberRadio/__init__.py", line 24, in <module>
    from .generic_radio_control_block import generic_radio_control_block
  File "/opt/foss/lib64/python3.8/site-packages/CyberRadio/generic_radio_control_block.py", line 28, in <module>
    import CyberRadioDriver as crd
ModuleNotFoundError: No module named 'CyberRadioDriver'

If the driver isn't (currently) supported in the 3.10 branch, then it should not be imported in the wrapper code.

Add C++ code generation GRC support (3.10)

In the GNU Radio Companion (GRC), there is an option to generate code in either Python or C++, but the 3.10 YAML files lack the necessary support.

Specifically, for each block, add

flags: [ python, cpp ]

and then (for example)

cpp_templates:
  include: ['#include <CyberRadio/vita_udp_rx.h>']
  declarations: 'CyberRadio::vita_udp_rx::sptr ${id};'
  make: 'this->${id} = CyberRadio::vita_udp_rx::make();'

I'm still playing but these seem to be the minmal required changes to support C++ code generation. Of course, these portions need to be added for all supported blocks (vita_udp_rx was just chosen for illustration).

JsonCPP deprecation warning

Building libcyberradio,

/tmp/gr-cyberradio/libcyberradio/libcyberradio/Driver/RadioTransport.cpp: In member function 'virtual bool LibCyberRadio::Driver::RadioTransport::sendCommandHttps(const string&, bool)':
/tmp/gr-cyberradio/libcyberradio/libcyberradio/Driver/RadioTransport.cpp:404:34: warning: 'Reader' is deprecated: Use CharReader and CharReaderBuilder instead. [-Wdeprecated-declarations]
                     Json::Reader reader;
                                  ^~~~~~
In file included from /opt/foss/include/json/json.h:11,
                 from /tmp/gr-cyberradio/libcyberradio/libcyberradio/Driver/RadioTransport.cpp:15:
/opt/foss/include/json/reader.h:37:63: note: declared here
     "Use CharReader and CharReaderBuilder instead.") JSON_API Reader {
                                                               ^~~~~~
/tmp/gr-cyberradio/libcyberradio/libcyberradio/Driver/RadioTransport.cpp:404:34: warning: 'Json::Reader::Reader()' is deprecated: Use CharReader and CharReaderBuilder instead [-Wdeprecated-declarations]
                     Json::Reader reader;
                                  ^~~~~~
In file included from /opt/foss/include/json/json.h:11,
                 from /tmp/gr-cyberradio/libcyberradio/libcyberradio/Driver/RadioTransport.cpp:15:
/opt/foss/include/json/reader.h:56:3: note: declared here
   Reader();
   ^~~~~~

The deprecation warnings should be addressed.

Update for current GNU Radio

GNU Radio is currently at version 3.10, with 3.11 coming soon.

I think it was 3.9 where the python binding was changed from swig to pybind11. This of course means all OOT blocks need to be ported, but there is a handy porting tool.

gr-cyberradio needs to be updated to support the latest GNU Radio

Build failure in libcyberradio

Building libcyberradio on CentOS 7 (surprisingly, the minimum Boost for this component is 1.47... why the difference between components? see #2 )

Initially CMake failed with JsonCpp not found. So I built and installed it, using default settings. This installs the headers in /usr/local/include/json.

Apparently, the only place JsonCpp is used is in Driver/RadioTransport.cpp, where the header file is included as "jsoncpp/json/json.h" instead of "json/json.h", which is what an installed system would have. Compilation fails.

There are also a surprising number of compile warnings (predominantly -Wreturn-type) in the Driver directory.

Minimum Boost version?

Building gr-CyberRadio on CentOS 7, CMake fails with a Boost minimum version. The last available package for CentOS 7 is 1.53. GNU-Radio is built for CentOS 7 with 1.53. Does gr-CyberRadio really need 1.55?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.