From f8d2be61ddd1c6cc80a3b81482cd1502aa6762c7 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Mon, 26 Jul 2021 09:24:59 -0700 Subject: [PATCH 01/20] Switch build to azure Signed-off-by: Travis F. Collins --- .travis.yml | 46 ---------------------------- appveyor.yml | 74 --------------------------------------------- azure-pipelines.yml | 57 ++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 120 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml create mode 100644 azure-pipelines.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 81beae4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: c -sudo: required - -matrix: - include: - - compiler: "gcc" - os: linux - dist: xenial - env: - - EXTRA_SSH=-oHostKeyAlgorithms=+ssh-dss - - os: linux - # FIXME: remove dist, when Xenial images become default in Travis CI - dist: xenial - env: - - OS_TYPE=centos_docker - - OS_VERSION=7 - - EXTRA_SSH=-oHostKeyAlgorithms=+ssh-dss - - os: linux - # FIXME: remove dist, when Xenial images become default in Travis CI - dist: xenial - env: - - OS_TYPE=ubuntu_docker - - OS_VERSION=bionic - - EXTRA_SSH=-oHostKeyAlgorithms=+ssh-dss - - compiler: "gcc" - os: osx - osx_image: xcode10.1 - env: - - EXTRA_SSH=-oHostKeyAlgorithms=+ssh-dss - - compiler: "gcc" - os: osx - osx_image: xcode11 - env: - - EXTRA_SSH=-oHostKeyAlgorithms=+ssh-dss - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ci/travis/before_install_darwin ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ci/travis/before_install_linux "$OS_TYPE" "$OS_VERSION" ; fi - -script: - - ci/travis/make_linux "$OS_TYPE" "$OS_VERSION" - -notifications: - email: - on_success: change - on_failure: always diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 1c3334d..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,74 +0,0 @@ -clone_depth: 1 - -install: - - cd c:\ - - # Install Boost libraries - - appveyor-retry nuget install boost_atomic-vc120 -Version 1.61.0 - - appveyor-retry nuget install boost_system-vc120 -Version 1.61.0 - - appveyor-retry nuget install boost_filesystem-vc120 -Version 1.61.0 - - appveyor-retry nuget install boost_chrono-vc120 -Version 1.61.0 - - appveyor-retry nuget install boost_date_time-vc120 -Version 1.61.0 - - appveyor-retry nuget install boost_thread-vc120 -Version 1.61.0 - - # Install libiio - - appveyor DownloadFile https://ci.appveyor.com/api/projects/analogdevicesinc/libiio/artifacts/libiio.zip?branch=master - - 7z x libiio*.zip > nul - - mkdir libiio-win64 - - mv libiio-*/MS64/* libiio-win64/ - - mv libiio-*/include/* libiio-win64/ - - # Install libad9361 - - appveyor DownloadFile https://ci.appveyor.com/api/projects/analogdevicesinc/libad9361-iio/artifacts/libad9361-win64.zip?branch=master - - 7z x libad9361-win64.zip > nul - - # Install SWIG - - appveyor DownloadFile https://sourceforge.net/projects/swig/files/swigwin/swigwin-3.0.8/swigwin-3.0.8.zip - - 7z x swigwin-3.0.8.zip > nul - - # Install Flex / Bison - - appveyor DownloadFile https://sourceforge.net/projects/winflexbison/files/old_versions/win_flex_bison-2.5.6.zip - - 7z x win_flex_bison-2.5.6.zip > nul - - # Install libvolk - - cd "c:\Program Files" - - appveyor DownloadFile https://ci.appveyor.com/api/projects/analogdevicesinc/volk/artifacts/libvolk-x64.zip?branch=master - - 7z x libvolk-x64.zip > nul - - # Install GNU Radio - - appveyor DownloadFile https://ci.appveyor.com/api/projects/analogdevicesinc/gnuradio/artifacts/gnuradio-x64.zip?branch=maint-windows - - 7z x gnuradio-x64.zip > nul - -build_script: - - mkdir c:\projects\gr-iio\build - - cd c:\projects\gr-iio\build - - # Without this directory in the %PATH%, compiler tests fail because of missing DLLs - - set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin - - - cmake -G "Visual Studio 12 Win64" \ - -DCMAKE_INSTALL_PREFIX:PATH="c:/Program Files/gnuradio" \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DBoost_INCLUDE_DIR:PATH=c:/boost.1.61.0.0/lib/native/include \ - -DBoost_ATOMIC_LIBRARY_RELEASE:FILEPATH=c:/boost_atomic-vc120.1.61.0.0/lib/native/address-model-64/lib/boost_atomic-vc120-mt-1_61.lib \ - -DBoost_FILESYSTEM_LIBRARY_RELEASE:FILEPATH=c:/boost_filesystem-vc120.1.61.0.0/lib/native/address-model-64/lib/boost_filesystem-vc120-mt-1_61.lib \ - -DBoost_THREAD_LIBRARY_RELEASE:FILEPATH=c:/boost_thread-vc120.1.61.0.0/lib/native/address-model-64/lib/boost_thread-vc120-mt-1_61.lib \ - -DBoost_SYSTEM_LIBRARY_RELEASE:FILEPATH=c:/boost_system-vc120.1.61.0.0/lib/native/address-model-64/lib/boost_system-vc120-mt-1_61.lib \ - -DBoost_LIBRARY_DIR_RELEASE:PATH=c:/boost_chrono-vc120.1.61.0.0/lib/native/address-model-64/lib;c:/boost_date_time-vc120.1.61.0.0/lib/native/address-model-64/lib;c:/boost_thread-vc120.1.61.0.0/lib/native/address-model-64/lib;c:/boost_system-vc120.1.61.0.0/lib/native/address-model-64/lib;c:/boost_filesystem-vc120.1.61.0.0/lib/native/address-model-64/lib \ - -DSWIG_EXECUTABLE:FILEPATH=c:/swigwin-3.0.8/swig.exe \ - -DIIO_INCLUDE_DIRS:PATH=c:/libiio-win64 \ - -DIIO_LIBRARIES:FILEPATH=c:/libiio-win64/libiio.lib \ - -DFLEX_EXECUTABLE:FILEPATH=c:/win_flex.exe \ - -DBISON_EXECUTABLE:FILEPATH=c:/win_bison.exe \ - -DAD9361_INCLUDE_DIRS:PATH=c:/libad9361-win64 \ - -DAD9361_LIBRARIES:FILEPATH=c:/libad9361-win64/libad9361.lib \ - -DGnuradio_DIR:PATH="c:/Program Files/gnuradio/lib/cmake/gnuradio" \ - -DCPPUNIT_INCLUDE_DIRS:PATH=c:/ \ - .. - - - cmake --build . --config Release --target INSTALL - - # Create an archive - - cd "c:\Program Files" - - 7z a "c:\gnuradio-x64.zip" gnuradio - - appveyor PushArtifact c:\gnuradio-x64.zip diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..00db5fc --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,57 @@ +jobs: +########################################################### +# Builds +########################################################### +- job: LinuxBuilds + # Host Box + pool: + vmImage: 'ubuntu-18.04' + # Docker Images + strategy: + matrix: + ubuntu18: + image: tfcollins/test-ubuntu:18.04 + container: $[ variables['image'] ] + steps: + - script: | + sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y git cmake doxygen graphviz libaio-dev libusb-1.0-0-dev libserialport-dev libavahi-client-dev rpm tar bzip2 gzip + displayName: "Setup Ubuntu" + condition: contains(variables['image'], 'ubuntu') + + - script: | + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libxml2 libxml2-dev bison flex libboost-all-dev + git clone https://github.com/analogdevicesinc/libiio.git + cd libiio + mkdir build && cd build + cmake .. + make + sudo make install + sudo ldconfig + cd ../.. + rm -rf libiio + displayName: Install libiio-iio + + - script: | + git clone https://github.com/analogdevicesinc/libad9361-iio.git + cd libad9361-iio + mkdir build && cd build + cmake .. + make + sudo make install + sudo ldconfig + cd ../.. + rm -rf libad9361-iio + displayName: Install libad9361-iio + + - script: | + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgmp-dev swig gnuradio gnuradio-dev + mkdir build && cd build + cmake .. + make + cd .. + displayName: Build + +########################################################### +# Deploy +########################################################### From 6dbfd92e167ee29213e2cea8255f710bc66785a2 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Mon, 26 Jul 2021 10:13:13 -0700 Subject: [PATCH 02/20] Merge from master Signed-off-by: Travis F. Collins --- CMakeLists.txt | 132 ++++---- cmake/Modules/FindCppUnit.cmake | 36 --- cmake/Modules/FindGnuradioRuntime.cmake | 36 --- cmake/Modules/GrMiscUtils.cmake | 210 ------------- cmake/Modules/GrPlatform.cmake | 46 --- cmake/Modules/GrPython.cmake | 227 -------------- cmake/Modules/GrSwig.cmake | 229 -------------- cmake/Modules/GrTest.cmake | 133 -------- cmake/Modules/UseSWIG.cmake | 304 ------------------- cmake/Modules/targetConfig.cmake.in | 26 ++ grc/CMakeLists.txt | 14 +- grc/iio.tree.yml | 16 + grc/iio_attr_sink.block.yml | 52 ++++ grc/iio_attr_source.block.yml | 85 ++++++ grc/iio_attr_updater.block.yml | 33 ++ grc/iio_device_sink.block.yml | 58 ++++ grc/iio_device_source.block.yml | 51 ++++ grc/iio_fmcomms2_sink.block.yml | 101 ++++++ grc/iio_fmcomms2_source.block.yml | 132 ++++++++ grc/iio_fmcomms5_sink.block.yml | 126 ++++++++ grc/iio_fmcomms5_source.block.yml | 173 +++++++++++ grc/iio_pluto_sink.block.yml | 71 +++++ grc/iio_pluto_source.block.yml | 93 ++++++ include/{gnuradio => }/iio/CMakeLists.txt | 2 +- include/{gnuradio => }/iio/api.h | 0 include/{gnuradio => }/iio/attr_sink.h | 2 +- include/{gnuradio => }/iio/attr_source.h | 2 +- include/{gnuradio => }/iio/converter_ss.h | 2 +- include/{gnuradio => }/iio/device_sink.h | 2 +- include/{gnuradio => }/iio/device_source.h | 2 +- include/{gnuradio => }/iio/fmcomms2_sink.h | 2 +- include/{gnuradio => }/iio/fmcomms2_source.h | 2 +- include/{gnuradio => }/iio/fmcomms5_sink.h | 2 +- include/{gnuradio => }/iio/fmcomms5_source.h | 2 +- include/{gnuradio => }/iio/math.h | 2 +- include/{gnuradio => }/iio/modulo_const_ff.h | 2 +- include/{gnuradio => }/iio/modulo_ff.h | 2 +- include/{gnuradio => }/iio/pluto_sink.h | 2 +- include/{gnuradio => }/iio/pluto_source.h | 2 +- include/{gnuradio => }/iio/power_ff.h | 2 +- lib/CMakeLists.txt | 43 +-- lib/attr_sink_impl.h | 2 +- lib/attr_source_impl.h | 2 +- lib/converter_ss_impl.h | 2 +- lib/device_sink_impl.h | 2 +- lib/device_source_impl.h | 2 +- lib/fmcomms2_sink_impl.h | 2 +- lib/fmcomms2_source_impl.h | 2 +- lib/fmcomms5_sink_impl.h | 2 +- lib/fmcomms5_source_impl.h | 2 +- lib/iio_math_impl.cc | 4 +- lib/iio_math_impl.h | 2 +- lib/iio_modulo_const_ff_impl.h | 2 +- lib/iio_modulo_ff_impl.h | 2 +- lib/iio_power_ff_impl.h | 2 +- lib/pluto_sink_impl.h | 4 +- lib/pluto_source_impl.h | 4 +- python/{iio => }/CMakeLists.txt | 2 +- python/{iio => }/__init__.py | 15 +- python/{iio => }/attr_updater.py | 2 +- swig/CMakeLists.txt | 12 +- swig/iio_pluto_sink_swig.i | 4 +- swig/iio_pluto_source_swig.i | 4 +- swig/iio_swig.i | 48 +-- 64 files changed, 1194 insertions(+), 1390 deletions(-) delete mode 100644 cmake/Modules/FindCppUnit.cmake delete mode 100644 cmake/Modules/FindGnuradioRuntime.cmake delete mode 100644 cmake/Modules/GrMiscUtils.cmake delete mode 100644 cmake/Modules/GrPlatform.cmake delete mode 100644 cmake/Modules/GrPython.cmake delete mode 100644 cmake/Modules/GrSwig.cmake delete mode 100644 cmake/Modules/GrTest.cmake delete mode 100644 cmake/Modules/UseSWIG.cmake create mode 100644 cmake/Modules/targetConfig.cmake.in create mode 100644 grc/iio.tree.yml create mode 100644 grc/iio_attr_sink.block.yml create mode 100644 grc/iio_attr_source.block.yml create mode 100644 grc/iio_attr_updater.block.yml create mode 100644 grc/iio_device_sink.block.yml create mode 100644 grc/iio_device_source.block.yml create mode 100644 grc/iio_fmcomms2_sink.block.yml create mode 100644 grc/iio_fmcomms2_source.block.yml create mode 100644 grc/iio_fmcomms5_sink.block.yml create mode 100644 grc/iio_fmcomms5_source.block.yml create mode 100644 grc/iio_pluto_sink.block.yml create mode 100644 grc/iio_pluto_source.block.yml rename include/{gnuradio => }/iio/CMakeLists.txt (96%) rename include/{gnuradio => }/iio/api.h (100%) rename include/{gnuradio => }/iio/attr_sink.h (98%) rename include/{gnuradio => }/iio/attr_source.h (98%) rename include/{gnuradio => }/iio/converter_ss.h (97%) rename include/{gnuradio => }/iio/device_sink.h (98%) rename include/{gnuradio => }/iio/device_source.h (98%) rename include/{gnuradio => }/iio/fmcomms2_sink.h (99%) rename include/{gnuradio => }/iio/fmcomms2_source.h (99%) rename include/{gnuradio => }/iio/fmcomms5_sink.h (99%) rename include/{gnuradio => }/iio/fmcomms5_source.h (99%) rename include/{gnuradio => }/iio/math.h (97%) rename include/{gnuradio => }/iio/modulo_const_ff.h (97%) rename include/{gnuradio => }/iio/modulo_ff.h (97%) rename include/{gnuradio => }/iio/pluto_sink.h (98%) rename include/{gnuradio => }/iio/pluto_source.h (98%) rename include/{gnuradio => }/iio/power_ff.h (97%) rename python/{iio => }/CMakeLists.txt (96%) rename python/{iio => }/__init__.py (78%) rename python/{iio => }/attr_updater.py (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e23173..17f0367 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,22 +21,20 @@ ######################################################################## # Project setup ######################################################################## -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.8) project(gr-iio CXX C) -set(GR_IIO_VERSION_MAJOR 0) -set(GR_IIO_VERSION_MINOR 3) -set(GR_IIO_VERSION ${GR_IIO_VERSION_MAJOR}.${GR_IIO_VERSION_MINOR}) +set(VERSION_INFO_MAJOR_VERSION 0) +set(VERSION_INFO_API_COMPAT 0) +set(VERSION_INFO_MINOR_VERSION 3) +set(VERSION_INFO_MAINT_VERSION git) +set(VERSION_INFO_VERSION ${GR_IIO_VERSION_MAJOR}.${GR_IIO_VERSION_MINOR}) -if (MSVC) - # http://www.suodenjoki.dk/us/archive/2010/min-max.htm - add_definitions(-DNOMINMAX) -endif (MSVC) - -if (WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8) - # https://stackoverflow.com/questions/2842469/python-undefined-reference-to-imp-py-initmodule4 - add_definitions(-DMS_WIN64) -endif(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8) +# Install to PyBOMBS target prefix if defined +if(DEFINED ENV{PYBOMBS_PREFIX}) + set(CMAKE_INSTALL_PREFIX $ENV{PYBOMBS_PREFIX}) + message(STATUS "PyBOMBS installed GNU Radio. Setting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}") +endif() #select the release build type by default to get optimization flags if(NOT CMAKE_BUILD_TYPE) @@ -45,16 +43,24 @@ if(NOT CMAKE_BUILD_TYPE) endif(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) + +cmake_policy(SET CMP0011 NEW) + +# Enable generation of compile_commands.json for code completion engines +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) ######################################################################## # Compiler specific setup ######################################################################## -if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + AND NOT WIN32) #http://gcc.gnu.org/wiki/Visibility add_definitions(-fvisibility=hidden) endif() +<<<<<<< HEAD ######################################################################## # Find boost ######################################################################## @@ -90,36 +96,58 @@ find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) if(NOT Boost_FOUND) message(FATAL_ERROR "Boost required to compile iio") endif() +======= +IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + SET(CMAKE_CXX_STANDARD 11) +ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(CMAKE_CXX_STANDARD 11) +ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + SET(CMAKE_CXX_STANDARD 11) +ELSE() + message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.") +ENDIF() + +IF(CMAKE_C_COMPILER_ID STREQUAL "GNU") + SET(CMAKE_C_STANDARD 11) +ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang") + SET(CMAKE_C_STANDARD 11) +ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC") + SET(CMAKE_C_STANDARD 11) +ELSE() + message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.") +ENDIF() + +######################################################################## +# Find packages +######################################################################## +find_package(Gnuradio "3.8" REQUIRED) +include(GrVersion) +include(GrPlatform) #define LIB_SUFFIX +>>>>>>> Update to 3.8 with new cmake requirements ######################################################################## # Install directories ######################################################################## -include(GrPlatform) #define LIB_SUFFIX -set(GR_RUNTIME_DIR bin) -if (NOT DEFINED GR_LIBRARY_DIR) - set(GR_LIBRARY_DIR lib${LIB_SUFFIX}) -endif() -set(GR_INCLUDE_DIR include) -set(GR_DATA_DIR share) +if(NOT CMAKE_MODULES_DIR) + set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake) +endif(NOT CMAKE_MODULES_DIR) + +set(GR_INCLUDE_DIR include/iio) +set(GR_CMAKE_DIR ${CMAKE_MODULES_DIR}/iio) set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) -set(GR_DOC_DIR ${GR_DATA_DIR}/doc) set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}) -set(GR_CONF_DIR etc) set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d) -set(GR_LIBEXEC_DIR libexec) set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) -set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## # Find gnuradio build dependencies ######################################################################## -find_package(Doxygen) # Search for GNU Radio and its components and versions. Add any # components required to the list of GR_REQUIRED_COMPONENTS (in all # caps such as FILTER or FFT) and change the version to the minimum # API compatible version required. -set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS PMT VOLK) +find_package(Gnuradio COMPONENTS blocks analog volk pmt filter fft) find_package(Gnuradio PATHS "c:/Program Files/gnuradio/lib/cmake/gnuradio" REQUIRED) find_library(IIO_LIBRARIES iio) @@ -127,36 +155,36 @@ find_path(IIO_INCLUDE_DIRS iio.h) find_library(AD9361_LIBRARIES ad9361) find_path(AD9361_INCLUDE_DIRS ad9361.h) +######################################################################## +# On Apple only, set install name and use rpath correctly, if not already set +######################################################################## +if(APPLE) + if(NOT CMAKE_INSTALL_NAME_DIR) + set(CMAKE_INSTALL_NAME_DIR + ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE + PATH "Library Install Name Destination Directory" FORCE) + endif(NOT CMAKE_INSTALL_NAME_DIR) + if(NOT CMAKE_INSTALL_RPATH) + set(CMAKE_INSTALL_RPATH + ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE + PATH "Library Install RPath" FORCE) + endif(NOT CMAKE_INSTALL_RPATH) + if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) + set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE + BOOL "Do Build Using Library Install RPath" FORCE) + endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) +endif(APPLE) + ######################################################################## # Setup doxygen option ######################################################################## +find_package(Doxygen) 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) -######################################################################## -# Setup the include and linker paths -######################################################################## -include_directories( - ${CMAKE_SOURCE_DIR}/lib - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/lib - ${CMAKE_BINARY_DIR}/include - ${Boost_INCLUDE_DIRS} - ${GNURADIO_ALL_INCLUDE_DIRS} -) - -link_directories( - ${Boost_LIBRARY_DIRS} - ${GNURADIO_RUNTIME_LIBRARY_DIRS} -) - -# Set component parameters -set(GR_IIO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "" FORCE) -set(GR_IIO_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/swig CACHE INTERNAL "" FORCE) - ######################################################################## # Create uninstall target ######################################################################## @@ -185,15 +213,15 @@ install( ######################################################################## # Add subdirectories ######################################################################## -add_subdirectory(include/gnuradio/iio) +add_subdirectory(include/iio) add_subdirectory(lib) add_subdirectory(swig) -add_subdirectory(python/iio) +add_subdirectory(python) add_subdirectory(grc) ######################################################################## # Install cmake search helper for this library ######################################################################## install(FILES cmake/Modules/iioConfig.cmake - DESTINATION lib/cmake/iio + DESTINATION ${CMAKE_MODULES_DIR}/iio ) diff --git a/cmake/Modules/FindCppUnit.cmake b/cmake/Modules/FindCppUnit.cmake deleted file mode 100644 index 9af308f..0000000 --- a/cmake/Modules/FindCppUnit.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# http://www.cmake.org/pipermail/cmake/2006-October/011446.html -# Modified to use pkg config and use standard var names - -# -# Find the CppUnit includes and library -# -# This module defines -# CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc. -# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit. -# CPPUNIT_FOUND, If false, do not try to use CppUnit. - -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_CPPUNIT "cppunit") - -FIND_PATH(CPPUNIT_INCLUDE_DIRS - NAMES cppunit/TestCase.h - HINTS ${PC_CPPUNIT_INCLUDE_DIR} - PATHS - /usr/local/include - /usr/include -) - -FIND_LIBRARY(CPPUNIT_LIBRARIES - NAMES cppunit - HINTS ${PC_CPPUNIT_LIBDIR} - PATHS - ${CPPUNIT_INCLUDE_DIRS}/../lib - /usr/local/lib - /usr/lib -) - -LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS}) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) -MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGnuradioRuntime.cmake b/cmake/Modules/FindGnuradioRuntime.cmake deleted file mode 100644 index afed684..0000000 --- a/cmake/Modules/FindGnuradioRuntime.cmake +++ /dev/null @@ -1,36 +0,0 @@ -INCLUDE(FindPkgConfig) -PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime) - -if(PC_GNURADIO_RUNTIME_FOUND) - # look for include files - FIND_PATH( - GNURADIO_RUNTIME_INCLUDE_DIRS - NAMES gnuradio/top_block.h - HINTS $ENV{GNURADIO_RUNTIME_DIR}/include - ${PC_GNURADIO_RUNTIME_INCLUDE_DIRS} - ${CMAKE_INSTALL_PREFIX}/include - PATHS /usr/local/include - /usr/include - ) - - # look for libs - FIND_LIBRARY( - GNURADIO_RUNTIME_LIBRARIES - NAMES gnuradio-runtime - HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib - ${PC_GNURADIO_RUNTIME_LIBDIR} - ${CMAKE_INSTALL_PREFIX}/lib/ - ${CMAKE_INSTALL_PREFIX}/lib64/ - PATHS /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 - ) - - set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND}) -endif(PC_GNURADIO_RUNTIME_FOUND) - -INCLUDE(FindPackageHandleStandardArgs) -# do not check GNURADIO_RUNTIME_INCLUDE_DIRS, is not set when default include path us used. -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES) -MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake deleted file mode 100644 index 9331d5d..0000000 --- a/cmake/Modules/GrMiscUtils.cmake +++ /dev/null @@ -1,210 +0,0 @@ -# Copyright 2010-2011 Free Software Foundation, Inc. -# -# 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. -# -# 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. - -if(DEFINED __INCLUDED_GR_MISC_UTILS_CMAKE) - return() -endif() -set(__INCLUDED_GR_MISC_UTILS_CMAKE TRUE) - -######################################################################## -# Set global variable macro. -# Used for subdirectories to export settings. -# Example: include and library paths. -######################################################################## -function(GR_SET_GLOBAL var) - set(${var} ${ARGN} CACHE INTERNAL "" FORCE) -endfunction(GR_SET_GLOBAL) - -######################################################################## -# Set the pre-processor definition if the condition is true. -# - def the pre-processor definition to set and condition name -######################################################################## -function(GR_ADD_COND_DEF def) - if(${def}) - add_definitions(-D${def}) - endif(${def}) -endfunction(GR_ADD_COND_DEF) - -######################################################################## -# Check for a header and conditionally set a compile define. -# - hdr the relative path to the header file -# - def the pre-processor definition to set -######################################################################## -function(GR_CHECK_HDR_N_DEF hdr def) - include(CheckIncludeFileCXX) - CHECK_INCLUDE_FILE_CXX(${hdr} ${def}) - GR_ADD_COND_DEF(${def}) -endfunction(GR_CHECK_HDR_N_DEF) - -######################################################################## -# Include subdirectory macro. -# Sets the CMake directory variables, -# includes the subdirectory CMakeLists.txt, -# resets the CMake directory variables. -# -# This macro includes subdirectories rather than adding them -# so that the subdirectory can affect variables in the level above. -# This provides a work-around for the lack of convenience libraries. -# This way a subdirectory can append to the list of library sources. -######################################################################## -macro(GR_INCLUDE_SUBDIRECTORY subdir) - #insert the current directories on the front of the list - list(INSERT _cmake_source_dirs 0 ${CMAKE_CURRENT_SOURCE_DIR}) - list(INSERT _cmake_binary_dirs 0 ${CMAKE_CURRENT_BINARY_DIR}) - - #set the current directories to the names of the subdirs - set(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) - set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${subdir}) - - #include the subdirectory CMakeLists to run it - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) - - #reset the value of the current directories - list(GET _cmake_source_dirs 0 CMAKE_CURRENT_SOURCE_DIR) - list(GET _cmake_binary_dirs 0 CMAKE_CURRENT_BINARY_DIR) - - #pop the subdir names of the front of the list - list(REMOVE_AT _cmake_source_dirs 0) - list(REMOVE_AT _cmake_binary_dirs 0) -endmacro(GR_INCLUDE_SUBDIRECTORY) - -######################################################################## -# Check if a compiler flag works and conditionally set a compile define. -# - flag the compiler flag to check for -# - have the variable to set with result -######################################################################## -macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have) - include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG(${flag} ${have}) - if(${have}) - add_definitions(${flag}) - endif(${have}) -endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE) - -######################################################################## -# Generates the .la libtool file -# This appears to generate libtool files that cannot be used by auto*. -# Usage GR_LIBTOOL(TARGET [target] DESTINATION [dest]) -# Notice: there is not COMPONENT option, these will not get distributed. -######################################################################## -function(GR_LIBTOOL) - if(NOT DEFINED GENERATE_LIBTOOL) - set(GENERATE_LIBTOOL OFF) #disabled by default - endif() - - if(GENERATE_LIBTOOL) - include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN}) - - find_program(LIBTOOL libtool) - if(LIBTOOL) - include(CMakeMacroLibtoolFile) - CREATE_LIBTOOL_FILE(${GR_LIBTOOL_TARGET} /${GR_LIBTOOL_DESTINATION}) - endif(LIBTOOL) - endif(GENERATE_LIBTOOL) - -endfunction(GR_LIBTOOL) - -######################################################################## -# Do standard things to the library target -# - set target properties -# - make install rules -# Also handle gnuradio custom naming conventions w/ extras mode. -######################################################################## -function(GR_LIBRARY_FOO target) - #parse the arguments for component names - include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(GR_LIBRARY "" "RUNTIME_COMPONENT;DEVEL_COMPONENT" "" ${ARGN}) - - #set additional target properties - set_target_properties(${target} PROPERTIES SOVERSION ${LIBVER}) - - #install the generated files like so... - install(TARGETS ${target} - LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} # .so/.dylib file - ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_DEVEL_COMPONENT} # .lib file - RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} # .dll file - ) - - #extras mode enabled automatically on linux - if(NOT DEFINED LIBRARY_EXTRAS) - set(LIBRARY_EXTRAS ${LINUX}) - endif() - - #special extras mode to enable alternative naming conventions - if(LIBRARY_EXTRAS) - - #create .la file before changing props - GR_LIBTOOL(TARGET ${target} DESTINATION ${GR_LIBRARY_DIR}) - - #give the library a special name with ultra-zero soversion - set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_NAME ${target}-${LIBVER} SOVERSION "0.0.0") - set(target_name lib${target}-${LIBVER}.so.0.0.0) - - #custom command to generate symlinks - add_custom_command( - TARGET ${target} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so - COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0 - COMMAND ${CMAKE_COMMAND} -E touch ${target_name} #so the symlinks point to something valid so cmake 2.6 will install - ) - - #and install the extra symlinks - install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so - ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0 - DESTINATION ${GR_LIBRARY_DIR} COMPONENT ${GR_LIBRARY_RUNTIME_COMPONENT} - ) - - endif(LIBRARY_EXTRAS) -endfunction(GR_LIBRARY_FOO) - -######################################################################## -# Create a dummy custom command that depends on other targets. -# Usage: -# GR_GEN_TARGET_DEPS(unique_name target_deps ...) -# ADD_CUSTOM_COMMAND( ${target_deps}) -# -# Custom command cant depend on targets, but can depend on executables, -# and executables can depend on targets. So this is the process: -######################################################################## -function(GR_GEN_TARGET_DEPS name var) - file( - WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in - "int main(void){return 0;}\n" - ) - execute_process( - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp.in - ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp - ) - add_executable(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name}.cpp) - if(ARGN) - add_dependencies(${name} ${ARGN}) - endif(ARGN) - - if(CMAKE_CROSSCOMPILING) - set(${var} "DEPENDS;${name}" PARENT_SCOPE) #cant call command when cross - else() - set(${var} "DEPENDS;${name};COMMAND;${name}" PARENT_SCOPE) - endif() -endfunction(GR_GEN_TARGET_DEPS) diff --git a/cmake/Modules/GrPlatform.cmake b/cmake/Modules/GrPlatform.cmake deleted file mode 100644 index a2e4f3b..0000000 --- a/cmake/Modules/GrPlatform.cmake +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2011 Free Software Foundation, Inc. -# -# 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. -# -# 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. - -if(DEFINED __INCLUDED_GR_PLATFORM_CMAKE) - return() -endif() -set(__INCLUDED_GR_PLATFORM_CMAKE TRUE) - -######################################################################## -# Setup additional defines for OS types -######################################################################## -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(LINUX TRUE) -endif() - -if(LINUX AND EXISTS "/etc/debian_version") - set(DEBIAN TRUE) -endif() - -if(LINUX AND EXISTS "/etc/redhat-release") - set(REDHAT TRUE) -endif() - -######################################################################## -# when the library suffix should be 64 (applies to redhat linux family) -######################################################################## -if(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") - set(LIB_SUFFIX 64) -endif() -set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake deleted file mode 100644 index 68ca58e..0000000 --- a/cmake/Modules/GrPython.cmake +++ /dev/null @@ -1,227 +0,0 @@ -# Copyright 2010-2011 Free Software Foundation, Inc. -# -# 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. -# -# 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. - -if(DEFINED __INCLUDED_GR_PYTHON_CMAKE) - return() -endif() -set(__INCLUDED_GR_PYTHON_CMAKE TRUE) - -######################################################################## -# Setup the python interpreter: -# This allows the user to specify a specific interpreter, -# or finds the interpreter via the built-in cmake module. -######################################################################## -#this allows the user to override PYTHON_EXECUTABLE -if(PYTHON_EXECUTABLE) - - set(PYTHONINTERP_FOUND TRUE) - -#otherwise if not set, try to automatically find it -else(PYTHON_EXECUTABLE) - - #use the built-in find script - find_package(PythonInterp 2) - - #and if that fails use the find program routine - if(NOT PYTHONINTERP_FOUND) - find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python2.6 python2.5) - if(PYTHON_EXECUTABLE) - set(PYTHONINTERP_FOUND TRUE) - endif(PYTHON_EXECUTABLE) - endif(NOT PYTHONINTERP_FOUND) - -endif(PYTHON_EXECUTABLE) - -#make the path to the executable appear in the cmake gui -set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") - -#make sure we can use -B with python (introduced in 2.6) -if(PYTHON_EXECUTABLE) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} -B -c "" - OUTPUT_QUIET ERROR_QUIET - RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT - ) - if(PYTHON_HAS_DASH_B_RESULT EQUAL 0) - set(PYTHON_DASH_B "-B") - endif() -endif(PYTHON_EXECUTABLE) - -######################################################################## -# Check for the existence of a python module: -# - desc a string description of the check -# - mod the name of the module to import -# - cmd an additional command to run -# - have the result variable to set -######################################################################## -macro(GR_PYTHON_CHECK_MODULE desc mod cmd have) - message(STATUS "") - message(STATUS "Python checking for ${desc}") - execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c " -######################################### -try: import ${mod} -except: exit(-1) -try: assert ${cmd} -except: exit(-1) -#########################################" - RESULT_VARIABLE ${have} - ) - if(${have} EQUAL 0) - message(STATUS "Python checking for ${desc} - found") - set(${have} TRUE) - else(${have} EQUAL 0) - message(STATUS "Python checking for ${desc} - not found") - set(${have} FALSE) - endif(${have} EQUAL 0) -endmacro(GR_PYTHON_CHECK_MODULE) - -######################################################################## -# Sets the python installation directory GR_PYTHON_DIR -######################################################################## -execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " -from distutils import sysconfig -print sysconfig.get_python_lib(plat_specific=True, prefix='') -" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE -) -file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR) - -######################################################################## -# Create an always-built target with a unique name -# Usage: GR_UNIQUE_TARGET( ) -######################################################################## -function(GR_UNIQUE_TARGET desc) - file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib -unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5] -print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" - OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE) - add_custom_target(${_target} ALL DEPENDS ${ARGN}) -endfunction(GR_UNIQUE_TARGET) - -######################################################################## -# Install python sources (also builds and installs byte-compiled python) -######################################################################## -function(GR_PYTHON_INSTALL) - include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(GR_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN}) - - #################################################################### - if(GR_PYTHON_INSTALL_FILES) - #################################################################### - install(${ARGN}) #installs regular python files - - #create a list of all generated files - unset(pysrcfiles) - unset(pycfiles) - unset(pyofiles) - foreach(pyfile ${GR_PYTHON_INSTALL_FILES}) - get_filename_component(pyfile ${pyfile} ABSOLUTE) - list(APPEND pysrcfiles ${pyfile}) - - #determine if this file is in the source or binary directory - file(RELATIVE_PATH source_rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${pyfile}) - string(LENGTH "${source_rel_path}" source_rel_path_len) - file(RELATIVE_PATH binary_rel_path ${CMAKE_CURRENT_BINARY_DIR} ${pyfile}) - string(LENGTH "${binary_rel_path}" binary_rel_path_len) - - #and set the generated path appropriately - if(${source_rel_path_len} GREATER ${binary_rel_path_len}) - set(pygenfile ${CMAKE_CURRENT_BINARY_DIR}/${binary_rel_path}) - else() - set(pygenfile ${CMAKE_CURRENT_BINARY_DIR}/${source_rel_path}) - endif() - list(APPEND pycfiles ${pygenfile}c) - list(APPEND pyofiles ${pygenfile}o) - - #ensure generation path exists - get_filename_component(pygen_path ${pygenfile} PATH) - file(MAKE_DIRECTORY ${pygen_path}) - - endforeach(pyfile) - - #the command to generate the pyc files - add_custom_command( - DEPENDS ${pysrcfiles} OUTPUT ${pycfiles} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pycfiles} - ) - - #the command to generate the pyo files - add_custom_command( - DEPENDS ${pysrcfiles} OUTPUT ${pyofiles} - COMMAND ${PYTHON_EXECUTABLE} -O ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pyofiles} - ) - - #create install rule and add generated files to target list - set(python_install_gen_targets ${pycfiles} ${pyofiles}) - install(FILES ${python_install_gen_targets} - DESTINATION ${GR_PYTHON_INSTALL_DESTINATION} - COMPONENT ${GR_PYTHON_INSTALL_COMPONENT} - ) - - - #################################################################### - elseif(GR_PYTHON_INSTALL_PROGRAMS) - #################################################################### - file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native) - - foreach(pyfile ${GR_PYTHON_INSTALL_PROGRAMS}) - get_filename_component(pyfile_name ${pyfile} NAME) - get_filename_component(pyfile ${pyfile} ABSOLUTE) - string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe") - list(APPEND python_install_gen_targets ${pyexefile}) - - get_filename_component(pyexefile_path ${pyexefile} PATH) - file(MAKE_DIRECTORY ${pyexefile_path}) - - add_custom_command( - OUTPUT ${pyexefile} DEPENDS ${pyfile} - COMMAND ${PYTHON_EXECUTABLE} -c - \"open('${pyexefile}', 'w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())\" - COMMENT "Shebangin ${pyfile_name}" - ) - - #on windows, python files need an extension to execute - get_filename_component(pyfile_ext ${pyfile} EXT) - if(WIN32 AND NOT pyfile_ext) - set(pyfile_name "${pyfile_name}.py") - endif() - - install(PROGRAMS ${pyexefile} RENAME ${pyfile_name} - DESTINATION ${GR_PYTHON_INSTALL_DESTINATION} - COMPONENT ${GR_PYTHON_INSTALL_COMPONENT} - ) - endforeach(pyfile) - - endif() - - GR_UNIQUE_TARGET("pygen" ${python_install_gen_targets}) - -endfunction(GR_PYTHON_INSTALL) - -######################################################################## -# Write the python helper script that generates byte code files -######################################################################## -file(WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py " -import sys, py_compile -files = sys.argv[1:] -srcs, gens = files[:len(files)/2], files[len(files)/2:] -for src, gen in zip(srcs, gens): - py_compile.compile(file=src, cfile=gen, doraise=True) -") diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake deleted file mode 100644 index 569667b..0000000 --- a/cmake/Modules/GrSwig.cmake +++ /dev/null @@ -1,229 +0,0 @@ -# Copyright 2010-2011 Free Software Foundation, Inc. -# -# 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. -# -# 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. - -if(DEFINED __INCLUDED_GR_SWIG_CMAKE) - return() -endif() -set(__INCLUDED_GR_SWIG_CMAKE TRUE) - -include(GrPython) - -######################################################################## -# Builds a swig documentation file to be generated into python docstrings -# Usage: GR_SWIG_MAKE_DOCS(output_file input_path input_path....) -# -# Set the following variable to specify extra dependent targets: -# - GR_SWIG_DOCS_SOURCE_DEPS -# - GR_SWIG_DOCS_TARGET_DEPS -######################################################################## -function(GR_SWIG_MAKE_DOCS output_file) - find_package(Doxygen) - if(DOXYGEN_FOUND) - - #setup the input files variable list, quote formated - set(input_files) - unset(INPUT_PATHS) - foreach(input_path ${ARGN}) - if (IS_DIRECTORY ${input_path}) #when input path is a directory - file(GLOB input_path_h_files ${input_path}/*.h) - else() #otherwise its just a file, no glob - set(input_path_h_files ${input_path}) - endif() - list(APPEND input_files ${input_path_h_files}) - set(INPUT_PATHS "${INPUT_PATHS} \"${input_path}\"") - endforeach(input_path) - - #determine the output directory - get_filename_component(name ${output_file} NAME_WE) - get_filename_component(OUTPUT_DIRECTORY ${output_file} PATH) - set(OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}/${name}_swig_docs) - make_directory(${OUTPUT_DIRECTORY}) - - #generate the Doxyfile used by doxygen - configure_file( - ${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.swig_doc.in - ${OUTPUT_DIRECTORY}/Doxyfile - @ONLY) - - #Create a dummy custom command that depends on other targets - include(GrMiscUtils) - GR_GEN_TARGET_DEPS(_${name}_tag tag_deps ${GR_SWIG_DOCS_TARGET_DEPS}) - - #call doxygen on the Doxyfile + input headers - add_custom_command( - OUTPUT ${OUTPUT_DIRECTORY}/xml/index.xml - DEPENDS ${input_files} ${GR_SWIG_DOCS_SOURCE_DEPS} ${tag_deps} - COMMAND ${DOXYGEN_EXECUTABLE} ${OUTPUT_DIRECTORY}/Doxyfile - COMMENT "Generating doxygen xml for ${name} docs" - ) - - #call the swig_doc script on the xml files - add_custom_command( - OUTPUT ${output_file} - DEPENDS ${input_files} ${OUTPUT_DIRECTORY}/xml/index.xml - COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} - ${CMAKE_SOURCE_DIR}/docs/doxygen/swig_doc.py - ${OUTPUT_DIRECTORY}/xml - ${output_file} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs/doxygen - ) - - else(DOXYGEN_FOUND) - file(WRITE ${output_file} "\n") #no doxygen -> empty file - endif(DOXYGEN_FOUND) -endfunction(GR_SWIG_MAKE_DOCS) - -######################################################################## -# Build a swig target for the common gnuradio use case. Usage: -# GR_SWIG_MAKE(target ifile ifile ifile...) -# -# Set the following variables before calling: -# - GR_SWIG_FLAGS -# - GR_SWIG_INCLUDE_DIRS -# - GR_SWIG_LIBRARIES -# - GR_SWIG_SOURCE_DEPS -# - GR_SWIG_TARGET_DEPS -# - GR_SWIG_DOC_FILE -# - GR_SWIG_DOC_DIRS -######################################################################## -macro(GR_SWIG_MAKE name) - set(ifiles ${ARGN}) - - #do swig doc generation if specified - if (GR_SWIG_DOC_FILE) - set(GR_SWIG_DOCS_SOURCE_DEPS ${GR_SWIG_SOURCE_DEPS}) - set(GR_SWIG_DOCS_TAREGT_DEPS ${GR_SWIG_TARGET_DEPS}) - GR_SWIG_MAKE_DOCS(${GR_SWIG_DOC_FILE} ${GR_SWIG_DOC_DIRS}) - list(APPEND GR_SWIG_SOURCE_DEPS ${GR_SWIG_DOC_FILE}) - endif() - - #append additional include directories - find_package(PythonLibs 2) - list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) #deprecated name (now dirs) - list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}) - list(APPEND GR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) - list(APPEND GR_SWIG_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}) - - #determine include dependencies for swig file - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - ${CMAKE_BINARY_DIR}/get_swig_deps.py - "${ifiles}" "${GR_SWIG_INCLUDE_DIRS}" - OUTPUT_STRIP_TRAILING_WHITESPACE - OUTPUT_VARIABLE SWIG_MODULE_${name}_EXTRA_DEPS - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - - #Create a dummy custom command that depends on other targets - include(GrMiscUtils) - GR_GEN_TARGET_DEPS(_${name}_swig_tag tag_deps ${GR_SWIG_TARGET_DEPS}) - set(tag_file ${CMAKE_CURRENT_BINARY_DIR}/${name}.tag) - add_custom_command( - OUTPUT ${tag_file} - DEPENDS ${GR_SWIG_SOURCE_DEPS} ${tag_deps} - COMMAND ${CMAKE_COMMAND} -E touch ${tag_file} - ) - - #append the specified include directories - include_directories(${GR_SWIG_INCLUDE_DIRS}) - list(APPEND SWIG_MODULE_${name}_EXTRA_DEPS ${tag_file}) - - #setup the swig flags with flags and include directories - set(CMAKE_SWIG_FLAGS -fvirtual -modern -keyword -w511 -module ${name} ${GR_SWIG_FLAGS}) - foreach(dir ${GR_SWIG_INCLUDE_DIRS}) - list(APPEND CMAKE_SWIG_FLAGS "-I${dir}") - endforeach(dir) - - #set the C++ property on the swig .i file so it builds - set_source_files_properties(${ifiles} PROPERTIES CPLUSPLUS ON) - - #setup the actual swig library target to be built - include(UseSWIG) - SWIG_ADD_MODULE(${name} python ${ifiles}) - SWIG_LINK_LIBRARIES(${name} ${PYTHON_LIBRARIES} ${GR_SWIG_LIBRARIES}) - -endmacro(GR_SWIG_MAKE) - -######################################################################## -# Install swig targets generated by GR_SWIG_MAKE. Usage: -# GR_SWIG_INSTALL( -# TARGETS target target target... -# [DESTINATION destination] -# [COMPONENT component] -# ) -######################################################################## -macro(GR_SWIG_INSTALL) - - include(CMakeParseArgumentsCopy) - CMAKE_PARSE_ARGUMENTS(GR_SWIG_INSTALL "" "DESTINATION;COMPONENT" "TARGETS" ${ARGN}) - - foreach(name ${GR_SWIG_INSTALL_TARGETS}) - install(TARGETS ${SWIG_MODULE_${name}_REAL_NAME} - DESTINATION ${GR_SWIG_INSTALL_DESTINATION} - COMPONENT ${GR_SWIG_INSTALL_COMPONENT} - ) - - include(GrPython) - GR_PYTHON_INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.py - DESTINATION ${GR_SWIG_INSTALL_DESTINATION} - COMPONENT ${GR_SWIG_INSTALL_COMPONENT} - ) - - GR_LIBTOOL( - TARGET ${SWIG_MODULE_${name}_REAL_NAME} - DESTINATION ${GR_SWIG_INSTALL_DESTINATION} - ) - - endforeach(name) - -endmacro(GR_SWIG_INSTALL) - -######################################################################## -# Generate a python file that can determine swig dependencies. -# Used by the make macro above to determine extra dependencies. -# When you build C++, CMake figures out the header dependencies. -# This code essentially performs that logic for swig includes. -######################################################################## -file(WRITE ${CMAKE_BINARY_DIR}/get_swig_deps.py " - -import os, sys, re - -include_matcher = re.compile('[#|%]include\\s*[<|\"](.*)[>|\"]') -include_dirs = sys.argv[2].split(';') - -def get_swig_incs(file_path): - file_contents = open(file_path, 'r').read() - return include_matcher.findall(file_contents, re.MULTILINE) - -def get_swig_deps(file_path, level): - deps = [file_path] - if level == 0: return deps - for inc_file in get_swig_incs(file_path): - for inc_dir in include_dirs: - inc_path = os.path.join(inc_dir, inc_file) - if not os.path.exists(inc_path): continue - deps.extend(get_swig_deps(inc_path, level-1)) - return deps - -if __name__ == '__main__': - ifiles = sys.argv[1].split(';') - deps = sum([get_swig_deps(ifile, 3) for ifile in ifiles], []) - #sys.stderr.write(';'.join(set(deps)) + '\\n\\n') - print(';'.join(set(deps))) -") diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake deleted file mode 100644 index 6174c03..0000000 --- a/cmake/Modules/GrTest.cmake +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright 2010-2011 Free Software Foundation, Inc. -# -# 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. -# -# 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. - -if(DEFINED __INCLUDED_GR_TEST_CMAKE) - return() -endif() -set(__INCLUDED_GR_TEST_CMAKE TRUE) - -######################################################################## -# Add a unit test and setup the environment for a unit test. -# Takes the same arguments as the ADD_TEST function. -# -# Before calling set the following variables: -# GR_TEST_TARGET_DEPS - built targets for the library path -# GR_TEST_LIBRARY_DIRS - directories for the library path -# GR_TEST_PYTHON_DIRS - directories for the python path -######################################################################## -function(GR_ADD_TEST test_name) - - if(WIN32) - #Ensure that the build exe also appears in the PATH. - list(APPEND GR_TEST_TARGET_DEPS ${ARGN}) - - #In the land of windows, all libraries must be in the PATH. - #Since the dependent libraries are not yet installed, - #we must manually set them in the PATH to run tests. - #The following appends the path of a target dependency. - foreach(target ${GR_TEST_TARGET_DEPS}) - get_target_property(location ${target} LOCATION) - if(location) - get_filename_component(path ${location} PATH) - string(REGEX REPLACE "\\$\\(.*\\)" ${CMAKE_BUILD_TYPE} path ${path}) - list(APPEND GR_TEST_LIBRARY_DIRS ${path}) - endif(location) - endforeach(target) - - #SWIG generates the python library files into a subdirectory. - #Therefore, we must append this subdirectory into PYTHONPATH. - #Only do this for the python directories matching the following: - foreach(pydir ${GR_TEST_PYTHON_DIRS}) - get_filename_component(name ${pydir} NAME) - if(name MATCHES "^(swig|lib|src)$") - list(APPEND GR_TEST_PYTHON_DIRS ${pydir}/${CMAKE_BUILD_TYPE}) - endif() - endforeach(pydir) - endif(WIN32) - - file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} srcdir) - file(TO_NATIVE_PATH "${GR_TEST_LIBRARY_DIRS}" libpath) #ok to use on dir list? - file(TO_NATIVE_PATH "${GR_TEST_PYTHON_DIRS}" pypath) #ok to use on dir list? - - set(environs "GR_DONT_LOAD_PREFS=1" "srcdir=${srcdir}") - - #http://www.cmake.org/pipermail/cmake/2009-May/029464.html - #Replaced this add test + set environs code with the shell script generation. - #Its nicer to be able to manually run the shell script to diagnose problems. - #ADD_TEST(${ARGV}) - #SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}") - - if(UNIX) - set(binpath "${CMAKE_CURRENT_BINARY_DIR}:$PATH") - #set both LD and DYLD paths to cover multiple UNIX OS library paths - list(APPEND libpath "$LD_LIBRARY_PATH" "$DYLD_LIBRARY_PATH") - list(APPEND pypath "$PYTHONPATH") - - #replace list separator with the path separator - string(REPLACE ";" ":" libpath "${libpath}") - string(REPLACE ";" ":" pypath "${pypath}") - list(APPEND environs "PATH=${binpath}" "LD_LIBRARY_PATH=${libpath}" "DYLD_LIBRARY_PATH=${libpath}" "PYTHONPATH=${pypath}") - - #generate a bat file that sets the environment and runs the test - find_program(SHELL sh) - set(sh_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.sh) - file(WRITE ${sh_file} "#!${SHELL}\n") - #each line sets an environment variable - foreach(environ ${environs}) - file(APPEND ${sh_file} "export ${environ}\n") - endforeach(environ) - #load the command to run with its arguments - foreach(arg ${ARGN}) - file(APPEND ${sh_file} "${arg} ") - endforeach(arg) - file(APPEND ${sh_file} "\n") - - #make the shell file executable - execute_process(COMMAND chmod +x ${sh_file}) - - add_test(${test_name} ${SHELL} ${sh_file}) - - endif(UNIX) - - if(WIN32) - list(APPEND libpath ${DLL_PATHS} "%PATH%") - list(APPEND pypath "%PYTHONPATH%") - - #replace list separator with the path separator (escaped) - string(REPLACE ";" "\\;" libpath "${libpath}") - string(REPLACE ";" "\\;" pypath "${pypath}") - list(APPEND environs "PATH=${libpath}" "PYTHONPATH=${pypath}") - - #generate a bat file that sets the environment and runs the test - set(bat_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.bat) - file(WRITE ${bat_file} "@echo off\n") - #each line sets an environment variable - foreach(environ ${environs}) - file(APPEND ${bat_file} "SET ${environ}\n") - endforeach(environ) - #load the command to run with its arguments - foreach(arg ${ARGN}) - file(APPEND ${bat_file} "${arg} ") - endforeach(arg) - file(APPEND ${bat_file} "\n") - - add_test(${test_name} ${bat_file}) - endif(WIN32) - -endfunction(GR_ADD_TEST) diff --git a/cmake/Modules/UseSWIG.cmake b/cmake/Modules/UseSWIG.cmake deleted file mode 100644 index d101494..0000000 --- a/cmake/Modules/UseSWIG.cmake +++ /dev/null @@ -1,304 +0,0 @@ -# - SWIG module for CMake -# Defines the following macros: -# SWIG_ADD_MODULE(name language [ files ]) -# - Define swig module with given name and specified language -# SWIG_LINK_LIBRARIES(name [ libraries ]) -# - Link libraries to swig module -# All other macros are for internal use only. -# To get the actual name of the swig module, -# use: ${SWIG_MODULE_${name}_REAL_NAME}. -# Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to specify -# special behavior of SWIG. Also global CMAKE_SWIG_FLAGS can be used to add -# special flags to all swig calls. -# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify -# where to write all the swig generated module (swig -outdir option) -# The name-specific variable SWIG_MODULE__EXTRA_DEPS may be used -# to specify extra dependencies for the generated modules. -# If the source file generated by swig need some special flag you can use -# set_source_files_properties( ${swig_generated_file_fullname} -# PROPERTIES COMPILE_FLAGS "-bla") - - -#============================================================================= -# Copyright 2004-2009 Kitware, Inc. -# Copyright 2009 Mathieu Malaterre -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -set(SWIG_CXX_EXTENSION "cxx") -set(SWIG_EXTRA_LIBRARIES "") - -set(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py") - -# -# For given swig module initialize variables associated with it -# -macro(SWIG_MODULE_INITIALIZE name language) - string(TOUPPER "${language}" swig_uppercase_language) - string(TOLOWER "${language}" swig_lowercase_language) - set(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}") - set(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}") - - set(SWIG_MODULE_${name}_REAL_NAME "${name}") - if("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN") - message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found") - elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON") - # when swig is used without the -interface it will produce in the module.py - # a 'import _modulename' statement, which implies having a corresponding - # _modulename.so (*NIX), _modulename.pyd (Win32). - set(SWIG_MODULE_${name}_REAL_NAME "_${name}") - elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL") - set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow") - endif() -endmacro() - -# -# For a given language, input file, and output file, determine extra files that -# will be generated. This is internal swig macro. -# - -macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile) - set(${outfiles} "") - get_source_file_property(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename - ${infile} SWIG_MODULE_NAME) - if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND") - get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE) - endif() - foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION}) - set(${outfiles} ${${outfiles}} - "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}") - endforeach() -endmacro() - -# -# Take swig (*.i) file and add proper custom commands for it -# -macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) - set(swig_full_infile ${infile}) - get_filename_component(swig_source_file_path "${infile}" PATH) - get_filename_component(swig_source_file_name_we "${infile}" NAME_WE) - get_source_file_property(swig_source_file_generated ${infile} GENERATED) - get_source_file_property(swig_source_file_cplusplus ${infile} CPLUSPLUS) - get_source_file_property(swig_source_file_flags ${infile} SWIG_FLAGS) - if("${swig_source_file_flags}" STREQUAL "NOTFOUND") - set(swig_source_file_flags "") - endif() - set(swig_source_file_fullname "${infile}") - if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}") - string(REGEX REPLACE - "^${CMAKE_CURRENT_SOURCE_DIR}" "" - swig_source_file_relative_path - "${swig_source_file_path}") - else() - if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}") - string(REGEX REPLACE - "^${CMAKE_CURRENT_BINARY_DIR}" "" - swig_source_file_relative_path - "${swig_source_file_path}") - set(swig_source_file_generated 1) - else() - set(swig_source_file_relative_path "${swig_source_file_path}") - if(swig_source_file_generated) - set(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}") - else() - set(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}") - endif() - endif() - endif() - - set(swig_generated_file_fullname - "${CMAKE_CURRENT_BINARY_DIR}") - if(swig_source_file_relative_path) - set(swig_generated_file_fullname - "${swig_generated_file_fullname}/${swig_source_file_relative_path}") - endif() - # If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir - if(CMAKE_SWIG_OUTDIR) - set(swig_outdir ${CMAKE_SWIG_OUTDIR}) - else() - set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR}) - endif() - SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE} - swig_extra_generated_files - "${swig_outdir}" - "${infile}") - set(swig_generated_file_fullname - "${swig_generated_file_fullname}/${swig_source_file_name_we}") - # add the language into the name of the file (i.e. TCL_wrap) - # this allows for the same .i file to be wrapped into different languages - set(swig_generated_file_fullname - "${swig_generated_file_fullname}${SWIG_MODULE_${name}_LANGUAGE}_wrap") - - if(swig_source_file_cplusplus) - set(swig_generated_file_fullname - "${swig_generated_file_fullname}.${SWIG_CXX_EXTENSION}") - else() - set(swig_generated_file_fullname - "${swig_generated_file_fullname}.c") - endif() - - # Shut up some warnings from poor SWIG code generation that we - # can do nothing about, when this flag is available - include(CheckCXXCompilerFlag) - check_cxx_compiler_flag("-Wno-unused-but-set-variable" HAVE_WNO_UNUSED_BUT_SET_VARIABLE) - if(HAVE_WNO_UNUSED_BUT_SET_VARIABLE) - set_source_files_properties(${swig_generated_file_fullname} - PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable") - endif(HAVE_WNO_UNUSED_BUT_SET_VARIABLE) - - get_directory_property(cmake_include_directories INCLUDE_DIRECTORIES) - set(swig_include_dirs) - foreach(it ${cmake_include_directories}) - set(swig_include_dirs ${swig_include_dirs} "-I${it}") - endforeach() - - set(swig_special_flags) - # default is c, so add c++ flag if it is c++ - if(swig_source_file_cplusplus) - set(swig_special_flags ${swig_special_flags} "-c++") - endif() - set(swig_extra_flags) - if(SWIG_MODULE_${name}_EXTRA_FLAGS) - set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS}) - endif() - - # hack to work around CMake bug in add_custom_command with multiple OUTPUT files - - file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib -unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5] -print(re.sub('\\W', '_', '${name} ${reldir} ' + unique))" - OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - file( - WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_target}.cpp.in - "int main(void){return 0;}\n" - ) - - # create dummy dependencies - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}.cpp - COMMAND ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_BINARY_DIR}/${_target}.cpp.in - ${CMAKE_CURRENT_BINARY_DIR}/${_target}.cpp - DEPENDS "${swig_source_file_fullname}" ${SWIG_MODULE_${name}_EXTRA_DEPS} - COMMENT "" - ) - - # create the dummy target - add_executable(${_target} ${CMAKE_CURRENT_BINARY_DIR}/${_target}.cpp) - - # add a custom command to the dummy target - add_custom_command( - TARGET ${_target} - # Let's create the ${swig_outdir} at execution time, in case dir contains $(OutDir) - COMMAND ${CMAKE_COMMAND} -E make_directory ${swig_outdir} - COMMAND "${SWIG_EXECUTABLE}" - ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}" - ${swig_source_file_flags} - ${CMAKE_SWIG_FLAGS} - -outdir ${swig_outdir} - ${swig_special_flags} - ${swig_extra_flags} - ${swig_include_dirs} - -o "${swig_generated_file_fullname}" - "${swig_source_file_fullname}" - COMMENT "Swig source" - ) - - #add dummy independent dependencies from the _target to each file - #that will be generated by the SWIG command above - - set(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files}) - - foreach(swig_gen_file ${${outfiles}}) - add_custom_command( - OUTPUT ${swig_gen_file} - COMMAND - DEPENDS ${_target} - COMMENT - ) - endforeach() - - set_source_files_properties( - ${outfiles} PROPERTIES GENERATED 1 - ) - -endmacro() - -# -# Create Swig module -# -macro(SWIG_ADD_MODULE name language) - SWIG_MODULE_INITIALIZE(${name} ${language}) - set(swig_dot_i_sources) - set(swig_other_sources) - foreach(it ${ARGN}) - if(${it} MATCHES ".*\\.i$") - set(swig_dot_i_sources ${swig_dot_i_sources} "${it}") - else() - set(swig_other_sources ${swig_other_sources} "${it}") - endif() - endforeach() - - set(swig_generated_sources) - foreach(it ${swig_dot_i_sources}) - SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source ${it}) - set(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}") - endforeach() - get_directory_property(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES) - set_directory_properties(PROPERTIES - ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources}") - add_library(${SWIG_MODULE_${name}_REAL_NAME} - MODULE - ${swig_generated_sources} - ${swig_other_sources}) - string(TOLOWER "${language}" swig_lowercase_language) - if ("${swig_lowercase_language}" STREQUAL "java") - if (APPLE) - # In java you want: - # System.loadLibrary("LIBRARY"); - # then JNI will look for a library whose name is platform dependent, namely - # MacOS : libLIBRARY.jnilib - # Windows: LIBRARY.dll - # Linux : libLIBRARY.so - set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib") - endif () - endif () - if ("${swig_lowercase_language}" STREQUAL "python") - # this is only needed for the python case where a _modulename.so is generated - set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") - # Python extension modules on Windows must have the extension ".pyd" - # instead of ".dll" as of Python 2.5. Older python versions do support - # this suffix. - # http://docs.python.org/whatsnew/ports.html#SECTION0001510000000000000000 - # - # Windows: .dll is no longer supported as a filename extension for extension modules. - # .pyd is now the only filename extension that will be searched for. - # - if(WIN32 AND NOT CYGWIN) - set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd") - endif() - endif () -endmacro() - -# -# Like TARGET_LINK_LIBRARIES but for swig modules -# -macro(SWIG_LINK_LIBRARIES name) - if(SWIG_MODULE_${name}_REAL_NAME) - target_link_libraries(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN}) - else() - message(SEND_ERROR "Cannot find Swig library \"${name}\".") - endif() -endmacro() diff --git a/cmake/Modules/targetConfig.cmake.in b/cmake/Modules/targetConfig.cmake.in new file mode 100644 index 0000000..79e4a28 --- /dev/null +++ b/cmake/Modules/targetConfig.cmake.in @@ -0,0 +1,26 @@ +# Copyright 2018 Free Software Foundation, Inc. +# +# 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. +# +# 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) + +set(target_deps "@TARGET_DEPENDENCIES@") +foreach(dep IN LISTS target_deps) + find_dependency(${dep}) +endforeach() +include("${CMAKE_CURRENT_LIST_DIR}/@TARGET@Targets.cmake") diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt index 6e42918..bcb549d 100644 --- a/grc/CMakeLists.txt +++ b/grc/CMakeLists.txt @@ -17,15 +17,5 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -install(FILES - iio_device_source.xml iio_device_sink.xml - iio_fmcomms2_source.xml iio_fmcomms2_sink.xml - iio_fmcomms5_source.xml iio_fmcomms5_sink.xml - iio_pluto_source.xml iio_pluto_sink.xml - iio_math.xml iio_math_gen.xml iio_power_ff.xml - iio_modulo_ff.xml iio_modulo_const_ff.xml - iio_attr_sink.xml - iio_attr_source.xml - iio_attr_updater.xml - DESTINATION share/gnuradio/grc/blocks -) +file(GLOB yml_files "*.yml") +install(FILES ${yml_files} DESTINATION ${GRC_BLOCKS_DIR}) diff --git a/grc/iio.tree.yml b/grc/iio.tree.yml new file mode 100644 index 0000000..05171d2 --- /dev/null +++ b/grc/iio.tree.yml @@ -0,0 +1,16 @@ +'[Core]': +- 'Industrial I/O': + - 'Generic': + - iio_device_source + - iio_device_sink + - iio_attr_source + - iio_attr_sink + - iio_attr_updater + - 'FMComms': + - iio_fmcomms2_source + - iio_fmcomms2_sink + - iio_fmcomms5_source + - iio_fmcomms5_sink + - 'PlutoSDR': + - iio_pluto_source + - iio_pluto_sink diff --git a/grc/iio_attr_sink.block.yml b/grc/iio_attr_sink.block.yml new file mode 100644 index 0000000..4acb5ba --- /dev/null +++ b/grc/iio_attr_sink.block.yml @@ -0,0 +1,52 @@ +id: iio_attr_sink +label: IIO Attribute Sink +flags: [ python ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: 'local:' + +- id: device + label: Device Name/ID + dtype: string + +- id: attr_type + label: Attribute Type + dtype: enum + default: "'Channel'" + options: ['0', '1', '2', '3', '4'] + option_labels: ['Channel', 'Device', 'Device Buffer', 'Device Debug', 'Register'] + +- id: required_enable + label: Required Enable + dtype: bool + default: False + hide: ${ ('part' if (attr_type == '4') else 'all') } + +- id: output + label: Input/Output + dtype: enum + default: "'Input'" + options: ['False', 'True'] + option_labels: ['Input', 'Output'] + hide: ${ ('part' if (attr_type == '0') else 'all') } + +- id: channel + label: Channel Name + dtype: string + default: "" + hide: ${ ('none' if attr_type == '0' else 'all') } + +inputs: +- domain: message + id: attr + +templates: + imports: from gnuradio import iio + make: iio.attr_sink(${uri}, ${device}, ${channel}, ${attr_type}, ${output}, ${required_enable}) + +documentation: https://wiki.analog.com/resources/tools-software/linux-software/gnuradio + +file_format: 1 diff --git a/grc/iio_attr_source.block.yml b/grc/iio_attr_source.block.yml new file mode 100644 index 0000000..ec04835 --- /dev/null +++ b/grc/iio_attr_source.block.yml @@ -0,0 +1,85 @@ +id: iio_attr_source +label: IIO Attribute Source +flags: [ python ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: 'local:' + +- id: device + label: Device Name/ID + dtype: string + +- id: attr_type + label: Attribute Type + dtype: enum + default: "'Channel'" + options: ['0', '1', '2', '3'] + option_labels: ['Channel', 'Device', 'Device Debug', 'Register'] + +- id: output + label: Input/Output + dtype: enum + default: "'Input'" + options: ['False', 'True'] + option_labels: ['Input', 'Output'] + hide: ${ ('part' if (attr_type == '0') else 'all') } + +- id: channel + label: Channel Name + dtype: string + default: "" + hide: ${ ('none' if attr_type == '0' else 'all') } + +- id: attribute + label: Attribute Name + dtype: string + default: "" + hide: ${ ('none' if attr_type != '3' else 'all') } + +- id: address + label: Register Address + dtype: int + default: int("0x123",0) + hide: ${ ('none' if attr_type == '3' else 'all') } + +- id: required_enable + label: Required Enable + dtype: bool + default: False + options: ['False', 'True'] + hide: ${ ('part' if (attr_type == '3') else 'all') } + +- id: type + label: Data Type + dtype: enum + default: "'Input'" + options: ['0', '1', '2', '3', '4'] + option_labels: ['Double', 'Float (casted from double)', 'Long Long', 'Long (casted from long long)', 'Bool'] + option_attributes: + fcn: [f64, f32, s64, s32, s8] + hide: ${ ('part' if (attr_type != '3') else 'all') } + +- id: update_interval_ms + label: Update Interval (ms) + dtype: int + default: 1 + +- id: samples_per_update + label: Samples Per Update + dtype: int + default: 1024 + +outputs: +- domain: stream + dtype: ${ type.fcn } + +templates: + imports: from gnuradio import iio + make: iio.attr_source(${uri}, ${device}, ${channel}, ${attribute}, ${update_interval_ms}, ${samples_per_update}, ${type}, ${attr_type}, ${output}, ${address}, ${required_enable}) + +documentation: https://wiki.analog.com/resources/tools-software/linux-software/gnuradio + +file_format: 1 diff --git a/grc/iio_attr_updater.block.yml b/grc/iio_attr_updater.block.yml new file mode 100644 index 0000000..19df8fa --- /dev/null +++ b/grc/iio_attr_updater.block.yml @@ -0,0 +1,33 @@ +id: iio_attr_updater +label: IIO Attribute Updater +flags: [ python ] + +parameters: +- id: attr + label: Attribute Name + dtype: string + default: "" + +- id: value + label: Value + dtype: string + default: "" + +- id: update_interval_ms + label: Update Interval (ms) + dtype: int + default: 1 + +outputs: +- domain: message + id: out + +templates: + imports: from gnuradio import iio + make: iio.attr_updater(${attr}, ${value}, ${update_interval_ms}) + callbacks: + - update_value(${value}) + +documentation: https://wiki.analog.com/resources/tools-software/linux-software/gnuradio + +file_format: 1 diff --git a/grc/iio_device_sink.block.yml b/grc/iio_device_sink.block.yml new file mode 100644 index 0000000..4a2d0de --- /dev/null +++ b/grc/iio_device_sink.block.yml @@ -0,0 +1,58 @@ +id: iio_device_sink +label: IIO Device Sink +flags: [ python ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: 'local:' + +- id: device + label: Device Name/ID + dtype: string + +- id: device_phy + label: PHY Device Name/ID + dtype: string + +- id: channels + label: Channels + dtype: raw + default: [] + +- id: buffer_size + label: Buffer size + dtype: int + default: 0x8000 + +- id: interpolation + label: Interpolation + dtype: int + default: 1 + +- id: cyclic + label: Cyclic + dtype: bool + default: 'False' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: params + label: Parameters + dtype: raw + default: [] + +inputs: +- domain: stream + dtype: short + multiplicity: ${ len(channels) } + +asserts: +- ${ len(channels) > 0 } + +templates: + imports: from gnuradio import iio + make: iio.device_sink(${uri}, ${device}, ${channels}, ${device_phy}, ${params}, ${buffer_size}, ${interpolation} - 1, ${cyclic}) + +file_format: 1 diff --git a/grc/iio_device_source.block.yml b/grc/iio_device_source.block.yml new file mode 100644 index 0000000..3fc945b --- /dev/null +++ b/grc/iio_device_source.block.yml @@ -0,0 +1,51 @@ +id: iio_device_source +label: IIO Device Source +flags: [ python ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: 'local:' + +- id: device + label: Device Name/ID + dtype: string + +- id: device_phy + label: PHY Device Name/ID + dtype: string + +- id: channels + label: Channels + dtype: raw + default: [] + +- id: buffer_size + label: Buffer size + dtype: int + default: 0x8000 + +- id: decimation + label: Decimation + dtype: int + default: 1 + +- id: params + label: Parameters + dtype: raw + default: [] + +outputs: +- domain: stream + dtype: short + multiplicity: ${ len(channels) } +- domain: message + id: msg + optional: true + +templates: + imports: from gnuradio import iio + make: iio.device_source(${uri}, ${device}, ${channels}, ${device_phy}, ${params}, ${buffer_size}, ${decimation} - 1) + +file_format: 1 diff --git a/grc/iio_fmcomms2_sink.block.yml b/grc/iio_fmcomms2_sink.block.yml new file mode 100644 index 0000000..ac90ae2 --- /dev/null +++ b/grc/iio_fmcomms2_sink.block.yml @@ -0,0 +1,101 @@ +id: iio_fmcomms2_sink +label: FMComms2/3/4 Sink +flags: [ python ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: 'local:' + +- id: frequency + label: LO Frequency + dtype: int + default: 2400000000 + +- id: samplerate + label: Sample Rate + dtype: int + default: 2084000 + +- id: bandwidth + label: RF Bandwidth + dtype: int + default: 20000000 + +- id: buffer_size + label: Buffer size + dtype: int + default: 0x8000 + +- id: tx1_en + label: TX1 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: tx2_en + label: TX2 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: cyclic + label: Cyclic + dtype: bool + default: 'False' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rf_port_select + label: RF Port Select + dtype: enum + default: "'A'" + options: ["'A'", "'B'"] + option_labels: ['A', 'B'] + +- id: attenuation1 + label: Attenuation TX1 (dB) + dtype: float + default: 10.0 + hide: ${ ('part' if tx1_en else 'all') } + +- id: attenuation2 + label: Attenuation TX2 (dB) + dtype: float + default: 10.0 + hide: ${ ('part' if tx2_en else 'all') } + +- id: filter + label: Filter + dtype: file_open + default: '' + +- id: auto_filter + label: Filter Auto + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +inputs: +- domain: stream + dtype: complex + multiplicity: ${ sum([tx1_en, tx2_en]) } + +asserts: +- ${ sum([tx1_en, tx2_en]) > 0 } +- ${ ((samplerate>=2084000) or (len(filter)>0) or auto_filter) } +- ${ ((samplerate<=61440000) and (samplerate>=520833)) } +- ${ ((bandwidth<=52000000) and (bandwidth>=200000)) } +- ${ ((frequency<=6000000000) and (frequency>=47000000)) } + +templates: + imports: from gnuradio import iio + make: iio.fmcomms2_sink_f32c(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${filter}, ${auto_filter}) + callbacks: + - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${filter}, ${auto_filter}) + +file_format: 1 diff --git a/grc/iio_fmcomms2_source.block.yml b/grc/iio_fmcomms2_source.block.yml new file mode 100644 index 0000000..0e6db99 --- /dev/null +++ b/grc/iio_fmcomms2_source.block.yml @@ -0,0 +1,132 @@ +id: iio_fmcomms2_source +label: FMComms2/3/4 Source +flags: [ python, throttle ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: 'local:' + +- id: frequency + label: LO Frequency + dtype: int + default: 2400000000 + +- id: samplerate + label: Sample Rate + dtype: int + default: 2084000 + +- id: bandwidth + label: RF Bandwidth + dtype: int + default: 20000000 + +- id: buffer_size + label: Buffer size + dtype: int + default: 0x8000 + +- id: rx1_en + label: RX1 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rx2_en + label: RX2 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: quadrature + label: Quadrature + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rfdc + label: RF DC Correction + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: bbdc + label: BB DC Correction + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: gain1 + label: Gain Mode (RX1) + dtype: enum + default: "'manual'" + options: ["'manual'", "'slow_attack'", "'fast_attack'", "'hybrid'"] + option_labels: ['Manual', 'Slow Attack', 'Fast Attack', 'Hybrid'] + hide: ${ ('none' if rx1_en else 'all') } + +- id: manual_gain1 + label: Manual Gain (RX1)(dB) + dtype: float + default: 64 + hide: ${ ('none' if ((gain1 == 'manual') and (rx1_en)) else 'all') } + +- id: gain2 + label: Gain Mode (RX2) + dtype: enum + default: "'manual'" + options: ["'manual'", "'slow_attack'", "'fast_attack'", "'hybrid'"] + option_labels: ['Manual', 'Slow Attack', 'Fast Attack', 'Hybrid'] + hide: ${ ('none' if rx2_en else 'all') } + +- id: manual_gain2 + label: Manual Gain (RX2)(dB) + dtype: float + default: 64 + hide: ${ ('none' if ((gain2 == 'manual') and (rx2_en)) else 'all') } + +- id: rf_port_select + label: RF Port Select + dtype: enum + default: "'A_BALANCED'" + options: ["'A_BALANCED'", "'B_BALANCED'", "'C_BALANCED'", "'A_N'", "'A_P'", "'B_N'", "'B_P'", "'C_N'", "'C_P'", "'TX_MONITOR1'", "'TX_MONITOR2'", "'TX_MONITOR1_2'"] + option_labels: ['A_BALANCED', 'B_BALANCED', 'C_BALANCED', 'A_N', 'A_P', 'B_N', 'B_P', 'C_N', 'C_P', 'TX_MONITOR1', 'TX_MONITOR2', 'TX_MONITOR1_2'] + + +- id: filter + label: Filter + dtype: file_open + default: '' + +- id: auto_filter + label: Filter Auto + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +outputs: +- domain: stream + dtype: complex + multiplicity: ${ sum([rx1_en, rx2_en]) } + +asserts: +- ${ sum([rx1_en, rx2_en]) > 0 } +- ${ ((samplerate>=2084000) or (len(filter)>0) or auto_filter) } +- ${ ((samplerate<=61440000) and (samplerate>=520833)) } +- ${ ((bandwidth<=52000000) and (bandwidth>=200000)) } +- ${ ((frequency<=6000000000) and (frequency>=70000000)) } + +templates: + imports: from gnuradio import iio + make: iio.fmcomms2_source_f32c(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${rf_port_select}, ${filter}, ${auto_filter}) + callbacks: + - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${rf_port_select}, ${filter}, ${auto_filter}) + +file_format: 1 diff --git a/grc/iio_fmcomms5_sink.block.yml b/grc/iio_fmcomms5_sink.block.yml new file mode 100644 index 0000000..1386f82 --- /dev/null +++ b/grc/iio_fmcomms5_sink.block.yml @@ -0,0 +1,126 @@ +id: iio_fmcomms5_sink +label: FMComms5 Sink +flags: [ python ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: 'local:' + +- id: frequency1 + label: LO Frequency (RX1/RX2) + dtype: int + default: 2400000000 + +- id: frequency2 + label: LO Frequency (RX3/RX4) + dtype: int + default: 2400000000 + +- id: samplerate + label: Sample Rate + dtype: int + default: 2084000 + +- id: bandwidth + label: RF Bandwidth + dtype: int + default: 20000000 + +- id: buffer_size + label: Buffer size + dtype: int + default: 0x8000 + +- id: tx1_en + label: TX1 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: tx2_en + label: TX2 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: tx3_en + label: TX3 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: tx4_en + label: TX4 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: cyclic + label: Cyclic + dtype: bool + default: 'False' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rf_port_select + label: RF Port Select + dtype: enum + default: "'A'" + options: ["'A'", "'B'"] + option_labels: ['A', 'B'] + +- id: attenuation1 + label: Attenuation TX1 (dB) + dtype: float + default: 10.0 + hide: ${ ('part' if tx1_en else 'all') } + +- id: attenuation2 + label: Attenuation TX2 (dB) + dtype: float + default: 10.0 + hide: ${ ('part' if tx2_en else 'all') } + +- id: attenuation3 + label: Attenuation TX3 (dB) + dtype: float + default: 10.0 + hide: ${ ('part' if tx3_en else 'all') } + +- id: attenuation4 + label: Attenuation TX4 (dB) + dtype: float + default: 10.0 + hide: ${ ('part' if tx4_en else 'all') } + +- id: filter + label: Filter + dtype: file_open + default: '' + +inputs: +- domain: stream + dtype: complex + multiplicity: ${ sum([tx1_en, tx2_en, tx3_en, tx4_en]) } + +asserts: +- ${ sum([tx1_en, tx2_en, tx3_en, tx4_en]) > 0 } +- ${ ((samplerate>=2084000) or (len(filter)>0) or auto_filter) } +- ${ ((samplerate<=61440000) and (samplerate>=520833)) } +- ${ ((bandwidth<=52000000) and (bandwidth>=200000)) } +- ${ ((frequency1<=6000000000) and (frequency1>=47000000)) } +- ${ ((frequency2<=6000000000) and (frequency2>=47000000)) } + +templates: + imports: from gnuradio import iio + make: iio.fmcomms5_sink_f32c(${uri}, ${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${tx3_en}, ${tx4_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${attenuation3}, ${attenuation4}, ${filter}) + callbacks: + - set_params(${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${tx3_en}, ${tx4_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${attenuation3}, ${attenuation4}) + +file_format: 1 diff --git a/grc/iio_fmcomms5_source.block.yml b/grc/iio_fmcomms5_source.block.yml new file mode 100644 index 0000000..8d90dac --- /dev/null +++ b/grc/iio_fmcomms5_source.block.yml @@ -0,0 +1,173 @@ +id: iio_fmcomms5_source +label: FMComms5 Source +flags: [ python, throttle ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: 'local:' + +- id: frequency1 + label: LO Frequency (RX1/RX2) + dtype: int + default: 2400000000 + +- id: frequency2 + label: LO Frequency (RX3/RX4) + dtype: int + default: 2400000000 + +- id: samplerate + label: Sample Rate + dtype: int + default: 2084000 + +- id: bandwidth + label: RF Bandwidth + dtype: int + default: 20000000 + +- id: buffer_size + label: Buffer size + dtype: int + default: 0x8000 + +- id: rx1_en + label: RX1 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rx2_en + label: RX2 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rx3_en + label: RX3 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rx4_en + label: RX4 Enabled + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: quadrature + label: Quadrature + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rfdc + label: RF DC Correction + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: bbdc + label: BB DC Correction + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: gain1 + label: Gain Mode (RX1) + dtype: enum + default: "'manual'" + options: ["'manual'", "'slow_attack'", "'fast_attack'", "'hybrid'"] + option_labels: ['Manual', 'Slow Attack', 'Fast Attack', 'Hybrid'] + hide: ${ ('none' if rx1_en else 'all') } + +- id: manual_gain1 + label: Manual Gain (RX1)(dB) + dtype: float + default: 64 + hide: ${ ('none' if ((gain1 == 'manual') and (rx1_en)) else 'all') } + +- id: gain2 + label: Gain Mode (RX2) + dtype: enum + default: "'manual'" + options: ["'manual'", "'slow_attack'", "'fast_attack'", "'hybrid'"] + option_labels: ['Manual', 'Slow Attack', 'Fast Attack', 'Hybrid'] + hide: ${ ('none' if rx2_en else 'all') } + +- id: manual_gain2 + label: Manual Gain (RX2)(dB) + dtype: float + default: 64 + hide: ${ ('none' if ((gain2 == 'manual') and (rx2_en)) else 'all') } + +- id: gain3 + label: Gain Mode (RX3) + dtype: enum + default: "'manual'" + options: ["'manual'", "'slow_attack'", "'fast_attack'", "'hybrid'"] + option_labels: ['Manual', 'Slow Attack', 'Fast Attack', 'Hybrid'] + hide: ${ ('none' if rx3_en else 'all') } + +- id: manual_gain3 + label: Manual Gain (RX3)(dB) + dtype: float + default: 64 + hide: ${ ('none' if ((gain3 == 'manual') and (rx3_en)) else 'all') } + +- id: gain4 + label: Gain Mode (RX4) + dtype: enum + default: "'manual'" + options: ["'manual'", "'slow_attack'", "'fast_attack'", "'hybrid'"] + option_labels: ['Manual', 'Slow Attack', 'Fast Attack', 'Hybrid'] + hide: ${ ('none' if rx4_en else 'all') } + +- id: manual_gain4 + label: Manual Gain (RX4)(dB) + dtype: float + default: 64 + hide: ${ ('none' if ((gain4 == 'manual') and (rx4_en)) else 'all') } + +- id: rf_port_select + label: RF Port Select + dtype: enum + default: "'A_BALANCED'" + options: ["'A_BALANCED'", "'B_BALANCED'", "'C_BALANCED'", "'A_N'", "'A_P'", "'B_N'", "'B_P'", "'C_N'", "'C_P'", "'TX_MONITOR1'", "'TX_MONITOR2'", "'TX_MONITOR1_2'"] + option_labels: ['A_BALANCED', 'B_BALANCED', 'C_BALANCED', 'A_N', 'A_P', 'B_N', 'B_P', 'C_N', 'C_P', 'TX_MONITOR1', 'TX_MONITOR2', 'TX_MONITOR1_2'] + + +- id: filter + label: Filter + dtype: file_open + default: '' + +outputs: +- domain: stream + dtype: complex + multiplicity: ${ sum([rx1_en, rx2_en, rx3_en, rx4_en]) } + +asserts: +- ${ sum([rx1_en, rx2_en, rx3_en, rx4_en]) > 0 } +- ${ ((samplerate>=2084000) or (len(filter)>0) or auto_filter) } +- ${ ((samplerate<=61440000) and (samplerate>=520833)) } +- ${ ((bandwidth<=52000000) and (bandwidth>=200000)) } +- ${ ((frequency1<=6000000000) and (frequency1>=70000000)) } +- ${ ((frequency2<=6000000000) and (frequency2>=70000000)) } + +templates: + imports: from gnuradio import iio + make: iio.fmcomms5_source_f32c(${uri}, ${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${rx3_en}, ${rx4_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${gain3}, ${manual_gain3}, ${gain4}, ${manual_gain4}, ${rf_port_select}, ${filter}) + callbacks: + - set_params(${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${rx3_en}, ${rx4_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${gain3}, ${manual_gain3}, ${gain4}, ${manual_gain4}, ${rf_port_select}) + +file_format: 1 diff --git a/grc/iio_pluto_sink.block.yml b/grc/iio_pluto_sink.block.yml new file mode 100644 index 0000000..b4f010b --- /dev/null +++ b/grc/iio_pluto_sink.block.yml @@ -0,0 +1,71 @@ +id: iio_pluto_sink +label: PlutoSDR Sink +flags: [ python ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: '' + +- id: frequency + label: LO Frequency + dtype: int + default: 2400000000 + +- id: samplerate + label: Sample Rate + dtype: int + default: 2084000 + +- id: bandwidth + label: RF Bandwidth + dtype: int + default: 20000000 + +- id: buffer_size + label: Buffer size + dtype: int + default: 0x8000 + +- id: cyclic + label: Cyclic + dtype: bool + default: 'False' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: attenuation1 + label: Attenuation TX1 (dB) + dtype: float + default: 10.0 + +- id: filter + label: Filter + dtype: file_open + default: '' + +- id: auto_filter + label: Filter Auto + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +inputs: +- domain: stream + dtype: complex + +asserts: +- ${ ((samplerate>=2084000) or (len(filter)>0) or auto_filter) } +- ${ ((samplerate<=61440000) and (samplerate>=520833)) } +- ${ ((bandwidth<=52000000) and (bandwidth>=200000)) } +- ${ ((frequency<=6000000000) and (frequency>=47000000)) } + +templates: + imports: from gnuradio import iio + make: iio.pluto_sink(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${cyclic}, ${attenuation1}, ${filter}, ${auto_filter}) + callbacks: + - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${cyclic}, ${attenuation1}, ${filter}, ${auto_filter}) + +file_format: 1 diff --git a/grc/iio_pluto_source.block.yml b/grc/iio_pluto_source.block.yml new file mode 100644 index 0000000..5be53ef --- /dev/null +++ b/grc/iio_pluto_source.block.yml @@ -0,0 +1,93 @@ +id: iio_pluto_source +label: PlutoSDR Source +flags: [ python, throttle ] + +parameters: +- id: uri + label: IIO context URI + dtype: string + default: '' + +- id: frequency + label: LO Frequency + dtype: int + default: 2400000000 + +- id: samplerate + label: Sample Rate + dtype: int + default: 2084000 + +- id: bandwidth + label: RF Bandwidth + dtype: int + default: 20000000 + +- id: buffer_size + label: Buffer size + dtype: int + default: 0x8000 + +- id: quadrature + label: Quadrature + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: rfdc + label: RF DC Correction + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: bbdc + label: BB DC Correction + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +- id: gain1 + label: Gain Mode (RX1) + dtype: enum + default: "'manual'" + options: ["'manual'", "'slow_attack'", "'fast_attack'", "'hybrid'"] + option_labels: ['Manual', 'Slow Attack', 'Fast Attack', 'Hybrid'] + +- id: manual_gain1 + label: Manual Gain (RX1)(dB) + dtype: float + default: 64 + hide: ${ ('none' if gain1 == "'manual'" else 'all') } + +- id: filter + label: Filter + dtype: file_open + default: '' + +- id: auto_filter + label: Filter Auto + dtype: bool + default: 'True' + options: ['False', 'True'] + option_labels: ['False', 'True'] + +outputs: +- domain: stream + dtype: complex + +asserts: +- ${ ((samplerate>=2084000) or (len(filter)>0) or auto_filter) } +- ${ ((samplerate<=61440000) and (samplerate>=520833)) } +- ${ ((bandwidth<=52000000) and (bandwidth>=200000)) } +- ${ ((frequency<=6000000000) and (frequency>=70000000)) } + +templates: + imports: from gnuradio import iio + make: iio.pluto_source(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${filter}, ${auto_filter}) + callbacks: + - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${filter}, ${auto_filter}) + +file_format: 1 diff --git a/include/gnuradio/iio/CMakeLists.txt b/include/iio/CMakeLists.txt similarity index 96% rename from include/gnuradio/iio/CMakeLists.txt rename to include/iio/CMakeLists.txt index 1215748..e889c4f 100644 --- a/include/gnuradio/iio/CMakeLists.txt +++ b/include/iio/CMakeLists.txt @@ -30,5 +30,5 @@ install(FILES attr_sink.h attr_source.h modulo_ff.h modulo_const_ff.h - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/iio + DESTINATION ${GR_INCLUDE_DIR}/iio ) diff --git a/include/gnuradio/iio/api.h b/include/iio/api.h similarity index 100% rename from include/gnuradio/iio/api.h rename to include/iio/api.h diff --git a/include/gnuradio/iio/attr_sink.h b/include/iio/attr_sink.h similarity index 98% rename from include/gnuradio/iio/attr_sink.h rename to include/iio/attr_sink.h index 1d4f49b..08abbea 100644 --- a/include/gnuradio/iio/attr_sink.h +++ b/include/iio/attr_sink.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_ATTR_SINK_H #define INCLUDED_IIO_ATTR_SINK_H -#include +#include #include namespace gr { diff --git a/include/gnuradio/iio/attr_source.h b/include/iio/attr_source.h similarity index 98% rename from include/gnuradio/iio/attr_source.h rename to include/iio/attr_source.h index 22d860a..f0046c2 100644 --- a/include/gnuradio/iio/attr_source.h +++ b/include/iio/attr_source.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_ATTR_SOURCE_H #define INCLUDED_IIO_ATTR_SOURCE_H -#include +#include #include namespace gr { diff --git a/include/gnuradio/iio/converter_ss.h b/include/iio/converter_ss.h similarity index 97% rename from include/gnuradio/iio/converter_ss.h rename to include/iio/converter_ss.h index 3717dfc..b86106a 100644 --- a/include/gnuradio/iio/converter_ss.h +++ b/include/iio/converter_ss.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_CONVERTER_SS_H #define INCLUDED_IIO_CONVERTER_SS_H -#include +#include #include extern "C" { diff --git a/include/gnuradio/iio/device_sink.h b/include/iio/device_sink.h similarity index 98% rename from include/gnuradio/iio/device_sink.h rename to include/iio/device_sink.h index 707e232..e71dfea 100644 --- a/include/gnuradio/iio/device_sink.h +++ b/include/iio/device_sink.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_DEVICE_SINK_H #define INCLUDED_IIO_DEVICE_SINK_H -#include +#include #include #define DEFAULT_BUFFER_SIZE 0x8000 diff --git a/include/gnuradio/iio/device_source.h b/include/iio/device_source.h similarity index 98% rename from include/gnuradio/iio/device_source.h rename to include/iio/device_source.h index f6fd3bd..cc5ca4f 100644 --- a/include/gnuradio/iio/device_source.h +++ b/include/iio/device_source.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_DEVICE_SOURCE_H #define INCLUDED_IIO_DEVICE_SOURCE_H -#include +#include #include #define DEFAULT_BUFFER_SIZE 0x8000 diff --git a/include/gnuradio/iio/fmcomms2_sink.h b/include/iio/fmcomms2_sink.h similarity index 99% rename from include/gnuradio/iio/fmcomms2_sink.h rename to include/iio/fmcomms2_sink.h index d8b3260..8ddaed7 100644 --- a/include/gnuradio/iio/fmcomms2_sink.h +++ b/include/iio/fmcomms2_sink.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_FMCOMMS2_SINK_H #define INCLUDED_IIO_FMCOMMS2_SINK_H -#include +#include #include #include diff --git a/include/gnuradio/iio/fmcomms2_source.h b/include/iio/fmcomms2_source.h similarity index 99% rename from include/gnuradio/iio/fmcomms2_source.h rename to include/iio/fmcomms2_source.h index 0f82d54..bebc83e 100644 --- a/include/gnuradio/iio/fmcomms2_source.h +++ b/include/iio/fmcomms2_source.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_FMCOMMS2_SOURCE_H #define INCLUDED_IIO_FMCOMMS2_SOURCE_H -#include +#include #include #include diff --git a/include/gnuradio/iio/fmcomms5_sink.h b/include/iio/fmcomms5_sink.h similarity index 99% rename from include/gnuradio/iio/fmcomms5_sink.h rename to include/iio/fmcomms5_sink.h index bc00e74..6c89a1b 100644 --- a/include/gnuradio/iio/fmcomms5_sink.h +++ b/include/iio/fmcomms5_sink.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_FMCOMMS5_SINK_H #define INCLUDED_IIO_FMCOMMS5_SINK_H -#include +#include #include #include diff --git a/include/gnuradio/iio/fmcomms5_source.h b/include/iio/fmcomms5_source.h similarity index 99% rename from include/gnuradio/iio/fmcomms5_source.h rename to include/iio/fmcomms5_source.h index 1f0ecf1..b57a237 100644 --- a/include/gnuradio/iio/fmcomms5_source.h +++ b/include/iio/fmcomms5_source.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_FMCOMMS5_SOURCE_H #define INCLUDED_IIO_FMCOMMS5_SOURCE_H -#include +#include #include #include diff --git a/include/gnuradio/iio/math.h b/include/iio/math.h similarity index 97% rename from include/gnuradio/iio/math.h rename to include/iio/math.h index 210ccf4..3e32953 100644 --- a/include/gnuradio/iio/math.h +++ b/include/iio/math.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_MATH_H #define INCLUDED_IIO_MATH_H -#include +#include #include namespace gr { diff --git a/include/gnuradio/iio/modulo_const_ff.h b/include/iio/modulo_const_ff.h similarity index 97% rename from include/gnuradio/iio/modulo_const_ff.h rename to include/iio/modulo_const_ff.h index 04bf735..ba151f6 100644 --- a/include/gnuradio/iio/modulo_const_ff.h +++ b/include/iio/modulo_const_ff.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_GR_IIO_MODULO_CONST_FF_H #define INCLUDED_GR_IIO_MODULO_CONST_FF_H -#include +#include #include namespace gr { diff --git a/include/gnuradio/iio/modulo_ff.h b/include/iio/modulo_ff.h similarity index 97% rename from include/gnuradio/iio/modulo_ff.h rename to include/iio/modulo_ff.h index d608a85..f8df93f 100644 --- a/include/gnuradio/iio/modulo_ff.h +++ b/include/iio/modulo_ff.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_GR_IIO_MODULO_FF_H #define INCLUDED_GR_IIO_MODULO_FF_H -#include +#include #include namespace gr { diff --git a/include/gnuradio/iio/pluto_sink.h b/include/iio/pluto_sink.h similarity index 98% rename from include/gnuradio/iio/pluto_sink.h rename to include/iio/pluto_sink.h index e27f496..318c279 100644 --- a/include/gnuradio/iio/pluto_sink.h +++ b/include/iio/pluto_sink.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_PLUTO_SINK_H #define INCLUDED_IIO_PLUTO_SINK_H -#include +#include #include namespace gr { diff --git a/include/gnuradio/iio/pluto_source.h b/include/iio/pluto_source.h similarity index 98% rename from include/gnuradio/iio/pluto_source.h rename to include/iio/pluto_source.h index dd1c95c..c334cf7 100644 --- a/include/gnuradio/iio/pluto_source.h +++ b/include/iio/pluto_source.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_PLUTO_SOURCE_H #define INCLUDED_IIO_PLUTO_SOURCE_H -#include +#include #include namespace gr { diff --git a/include/gnuradio/iio/power_ff.h b/include/iio/power_ff.h similarity index 97% rename from include/gnuradio/iio/power_ff.h rename to include/iio/power_ff.h index 1c0c83e..cff991b 100644 --- a/include/gnuradio/iio/power_ff.h +++ b/include/iio/power_ff.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_GR_IIO_POWER_FF_H #define INCLUDED_GR_IIO_POWER_FF_H -#include +#include #include namespace gr { diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index b27a6d9..7b66d6d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -31,7 +31,8 @@ find_package(BISON "3.0.2" REQUIRED) flex_target(lexer ${CMAKE_CURRENT_SOURCE_DIR}/iio_math_lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.c) bison_target(parser - ${CMAKE_CURRENT_SOURCE_DIR}/iio_math_parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.c) + ${CMAKE_CURRENT_SOURCE_DIR}/iio_math_parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.c + DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.h) list(APPEND iio_sources device_source_impl.cc @@ -60,21 +61,21 @@ if(NOT iio_sources) return() endif(NOT iio_sources) -if ("${PC_GNURADIO_RUNTIME_VERSION}" VERSION_LESS 3.8.0) - set(GR_IS_VERSION_3_7_OR_LESS ON) -endif() - -option(COMPAT_GR_3_7_OR_LESS "Compile for GNU Radio version 3.7 or less" ${GR_IS_VERSION_3_7_OR_LESS}) -if (COMPAT_GR_3_7_OR_LESS) - add_definitions(-DGR_VERSION_3_7_OR_LESS) -endif() - add_library(gnuradio-iio SHARED ${iio_sources}) target_link_libraries(gnuradio-iio - ${Boost_LIBRARIES} + gnuradio::gnuradio-runtime + gnuradio::gnuradio-blocks + gnuradio::gnuradio-analog + gnuradio::gnuradio-pmt + gnuradio::gnuradio-filter + gnuradio::gnuradio-fft ${IIO_LIBRARIES} - ${AD9361_LIBRARIES} - ${GNURADIO_ALL_LIBRARIES}) + ${AD9361_LIBRARIES}) +target_include_directories(gnuradio-iio + PUBLIC $ + PUBLIC $ + PUBLIC $ + ) set_target_properties(gnuradio-iio PROPERTIES VERSION ${GR_IIO_VERSION} SOVERSION ${GR_IIO_VERSION_MAJOR} @@ -90,17 +91,5 @@ endif(APPLE) ######################################################################## # Install built library files ######################################################################## -install(TARGETS gnuradio-iio - LIBRARY DESTINATION ${GR_LIBRARY_DIR} # .so/.dylib file - ARCHIVE DESTINATION ${GR_LIBRARY_DIR} # .lib file - RUNTIME DESTINATION ${GR_RUNTIME_DIR} # .dll file -) - - -######################################################################## -# Setup the include and linker paths -######################################################################## -#include_directories( -# ${GR_IIO_INCLUDE_DIRS} -# ${GNURADIO_RUNTIME_INCLUDE_DIRS} -# ${Boost_INCLUDE_DIRS} +include(GrMiscUtils) +GR_LIBRARY_FOO(gnuradio-iio) diff --git a/lib/attr_sink_impl.h b/lib/attr_sink_impl.h index ce63bb6..14c9e55 100644 --- a/lib/attr_sink_impl.h +++ b/lib/attr_sink_impl.h @@ -23,7 +23,7 @@ #define INCLUDED_IIO_ATTR_SINK_IMPL_H #include -#include +#include #include #include "device_source_impl.h" diff --git a/lib/attr_source_impl.h b/lib/attr_source_impl.h index ea922ce..8dd7044 100644 --- a/lib/attr_source_impl.h +++ b/lib/attr_source_impl.h @@ -22,7 +22,7 @@ #ifndef INCLUDED_IIO_ATTR_SOURCE_IMPL_H #define INCLUDED_IIO_ATTR_SOURCE_IMPL_H -#include +#include #include #include "device_source_impl.h" diff --git a/lib/converter_ss_impl.h b/lib/converter_ss_impl.h index 3adc43a..53b37ca 100644 --- a/lib/converter_ss_impl.h +++ b/lib/converter_ss_impl.h @@ -23,7 +23,7 @@ #define INCLUDED_IIO_CONVERTER_SS_IMPL_H #include -#include +#include namespace gr { namespace iio { diff --git a/lib/device_sink_impl.h b/lib/device_sink_impl.h index 97dd983..57f7232 100644 --- a/lib/device_sink_impl.h +++ b/lib/device_sink_impl.h @@ -26,7 +26,7 @@ #include #include -#include +#include namespace gr { namespace iio { diff --git a/lib/device_source_impl.h b/lib/device_source_impl.h index 49b326e..fd1af74 100644 --- a/lib/device_source_impl.h +++ b/lib/device_source_impl.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace gr { namespace iio { diff --git a/lib/fmcomms2_sink_impl.h b/lib/fmcomms2_sink_impl.h index 459d990..7be139d 100644 --- a/lib/fmcomms2_sink_impl.h +++ b/lib/fmcomms2_sink_impl.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "device_sink_impl.h" diff --git a/lib/fmcomms2_source_impl.h b/lib/fmcomms2_source_impl.h index d9c0aad..622c2f6 100644 --- a/lib/fmcomms2_source_impl.h +++ b/lib/fmcomms2_source_impl.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "device_source_impl.h" diff --git a/lib/fmcomms5_sink_impl.h b/lib/fmcomms5_sink_impl.h index 4fb869d..1f332c2 100644 --- a/lib/fmcomms5_sink_impl.h +++ b/lib/fmcomms5_sink_impl.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "device_sink_impl.h" diff --git a/lib/fmcomms5_source_impl.h b/lib/fmcomms5_source_impl.h index aa0f109..e1d41c4 100644 --- a/lib/fmcomms5_source_impl.h +++ b/lib/fmcomms5_source_impl.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "device_source_impl.h" diff --git a/lib/iio_math_impl.cc b/lib/iio_math_impl.cc index 89e15c6..eada598 100644 --- a/lib/iio_math_impl.cc +++ b/lib/iio_math_impl.cc @@ -45,8 +45,8 @@ #include #include #include -#include -#include +#include +#include #include using namespace gr; diff --git a/lib/iio_math_impl.h b/lib/iio_math_impl.h index 2189bd6..5b412dc 100644 --- a/lib/iio_math_impl.h +++ b/lib/iio_math_impl.h @@ -25,7 +25,7 @@ #include #include -#include +#include extern "C" { #include "parser.h" diff --git a/lib/iio_modulo_const_ff_impl.h b/lib/iio_modulo_const_ff_impl.h index 384bb69..0b4d93a 100644 --- a/lib/iio_modulo_const_ff_impl.h +++ b/lib/iio_modulo_const_ff_impl.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_MODULO_CONST_FF_IMPL_H #define INCLUDED_IIO_MODULO_CONST_FF_IMPL_H -#include +#include namespace gr { namespace iio { diff --git a/lib/iio_modulo_ff_impl.h b/lib/iio_modulo_ff_impl.h index f95c791..e8e1486 100644 --- a/lib/iio_modulo_ff_impl.h +++ b/lib/iio_modulo_ff_impl.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_MODULO_FF_IMPL_H #define INCLUDED_IIO_MODULO_FF_IMPL_H -#include +#include namespace gr { namespace iio { diff --git a/lib/iio_power_ff_impl.h b/lib/iio_power_ff_impl.h index 595dcfd..6cf11e2 100644 --- a/lib/iio_power_ff_impl.h +++ b/lib/iio_power_ff_impl.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_IIO_POWER_FF_IMPL_H #define INCLUDED_IIO_POWER_FF_IMPL_H -#include +#include namespace gr { namespace iio { diff --git a/lib/pluto_sink_impl.h b/lib/pluto_sink_impl.h index de9b1be..23782fc 100644 --- a/lib/pluto_sink_impl.h +++ b/lib/pluto_sink_impl.h @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include "device_sink_impl.h" diff --git a/lib/pluto_source_impl.h b/lib/pluto_source_impl.h index b864fca..d72bc74 100644 --- a/lib/pluto_source_impl.h +++ b/lib/pluto_source_impl.h @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include "device_source_impl.h" diff --git a/python/iio/CMakeLists.txt b/python/CMakeLists.txt similarity index 96% rename from python/iio/CMakeLists.txt rename to python/CMakeLists.txt index eaa7047..81879a7 100644 --- a/python/iio/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -32,5 +32,5 @@ GR_PYTHON_INSTALL( FILES __init__.py attr_updater.py - DESTINATION ${GR_PYTHON_DIR}/gnuradio/iio + DESTINATION ${GR_PYTHON_DIR}/iio ) diff --git a/python/iio/__init__.py b/python/__init__.py similarity index 78% rename from python/iio/__init__.py rename to python/__init__.py index edfce0a..f32003c 100644 --- a/python/iio/__init__.py +++ b/python/__init__.py @@ -23,17 +23,18 @@ description here (python/__init__.py). ''' +from __future__ import unicode_literals import os try: - from iio_swig import * - from iio_pluto_source_swig import * - from iio_pluto_sink_swig import * + from .iio_swig import * + from .iio_pluto_source_swig import * + from .iio_pluto_sink_swig import * except ImportError: dirname, filename = os.path.split(os.path.abspath(__file__)) __path__.append(os.path.join(dirname, "..", "..", "swig")) - from iio_swig import * - from iio_pluto_source_swig import * - from iio_pluto_sink_swig import * + from .iio_swig import * + from .iio_pluto_source_swig import * + from .iio_pluto_sink_swig import * -from attr_updater import attr_updater +from .attr_updater import attr_updater diff --git a/python/iio/attr_updater.py b/python/attr_updater.py similarity index 97% rename from python/iio/attr_updater.py rename to python/attr_updater.py index b0f8711..f64b119 100644 --- a/python/iio/attr_updater.py +++ b/python/attr_updater.py @@ -71,7 +71,7 @@ def sender(self): try: self.message_port_pub(self.port, msg_dic) except: - print "Error: Failed to publish message" + print("Error: Failed to publish message") return sleep(self.interval/1000) diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index cbc3371..5792469 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -29,7 +29,7 @@ endif(NOT iio_sources) # Include swig generation macros ######################################################################## find_package(SWIG) -find_package(PythonLibs 2) +find_package(PythonLibs) if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND) return() endif() @@ -39,11 +39,11 @@ include(GrPython) ######################################################################## # Setup swig generation ######################################################################## -foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS}) - list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig) -endforeach(incdir) +set(GR_SWIG_INCLUDE_DIRS $) +set(GR_SWIG_TARGET_DEPS gnuradio::runtime_swig) set(GR_SWIG_LIBRARIES gnuradio-iio) + GR_SWIG_MAKE(iio_swig iio_swig.i) GR_SWIG_MAKE(iio_pluto_source_swig iio_pluto_source_swig.i) GR_SWIG_MAKE(iio_pluto_sink_swig iio_pluto_sink_swig.i) @@ -52,7 +52,7 @@ GR_SWIG_MAKE(iio_pluto_sink_swig iio_pluto_sink_swig.i) # Install the build swig module ######################################################################## GR_SWIG_INSTALL(TARGETS iio_swig iio_pluto_source_swig iio_pluto_sink_swig - DESTINATION ${GR_PYTHON_DIR}/gnuradio/iio) + DESTINATION ${GR_PYTHON_DIR}/iio) ######################################################################## # Install swig .i files for development @@ -62,5 +62,5 @@ install( iio_swig.i iio_pluto_source_swig.i iio_pluto_sink_swig.i - DESTINATION ${GR_INCLUDE_DIR}/swig + DESTINATION ${GR_INCLUDE_DIR}/iio/swig ) diff --git a/swig/iio_pluto_sink_swig.i b/swig/iio_pluto_sink_swig.i index 77492d0..5242029 100644 --- a/swig/iio_pluto_sink_swig.i +++ b/swig/iio_pluto_sink_swig.i @@ -8,9 +8,9 @@ %include "gnuradio.i" %{ -#include "gnuradio/iio/pluto_sink.h" +#include "iio/pluto_sink.h" %} -%include "gnuradio/iio/pluto_sink.h" +%include "iio/pluto_sink.h" GR_SWIG_BLOCK_MAGIC2(iio, pluto_sink); diff --git a/swig/iio_pluto_source_swig.i b/swig/iio_pluto_source_swig.i index f36be77..fc7f4f3 100644 --- a/swig/iio_pluto_source_swig.i +++ b/swig/iio_pluto_source_swig.i @@ -8,9 +8,9 @@ %include "gnuradio.i" %{ -#include "gnuradio/iio/pluto_source.h" +#include "iio/pluto_source.h" %} -%include "gnuradio/iio/pluto_source.h" +%include "iio/pluto_source.h" GR_SWIG_BLOCK_MAGIC2(iio, pluto_source); diff --git a/swig/iio_swig.i b/swig/iio_swig.i index 2318846..044ea13 100644 --- a/swig/iio_swig.i +++ b/swig/iio_swig.i @@ -5,32 +5,32 @@ %include "gnuradio.i" %{ -#include "gnuradio/iio/device_source.h" -#include "gnuradio/iio/device_sink.h" -#include "gnuradio/iio/fmcomms2_source.h" -#include "gnuradio/iio/fmcomms2_sink.h" -#include "gnuradio/iio/fmcomms5_source.h" -#include "gnuradio/iio/fmcomms5_sink.h" -#include "gnuradio/iio/math.h" -#include "gnuradio/iio/power_ff.h" -#include "gnuradio/iio/modulo_ff.h" -#include "gnuradio/iio/modulo_const_ff.h" -#include "gnuradio/iio/attr_sink.h" -#include "gnuradio/iio/attr_source.h" +#include "iio/device_source.h" +#include "iio/device_sink.h" +#include "iio/fmcomms2_source.h" +#include "iio/fmcomms2_sink.h" +#include "iio/fmcomms5_source.h" +#include "iio/fmcomms5_sink.h" +#include "iio/math.h" +#include "iio/power_ff.h" +#include "iio/modulo_ff.h" +#include "iio/modulo_const_ff.h" +#include "iio/attr_sink.h" +#include "iio/attr_source.h" %} -%include "gnuradio/iio/device_source.h" -%include "gnuradio/iio/device_sink.h" -%include "gnuradio/iio/fmcomms2_source.h" -%include "gnuradio/iio/fmcomms2_sink.h" -%include "gnuradio/iio/fmcomms5_source.h" -%include "gnuradio/iio/fmcomms5_sink.h" -%include "gnuradio/iio/math.h" -%include "gnuradio/iio/power_ff.h" -%include "gnuradio/iio/modulo_ff.h" -%include "gnuradio/iio/modulo_const_ff.h" -%include "gnuradio/iio/attr_sink.h" -%include "gnuradio/iio/attr_source.h" +%include "iio/device_source.h" +%include "iio/device_sink.h" +%include "iio/fmcomms2_source.h" +%include "iio/fmcomms2_sink.h" +%include "iio/fmcomms5_source.h" +%include "iio/fmcomms5_sink.h" +%include "iio/math.h" +%include "iio/power_ff.h" +%include "iio/modulo_ff.h" +%include "iio/modulo_const_ff.h" +%include "iio/attr_sink.h" +%include "iio/attr_source.h" GR_SWIG_BLOCK_MAGIC2(iio, device_source); GR_SWIG_BLOCK_MAGIC2(iio, device_sink); From 05e2c21336121d753d7e874c7ebab69ce5086b9e Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Fri, 23 Aug 2019 16:01:31 -0700 Subject: [PATCH 03/20] Update all yml files to not import from gnuradio folder Signed-off-by: Travis F. Collins --- grc/iio_attr_sink.block.yml | 2 +- grc/iio_attr_source.block.yml | 2 +- grc/iio_attr_updater.block.yml | 2 +- grc/iio_device_sink.block.yml | 2 +- grc/iio_device_source.block.yml | 2 +- grc/iio_fmcomms2_sink.block.yml | 2 +- grc/iio_fmcomms2_source.block.yml | 2 +- grc/iio_fmcomms5_sink.block.yml | 2 +- grc/iio_fmcomms5_source.block.yml | 2 +- grc/iio_pluto_sink.block.yml | 2 +- grc/iio_pluto_source.block.yml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/grc/iio_attr_sink.block.yml b/grc/iio_attr_sink.block.yml index 4acb5ba..77bd6d7 100644 --- a/grc/iio_attr_sink.block.yml +++ b/grc/iio_attr_sink.block.yml @@ -44,7 +44,7 @@ inputs: id: attr templates: - imports: from gnuradio import iio + imports: import iio make: iio.attr_sink(${uri}, ${device}, ${channel}, ${attr_type}, ${output}, ${required_enable}) documentation: https://wiki.analog.com/resources/tools-software/linux-software/gnuradio diff --git a/grc/iio_attr_source.block.yml b/grc/iio_attr_source.block.yml index ec04835..d7afc7d 100644 --- a/grc/iio_attr_source.block.yml +++ b/grc/iio_attr_source.block.yml @@ -77,7 +77,7 @@ outputs: dtype: ${ type.fcn } templates: - imports: from gnuradio import iio + imports: import iio make: iio.attr_source(${uri}, ${device}, ${channel}, ${attribute}, ${update_interval_ms}, ${samples_per_update}, ${type}, ${attr_type}, ${output}, ${address}, ${required_enable}) documentation: https://wiki.analog.com/resources/tools-software/linux-software/gnuradio diff --git a/grc/iio_attr_updater.block.yml b/grc/iio_attr_updater.block.yml index 19df8fa..22918e5 100644 --- a/grc/iio_attr_updater.block.yml +++ b/grc/iio_attr_updater.block.yml @@ -23,7 +23,7 @@ outputs: id: out templates: - imports: from gnuradio import iio + imports: import iio make: iio.attr_updater(${attr}, ${value}, ${update_interval_ms}) callbacks: - update_value(${value}) diff --git a/grc/iio_device_sink.block.yml b/grc/iio_device_sink.block.yml index 4a2d0de..a8e9352 100644 --- a/grc/iio_device_sink.block.yml +++ b/grc/iio_device_sink.block.yml @@ -52,7 +52,7 @@ asserts: - ${ len(channels) > 0 } templates: - imports: from gnuradio import iio + imports: import iio make: iio.device_sink(${uri}, ${device}, ${channels}, ${device_phy}, ${params}, ${buffer_size}, ${interpolation} - 1, ${cyclic}) file_format: 1 diff --git a/grc/iio_device_source.block.yml b/grc/iio_device_source.block.yml index 3fc945b..97d3d99 100644 --- a/grc/iio_device_source.block.yml +++ b/grc/iio_device_source.block.yml @@ -45,7 +45,7 @@ outputs: optional: true templates: - imports: from gnuradio import iio + imports: import iio make: iio.device_source(${uri}, ${device}, ${channels}, ${device_phy}, ${params}, ${buffer_size}, ${decimation} - 1) file_format: 1 diff --git a/grc/iio_fmcomms2_sink.block.yml b/grc/iio_fmcomms2_sink.block.yml index ac90ae2..2f87683 100644 --- a/grc/iio_fmcomms2_sink.block.yml +++ b/grc/iio_fmcomms2_sink.block.yml @@ -93,7 +93,7 @@ asserts: - ${ ((frequency<=6000000000) and (frequency>=47000000)) } templates: - imports: from gnuradio import iio + imports: import iio make: iio.fmcomms2_sink_f32c(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${filter}, ${auto_filter}) callbacks: - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${filter}, ${auto_filter}) diff --git a/grc/iio_fmcomms2_source.block.yml b/grc/iio_fmcomms2_source.block.yml index 0e6db99..fc8ab4d 100644 --- a/grc/iio_fmcomms2_source.block.yml +++ b/grc/iio_fmcomms2_source.block.yml @@ -124,7 +124,7 @@ asserts: - ${ ((frequency<=6000000000) and (frequency>=70000000)) } templates: - imports: from gnuradio import iio + imports: import iio make: iio.fmcomms2_source_f32c(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${rf_port_select}, ${filter}, ${auto_filter}) callbacks: - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${rf_port_select}, ${filter}, ${auto_filter}) diff --git a/grc/iio_fmcomms5_sink.block.yml b/grc/iio_fmcomms5_sink.block.yml index 1386f82..2523df7 100644 --- a/grc/iio_fmcomms5_sink.block.yml +++ b/grc/iio_fmcomms5_sink.block.yml @@ -118,7 +118,7 @@ asserts: - ${ ((frequency2<=6000000000) and (frequency2>=47000000)) } templates: - imports: from gnuradio import iio + imports: import iio make: iio.fmcomms5_sink_f32c(${uri}, ${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${tx3_en}, ${tx4_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${attenuation3}, ${attenuation4}, ${filter}) callbacks: - set_params(${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${tx3_en}, ${tx4_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${attenuation3}, ${attenuation4}) diff --git a/grc/iio_fmcomms5_source.block.yml b/grc/iio_fmcomms5_source.block.yml index 8d90dac..a52fc0b 100644 --- a/grc/iio_fmcomms5_source.block.yml +++ b/grc/iio_fmcomms5_source.block.yml @@ -165,7 +165,7 @@ asserts: - ${ ((frequency2<=6000000000) and (frequency2>=70000000)) } templates: - imports: from gnuradio import iio + imports: import iio make: iio.fmcomms5_source_f32c(${uri}, ${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${rx3_en}, ${rx4_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${gain3}, ${manual_gain3}, ${gain4}, ${manual_gain4}, ${rf_port_select}, ${filter}) callbacks: - set_params(${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${rx3_en}, ${rx4_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${gain3}, ${manual_gain3}, ${gain4}, ${manual_gain4}, ${rf_port_select}) diff --git a/grc/iio_pluto_sink.block.yml b/grc/iio_pluto_sink.block.yml index b4f010b..c5e8db0 100644 --- a/grc/iio_pluto_sink.block.yml +++ b/grc/iio_pluto_sink.block.yml @@ -63,7 +63,7 @@ asserts: - ${ ((frequency<=6000000000) and (frequency>=47000000)) } templates: - imports: from gnuradio import iio + imports: import iio make: iio.pluto_sink(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${cyclic}, ${attenuation1}, ${filter}, ${auto_filter}) callbacks: - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${cyclic}, ${attenuation1}, ${filter}, ${auto_filter}) diff --git a/grc/iio_pluto_source.block.yml b/grc/iio_pluto_source.block.yml index 5be53ef..a9415be 100644 --- a/grc/iio_pluto_source.block.yml +++ b/grc/iio_pluto_source.block.yml @@ -85,7 +85,7 @@ asserts: - ${ ((frequency<=6000000000) and (frequency>=70000000)) } templates: - imports: from gnuradio import iio + imports: import iio make: iio.pluto_source(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${filter}, ${auto_filter}) callbacks: - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${filter}, ${auto_filter}) From a0525f7eb3fe6bea7401e95d4b0db0461f0dc3b4 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Fri, 23 Aug 2019 16:02:48 -0700 Subject: [PATCH 04/20] Remove old xml files Signed-off-by: Travis F. Collins --- grc/iio_attr_sink.xml | 93 ----------- grc/iio_attr_source.xml | 145 ----------------- grc/iio_attr_updater.xml | 32 ---- grc/iio_device_sink.xml | 81 ---------- grc/iio_device_source.xml | 77 --------- grc/iio_fmcomms2_sink.xml | 136 ---------------- grc/iio_fmcomms2_source.xml | 239 --------------------------- grc/iio_fmcomms5_sink.xml | 162 ------------------- grc/iio_fmcomms5_source.xml | 311 ------------------------------------ grc/iio_math.xml | 38 ----- grc/iio_math_gen.xml | 37 ----- grc/iio_modulo_const_ff.xml | 31 ---- grc/iio_modulo_ff.xml | 30 ---- grc/iio_pluto_sink.xml | 94 ----------- grc/iio_pluto_source.xml | 135 ---------------- grc/iio_power_ff.xml | 36 ----- 16 files changed, 1677 deletions(-) delete mode 100644 grc/iio_attr_sink.xml delete mode 100644 grc/iio_attr_source.xml delete mode 100644 grc/iio_attr_updater.xml delete mode 100644 grc/iio_device_sink.xml delete mode 100644 grc/iio_device_source.xml delete mode 100644 grc/iio_fmcomms2_sink.xml delete mode 100644 grc/iio_fmcomms2_source.xml delete mode 100644 grc/iio_fmcomms5_sink.xml delete mode 100644 grc/iio_fmcomms5_source.xml delete mode 100644 grc/iio_math.xml delete mode 100644 grc/iio_math_gen.xml delete mode 100644 grc/iio_modulo_const_ff.xml delete mode 100644 grc/iio_modulo_ff.xml delete mode 100644 grc/iio_pluto_sink.xml delete mode 100644 grc/iio_pluto_source.xml delete mode 100644 grc/iio_power_ff.xml diff --git a/grc/iio_attr_sink.xml b/grc/iio_attr_sink.xml deleted file mode 100644 index c57b516..0000000 --- a/grc/iio_attr_sink.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - IIO Attribute Sink - iio_attr_sink - [Industrial IO] - from gnuradio import iio - iio.attr_sink($uri, $device, $channel, $attr_type, $output, $required_enable) - - uri - uri - "" - string - - - Device - device - "" - string - - - - Attribute Type - attr_type - enum - - - - - - - - - Required Enable - required_enable - enum - #if int($attr_type()) == 4 then 'none' else 'all'# - - - - - - Input/Output - output - enum - #if int($attr_type()) == 0 then 'none' else 'all'# - - - - - - Channel Name - channel - "" - string - #if int($attr_type()) == 0 then 'none' else 'all'# - - - - attr - message - 1 - - - https://wiki.analog.com/resources/tools-software/linux-software/gnuradio - - diff --git a/grc/iio_attr_source.xml b/grc/iio_attr_source.xml deleted file mode 100644 index 949b38d..0000000 --- a/grc/iio_attr_source.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - IIO Attribute Source - iio_attr_source - [Industrial IO] - from gnuradio import iio - iio.attr_source($uri, $device, $channel, $attribute, $update_interval_ms, $samples_per_update, $type, $attr_type, $output, $address, $required_enable) - - - uri - uri - "" - string - - - Device - device - "" - string - - - Attribute Type - attr_type - enum - - - - - - - Input/Output - output - enum - #if int($attr_type()) == 0 then 'none' else 'all'# - - - - - Channel Name - channel - "" - string - #if int($attr_type()) == 0 then 'none' else 'all'# - - - Attribute Name - attribute - "" - string - #if int($attr_type()) != 3 then 'none' else 'all'# - - - Register Address - address - int("0x123",0) - int - #if int($attr_type()) == 3 then 'none' else 'all'# - - - Required Enable - required_enable - enum - #if int($attr_type()) == 3 then 'none' else 'all'# - - - - - Data Type - type - enum - #if int($attr_type()) != 3 then 'none' else 'all'# - - - - - - - - Update Interval (ms) - update_interval_ms - 1 - int - - - Samples Per Update - samples_per_update - 1024 - int - - - - out - #if int($attr_type()) == 3 then 's32' else str($type.fcn)# - len($attributes) - - - - https://wiki.analog.com/resources/tools-software/linux-software/gnuradio - - - diff --git a/grc/iio_attr_updater.xml b/grc/iio_attr_updater.xml deleted file mode 100644 index fe1272c..0000000 --- a/grc/iio_attr_updater.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - IIO Attribute Updater - iio_attr_updater - [Industrial IO] - from gnuradio import iio - iio.attr_updater($attr, $value, $interval) - update_value($value) - - Attribute - attr - "" - string - - - Value - value - "" - string - - - Interval (ms) - interval - 1 - int - - - - out - message - - diff --git a/grc/iio_device_sink.xml b/grc/iio_device_sink.xml deleted file mode 100644 index 009c3ca..0000000 --- a/grc/iio_device_sink.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - IIO Device Sink - iio_device_sink - [Industrial IO] - throttle - from gnuradio import iio - iio.device_sink($uri, $device, $channels, $device_phy, $params, $buffer_size, $interpolation - 1, $cyclic) - - - IIO context URI - uri - local: - string - - - - Device Name/ID - device - string - - - - PHY Device Name/ID - device_phy - string - - - - Channels - channels - [] - raw - - - - Buffer size - buffer_size - 0x8000 - int - - - - Interpolation - interpolation - 1 - int - - - - Cyclic - cyclic - False - enum - - - - - - Parameters - params - [] - raw - - - - $device - $device_phy - - - $interpolation > 0 - - - len($channels) > 0 - - - in - short - len($channels) - - diff --git a/grc/iio_device_source.xml b/grc/iio_device_source.xml deleted file mode 100644 index ef6158a..0000000 --- a/grc/iio_device_source.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - IIO Device Source - iio_device_source - [Industrial IO] - throttle - from gnuradio import iio - iio.device_source($uri, $device, $channels, $device_phy, $params, $buffer_size, $decimation - 1) - - - IIO context URI - uri - local: - string - - - - Device Name/ID - device - string - - - - PHY Device Name/ID - device_phy - string - - - - Channels - channels - [] - raw - - - - Buffer size - buffer_size - 0x8000 - int - - - - Decimation - decimation - 1 - int - - - - Parameters - params - [] - raw - - - - $device - $device_phy - - - $decimation > 0 - - - len($channels) > 0 - - - out - short - len($channels) - - - msg - message - 1 - - diff --git a/grc/iio_fmcomms2_sink.xml b/grc/iio_fmcomms2_sink.xml deleted file mode 100644 index 4e1230c..0000000 --- a/grc/iio_fmcomms2_sink.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - FMComms2/3/4 Sink - iio_fmcomms2_sink - [Industrial IO]/FMComms - throttle - from gnuradio import iio - iio.fmcomms2_sink_f32c($uri, int($frequency), int($samplerate), int($bandwidth), $tx1_en, $tx2_en, $buffer_size, $cyclic, $rf_port_select, $attenuation1, $attenuation2, $filter, $auto_filter) - set_params(int($frequency), int($samplerate), int($bandwidth), $rf_port_select, $attenuation1, $attenuation2, $filter, $auto_filter) - - - IIO context URI - uri - local: - string - - - - LO Frequency - frequency - 2400000000 - real - - - - Sample rate - samplerate - 2084000 - real - - - - RF bandwidth - bandwidth - 20000000 - real - - - - Buffer size - buffer_size - 0x8000 - int - - - - TX1 Enabled - tx1_en - True - enum - - - - - - TX2 Enabled - tx2_en - True - enum - - - - - - Cyclic - cyclic - False - enum - - - - - - RF Port Select - rf_port_select - enum - - - - - - Attenuation TX1 (dB) - attenuation1 - 10.0 - real - - - - Attenuation TX2 (dB) - attenuation2 - 10.0 - real - - - - Filter - filter - - file_open - - - - Filter auto - auto_filter - True - enum - - - - - - sum([$tx1_en, $tx2_en]) > 0 - - - ($samplerate >= 2084000) or (len($filter) > 0) or $auto_filter - - - ($frequency >= 0) - ($bandwidth >= 0) - ($samplerate >= 0) - - - not ($auto_filter and len($filter)) - - - in - complex - sum([$tx1_en, $tx2_en]) - - diff --git a/grc/iio_fmcomms2_source.xml b/grc/iio_fmcomms2_source.xml deleted file mode 100644 index e1ab802..0000000 --- a/grc/iio_fmcomms2_source.xml +++ /dev/null @@ -1,239 +0,0 @@ - - - FMComms2/3/4 Source - iio_fmcomms2_source - [Industrial IO]/FMComms - throttle - from gnuradio import iio - iio.fmcomms2_source_f32c($uri, int($frequency), int($samplerate), int($bandwidth), $rx1_en, $rx2_en, $buffer_size, $quadrature, $rfdc, $bbdc, $gain1, $manual_gain1, $gain2, $manual_gain2, $rf_port_select, $filter, $auto_filter) - set_params(int($frequency), int($samplerate), int($bandwidth), $quadrature, $rfdc, $bbdc, $gain1, $manual_gain1, $gain2, $manual_gain2, $rf_port_select, $filter, $auto_filter) - - - IIO context URI - uri - local: - string - - - - LO Frequency - frequency - 2400000000 - real - - - - Sample rate - samplerate - 2084000 - real - - - - RF bandwidth - bandwidth - 20000000 - real - - - - Buffer size - buffer_size - 0x8000 - int - - - - RX1 Enabled - rx1_en - True - enum - - - - - - RX2 Enabled - rx2_en - True - enum - - - - - - Quadrature - quadrature - True - enum - - - - - - RF DC - rfdc - True - enum - - - - - - BB DC - bbdc - True - enum - - - - - - Gain Mode (RX1) - gain1 - enum - - - - - - - - Manual Gain (RX1)(dB) - manual_gain1 - 64.0 - real - #if $gain1() == '"manual"' then 'none' else 'all'# - - - - Gain Mode (RX2) - gain2 - enum - - - - - - - - Manual Gain (RX2)(dB) - manual_gain2 - 64.0 - real - #if $gain2() == '"manual"' then 'none' else 'all'# - - - - RF Port Select - rf_port_select - enum - - - - - - - - - - - - - - - - Filter - filter - - file_open - - - - Filter auto - auto_filter - True - enum - - - - - sum([$rx1_en, $rx2_en]) > 0 - - - ($samplerate >= 2084000) or (len($filter) > 0) or $auto_filter - - - ($frequency >= 0) - ($bandwidth >= 0) - ($samplerate >= 0) - - - not ($auto_filter and len($filter)) - - - out - complex - sum([$rx1_en, $rx2_en]) - - diff --git a/grc/iio_fmcomms5_sink.xml b/grc/iio_fmcomms5_sink.xml deleted file mode 100644 index 425a9ca..0000000 --- a/grc/iio_fmcomms5_sink.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - FMComms5 Sink - iio_fmcomms5_sink - [Industrial IO]/FMComms - throttle - from gnuradio import iio - iio.fmcomms5_sink_f32c($uri, int($frequency1), int($frequency2), int($samplerate), int($bandwidth), $ch1_en, $ch2_en, $ch3_en, $ch4_en, $buffer_size, $cyclic, $rf_port_select, $attenuation1, $attenuation2, $attenuation3, $attenuation4, $filter) - set_params(int($frequency1), int($frequency2), int($samplerate), int($bandwidth), $rf_port_select, $attenuation1, $attenuation2, $attenuation3, $attenuation4) - - - - IIO context URI - uri - local: - string - - - - LO Frequency (TX1/TX2) - frequency1 - 2400000000 - real - - - - LO Frequency (TX3/TX4) - frequency2 - 2400000000 - real - - - - Sample rate - samplerate - 2084000 - real - - - - RF bandwidth - bandwidth - 20000000 - real - - - - Buffer size - buffer_size - 0x8000 - int - - - - Channel 1 Enabled - ch1_en - True - enum - - - - - - Channel 2 Enabled - ch2_en - True - enum - - - - - - Channel 3 Enabled - ch3_en - True - enum - - - - - - Channel 4 Enabled - ch4_en - True - enum - - - - - - Cyclic - cyclic - False - enum - - - - - - RF Port Select - rf_port_select - enum - - - - - - Attenuation TX1 (dB) - attenuation1 - 10.0 - real - - - - Attenuation TX2 (dB) - attenuation2 - 10.0 - real - - - - Attenuation TX3 (dB) - attenuation3 - 10.0 - real - - - - Attenuation TX4 (dB) - attenuation4 - 10.0 - real - - - - Filter - filter - - file_open - - - sum([$ch1_en, $ch2_en, $ch3_en, $ch4_en]) > 0 - $samplerate >= 2084000 - - - ($frequency1 >= 0) - ($frequency2 >= 0) - ($bandwidth >= 0) - ($samplerate >= 0) - - - in - complex - sum([$ch1_en, $ch2_en, $ch3_en, $ch4_en]) - - diff --git a/grc/iio_fmcomms5_source.xml b/grc/iio_fmcomms5_source.xml deleted file mode 100644 index 084144e..0000000 --- a/grc/iio_fmcomms5_source.xml +++ /dev/null @@ -1,311 +0,0 @@ - - - FMComms5 Source - iio_fmcomms5_source - [Industrial IO]/FMComms - throttle - from gnuradio import iio - iio.fmcomms5_source_f32c($uri, int($frequency1), int($frequency2), int($samplerate), int($bandwidth), $ch1_en, $ch2_en, $ch3_en, $ch4_en, $buffer_size, $quadrature, $rfdc, $bbdc, $gain1, $manual_gain1, $gain2, $manual_gain2, $gain3, $manual_gain3, $gain4, $manual_gain4, $rf_port_select, $filter) - set_params(int($frequency1), int($frequency2), int($samplerate), int($bandwidth), $quadrature, $rfdc, $bbdc, $gain1, $manual_gain1, $gain2, $manual_gain2, $gain3, $manual_gain3, $gain4, $manual_gain4, $rf_port_select) - - - IIO context URI - uri - local: - string - - - - LO Frequency (RX1/RX2) - frequency1 - 2400000000 - real - - - - LO Frequency (RX3/RX4) - frequency2 - 2400000000 - real - - - - Sample rate - samplerate - 2084000 - real - - - - RF bandwidth - bandwidth - 20000000 - real - - - - Buffer size - buffer_size - 0x8000 - int - - - - Channel 1 Enabled - ch1_en - True - enum - - - - - - Channel 2 Enabled - ch2_en - True - enum - - - - - - Channel 3 Enabled - ch3_en - True - enum - - - - - - Channel 4 Enabled - ch4_en - True - enum - - - - - - Quadrature - quadrature - True - enum - - - - - - RF DC - rfdc - True - enum - - - - - - BB DC - bbdc - True - enum - - - - - - Gain Mode (RX1) - gain1 - enum - - - - - - - - Manual Gain (RX1)(dB) - manual_gain1 - 64.0 - real - #if $gain1() == '"manual"' then 'none' else 'all'# - - - - Gain Mode (RX2) - gain2 - enum - - - - - - - - Manual Gain (RX2)(dB) - manual_gain2 - 64.0 - real - #if $gain2() == '"manual"' then 'none' else 'all'# - - - - Gain Mode (RX3) - gain3 - enum - - - - - - - - Manual Gain (RX3)(dB) - manual_gain3 - 64.0 - real - #if $gain3() == '"manual"' then 'none' else 'all'# - - - - Gain Mode (RX4) - gain4 - enum - - - - - - - - Manual Gain (RX4)(dB) - manual_gain4 - 64.0 - real - #if $gain4() == '"manual"' then 'none' else 'all'# - - - - RF Port Select - rf_port_select - enum - - - - - - - - - - - - - - - - Filter - filter - - file_open - - - sum([$ch1_en, $ch2_en, $ch3_en, $ch4_en]) > 0 - $samplerate >= 2084000 - - - ($frequency1 >= 0) - ($frequency2 >= 0) - ($bandwidth >= 0) - ($samplerate >= 0) - - - out - complex - sum([$ch1_en, $ch2_en, $ch3_en, $ch4_en]) - - diff --git a/grc/iio_math.xml b/grc/iio_math.xml deleted file mode 100644 index d928921..0000000 --- a/grc/iio_math.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - Function - math - [Industrial IO]/Math Operators - from gnuradio import iio - iio.iio_math($function, $num_inputs) - - - f(x) = - function - - string - - - - Num Inputs - num_inputs - 1 - int - - - - $function - - $num_inputs > 0 - - - in - float - $num_inputs - - - - out - float - - diff --git a/grc/iio_math_gen.xml b/grc/iio_math_gen.xml deleted file mode 100644 index 0cdb746..0000000 --- a/grc/iio_math_gen.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - Function Generator - math_gen - [Industrial IO]/Waveform Generators - from gnuradio import iio - iio.iio_math_gen($samp_rate, $wav_freq, $function) - - - samp_rate - samp_rate - samp_rate - int - - - - wav_freq - wav_freq - 1 - int - - - - f(x) = - function - - string - - - - $function - - - out - float - - diff --git a/grc/iio_modulo_const_ff.xml b/grc/iio_modulo_const_ff.xml deleted file mode 100644 index 8702bb3..0000000 --- a/grc/iio_modulo_const_ff.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - Modulo Const - iio_modulo_const_ff - [Industrial IO]/Math Operators - from gnuradio import iio - iio.modulo_const_ff($modulo, $vlen) - - Modulo - modulo - 1.0 - float - - - Vec Length - vlen - 1 - int - - $vlen > 0 - - in - float - $vlen - - - out - float - $vlen - - diff --git a/grc/iio_modulo_ff.xml b/grc/iio_modulo_ff.xml deleted file mode 100644 index ff3060c..0000000 --- a/grc/iio_modulo_ff.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - Modulo - iio_modulo_ff - [Industrial IO]/Math Operators - from gnuradio import iio - iio.modulo_ff($vlen) - - Vec Length - vlen - 1 - int - - $vlen > 0 - - in - float - $vlen - - - mod - float - $vlen - - - out - float - $vlen - - diff --git a/grc/iio_pluto_sink.xml b/grc/iio_pluto_sink.xml deleted file mode 100644 index d2c2c08..0000000 --- a/grc/iio_pluto_sink.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - PlutoSDR Sink - pluto_sink - [Industrial IO]/PlutoSDR - throttle - from gnuradio import iio - iio.pluto_sink($uri, int($frequency), int($samplerate), int($bandwidth), $buffer_size, $cyclic, $attenuation, $filter, $auto_filter) - set_params(int($frequency), int($samplerate), int($bandwidth), $attenuation, $filter, $auto_filter) - - - IIO context URI - uri - - string - - - - LO Frequency - frequency - 2400000000 - real - - - - Sample rate - samplerate - 2084000 - real - - - - RF bandwidth - bandwidth - 20000000 - real - - - - Buffer size - buffer_size - 0x8000 - int - - - - Cyclic - cyclic - False - enum - - - - - - Attenuation (dB) - attenuation - 10.0 - real - - - - Filter - filter - - file_open - - - - Filter auto - auto_filter - True - enum - - - - - - ($samplerate >= 2084000) or (len($filter) > 0) or $auto_filter - - - ($frequency >= 0) - ($bandwidth >= 0) - ($samplerate >= 0) - - - not ($auto_filter and len($filter)) - - - in - complex - 1 - - diff --git a/grc/iio_pluto_source.xml b/grc/iio_pluto_source.xml deleted file mode 100644 index cb6d6b7..0000000 --- a/grc/iio_pluto_source.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - PlutoSDR Source - pluto_source - [Industrial IO]/PlutoSDR - throttle - from gnuradio import iio - iio.pluto_source($uri, int($frequency), int($samplerate), int($bandwidth), $buffer_size, $quadrature, $rfdc, $bbdc, $gain, $manual_gain, $filter, $auto_filter) - set_params(int($frequency), int($samplerate), int($bandwidth), $quadrature, $rfdc, $bbdc, $gain, $manual_gain, $filter, $auto_filter) - - - Device URI - uri - - string - - - - LO Frequency - frequency - 2400000000 - real - - - - Sample rate - samplerate - 2084000 - real - - - - RF bandwidth - bandwidth - 20000000 - real - - - - Buffer size - buffer_size - 0x8000 - int - - - - Quadrature - quadrature - True - enum - - - - - - RF DC - rfdc - True - enum - - - - - - BB DC - bbdc - True - enum - - - - - - Gain Mode - gain - enum - - - - - - - - Manual Gain (dB) - manual_gain - 64.0 - real - #if $gain() == '"manual"' then 'none' else 'all'# - - - - Filter - filter - - file_open - - - - Filter auto - auto_filter - True - enum - - - - - - ($samplerate >= 2084000) or (len($filter) > 0) or $auto_filter - - - ($frequency >= 0) - ($bandwidth >= 0) - ($samplerate >= 0) - - - not ($auto_filter and len($filter)) - - - out - complex - 1 - - diff --git a/grc/iio_power_ff.xml b/grc/iio_power_ff.xml deleted file mode 100644 index 2a60263..0000000 --- a/grc/iio_power_ff.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - Power - iio_power_ff - [Industrial IO]/Math Operators - from gnuradio import iio - iio.power_ff($vlen) - - Vec Length - vlen - 1 - int - - $vlen > 0 - - base - float - $vlen - - - exp - float - $vlen - - - out - float - $vlen - - From af3148c5bb8d90be2b59fdc1fe52f1f17b763f50 Mon Sep 17 00:00:00 2001 From: "Shih, En" Date: Fri, 7 Feb 2020 11:20:34 +0800 Subject: [PATCH 05/20] Set GRC_BLOCKS_DIR in top-level CMakeLists.txt Fix grc install destination because GRC_BLOCKS_DIR is no longer defined in the top-level CMakeLists.txt. Signed-off-by: En Shih --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17f0367..3cd4e88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,7 @@ set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}) set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d) set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) +set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## # Find gnuradio build dependencies From ece283f148fb2cb105556f8861380e9bd06bec53 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 11 Feb 2020 15:12:50 +0200 Subject: [PATCH 06/20] CMakeLists.txt: Changed the destination directory of the include files When including gr-iio headers in an external app, you have to #include while internal includes refer to the same file using #include This commit changes the destination of the include files on make install so the external app includes just Signed-off-by: Adrian Suciu --- include/iio/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/iio/CMakeLists.txt b/include/iio/CMakeLists.txt index e889c4f..968fb2c 100644 --- a/include/iio/CMakeLists.txt +++ b/include/iio/CMakeLists.txt @@ -30,5 +30,5 @@ install(FILES attr_sink.h attr_source.h modulo_ff.h modulo_const_ff.h - DESTINATION ${GR_INCLUDE_DIR}/iio + DESTINATION ${GR_INCLUDE_DIR} ) From 638f681a1a0be14c1ef60342cf281f987d3e3e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20V=C3=A5gsether?= Date: Fri, 24 Jan 2020 23:48:07 -0800 Subject: [PATCH 07/20] Remove extraneous parameters from Pluto sink/source callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Vågsether --- grc/iio_pluto_sink.block.yml | 2 +- grc/iio_pluto_source.block.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grc/iio_pluto_sink.block.yml b/grc/iio_pluto_sink.block.yml index c5e8db0..c11f3cb 100644 --- a/grc/iio_pluto_sink.block.yml +++ b/grc/iio_pluto_sink.block.yml @@ -66,6 +66,6 @@ templates: imports: import iio make: iio.pluto_sink(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${cyclic}, ${attenuation1}, ${filter}, ${auto_filter}) callbacks: - - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${cyclic}, ${attenuation1}, ${filter}, ${auto_filter}) + - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${attenuation1}, ${filter}, ${auto_filter}) file_format: 1 diff --git a/grc/iio_pluto_source.block.yml b/grc/iio_pluto_source.block.yml index a9415be..c785eac 100644 --- a/grc/iio_pluto_source.block.yml +++ b/grc/iio_pluto_source.block.yml @@ -88,6 +88,6 @@ templates: imports: import iio make: iio.pluto_source(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${filter}, ${auto_filter}) callbacks: - - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${filter}, ${auto_filter}) + - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${filter}, ${auto_filter}) file_format: 1 From 99f9b6a594e1c4063e12068809c82ac6d39baa06 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Fri, 14 Feb 2020 08:25:40 -0800 Subject: [PATCH 08/20] Add throttle flags for grc hardware based blocks Signed-off-by: Travis F. Collins --- grc/iio_attr_sink.block.yml | 2 +- grc/iio_device_sink.block.yml | 2 +- grc/iio_device_source.block.yml | 2 +- grc/iio_fmcomms2_sink.block.yml | 2 +- grc/iio_fmcomms5_sink.block.yml | 2 +- grc/iio_pluto_sink.block.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/grc/iio_attr_sink.block.yml b/grc/iio_attr_sink.block.yml index 77bd6d7..9320b49 100644 --- a/grc/iio_attr_sink.block.yml +++ b/grc/iio_attr_sink.block.yml @@ -1,6 +1,6 @@ id: iio_attr_sink label: IIO Attribute Sink -flags: [ python ] +flags: [ python, throttle ] parameters: - id: uri diff --git a/grc/iio_device_sink.block.yml b/grc/iio_device_sink.block.yml index a8e9352..abcd504 100644 --- a/grc/iio_device_sink.block.yml +++ b/grc/iio_device_sink.block.yml @@ -1,6 +1,6 @@ id: iio_device_sink label: IIO Device Sink -flags: [ python ] +flags: [ python, throttle ] parameters: - id: uri diff --git a/grc/iio_device_source.block.yml b/grc/iio_device_source.block.yml index 97d3d99..ea6af88 100644 --- a/grc/iio_device_source.block.yml +++ b/grc/iio_device_source.block.yml @@ -1,6 +1,6 @@ id: iio_device_source label: IIO Device Source -flags: [ python ] +flags: [ python, throttle ] parameters: - id: uri diff --git a/grc/iio_fmcomms2_sink.block.yml b/grc/iio_fmcomms2_sink.block.yml index 2f87683..bfcd4de 100644 --- a/grc/iio_fmcomms2_sink.block.yml +++ b/grc/iio_fmcomms2_sink.block.yml @@ -1,6 +1,6 @@ id: iio_fmcomms2_sink label: FMComms2/3/4 Sink -flags: [ python ] +flags: [ python, throttle ] parameters: - id: uri diff --git a/grc/iio_fmcomms5_sink.block.yml b/grc/iio_fmcomms5_sink.block.yml index 2523df7..5ed100c 100644 --- a/grc/iio_fmcomms5_sink.block.yml +++ b/grc/iio_fmcomms5_sink.block.yml @@ -1,6 +1,6 @@ id: iio_fmcomms5_sink label: FMComms5 Sink -flags: [ python ] +flags: [ python, throttle ] parameters: - id: uri diff --git a/grc/iio_pluto_sink.block.yml b/grc/iio_pluto_sink.block.yml index c11f3cb..464598c 100644 --- a/grc/iio_pluto_sink.block.yml +++ b/grc/iio_pluto_sink.block.yml @@ -1,6 +1,6 @@ id: iio_pluto_sink label: PlutoSDR Sink -flags: [ python ] +flags: [ python, throttle ] parameters: - id: uri From 0eaba5bb256d7fb4818438155daaaeb496eb7c00 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 20 Feb 2020 16:38:58 -0800 Subject: [PATCH 09/20] Fix device source block messaging type during timeouts. System port which this port is connected to only accepts type long in 3.8+. This fixes issue #70. Signed-off-by: Travis F. Collins --- lib/device_source_impl.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/device_source_impl.cc b/lib/device_source_impl.cc index 0e7684c..1284547 100644 --- a/lib/device_source_impl.cc +++ b/lib/device_source_impl.cc @@ -348,11 +348,7 @@ namespace gr { * this block send itself a dummy message on its input * system message port, so that the scheduler calls us * again promptly. */ -#ifdef GR_VERSION_3_7_OR_LESS pmt::pmt_t payload = pmt::from_long(0); -#else - pmt::pmt_t payload = pmt::from_bool(false); -#endif pmt::pmt_t msg = pmt::cons(pmt::mp("done"), payload); post(pmt::mp("system"), msg); return 0; From 73153d539930cad0adcce72ad6cd53e866176286 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 20 Feb 2020 16:44:25 -0800 Subject: [PATCH 10/20] Remove extra parameters in FMComm2/3/4/5 block callbacks which caused runtime errors when properties were tuned. This was a typo introduced when migrated xml blocks to yml. Signed-off-by: Travis F. Collins --- grc/iio_fmcomms2_sink.block.yml | 2 +- grc/iio_fmcomms2_source.block.yml | 2 +- grc/iio_fmcomms5_sink.block.yml | 2 +- grc/iio_fmcomms5_source.block.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/grc/iio_fmcomms2_sink.block.yml b/grc/iio_fmcomms2_sink.block.yml index bfcd4de..4197f11 100644 --- a/grc/iio_fmcomms2_sink.block.yml +++ b/grc/iio_fmcomms2_sink.block.yml @@ -96,6 +96,6 @@ templates: imports: import iio make: iio.fmcomms2_sink_f32c(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${filter}, ${auto_filter}) callbacks: - - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${filter}, ${auto_filter}) + - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${filter}, ${auto_filter}) file_format: 1 diff --git a/grc/iio_fmcomms2_source.block.yml b/grc/iio_fmcomms2_source.block.yml index fc8ab4d..7a3559e 100644 --- a/grc/iio_fmcomms2_source.block.yml +++ b/grc/iio_fmcomms2_source.block.yml @@ -127,6 +127,6 @@ templates: imports: import iio make: iio.fmcomms2_source_f32c(${uri}, ${frequency}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${rf_port_select}, ${filter}, ${auto_filter}) callbacks: - - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${rf_port_select}, ${filter}, ${auto_filter}) + - set_params(${frequency}, ${samplerate}, ${bandwidth}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${rf_port_select}, ${filter}, ${auto_filter}) file_format: 1 diff --git a/grc/iio_fmcomms5_sink.block.yml b/grc/iio_fmcomms5_sink.block.yml index 5ed100c..7d00f3d 100644 --- a/grc/iio_fmcomms5_sink.block.yml +++ b/grc/iio_fmcomms5_sink.block.yml @@ -121,6 +121,6 @@ templates: imports: import iio make: iio.fmcomms5_sink_f32c(${uri}, ${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${tx3_en}, ${tx4_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${attenuation3}, ${attenuation4}, ${filter}) callbacks: - - set_params(${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${tx1_en}, ${tx2_en}, ${tx3_en}, ${tx4_en}, ${buffer_size}, ${cyclic}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${attenuation3}, ${attenuation4}) + - set_params(${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${rf_port_select}, ${attenuation1}, ${attenuation2}, ${attenuation3}, ${attenuation4}) file_format: 1 diff --git a/grc/iio_fmcomms5_source.block.yml b/grc/iio_fmcomms5_source.block.yml index a52fc0b..c12650d 100644 --- a/grc/iio_fmcomms5_source.block.yml +++ b/grc/iio_fmcomms5_source.block.yml @@ -168,6 +168,6 @@ templates: imports: import iio make: iio.fmcomms5_source_f32c(${uri}, ${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${rx3_en}, ${rx4_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${gain3}, ${manual_gain3}, ${gain4}, ${manual_gain4}, ${rf_port_select}, ${filter}) callbacks: - - set_params(${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${rx1_en}, ${rx2_en}, ${rx3_en}, ${rx4_en}, ${buffer_size}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${gain3}, ${manual_gain3}, ${gain4}, ${manual_gain4}, ${rf_port_select}) + - set_params(${frequency1}, ${frequency2}, ${samplerate}, ${bandwidth}, ${quadrature}, ${rfdc}, ${bbdc}, ${gain1}, ${manual_gain1}, ${gain2}, ${manual_gain2}, ${gain3}, ${manual_gain3}, ${gain4}, ${manual_gain4}, ${rf_port_select}) file_format: 1 From 469a3a38d5d66a2ba321c3477d2ee8d23f4ab09a Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Fri, 21 Feb 2020 17:52:03 -0800 Subject: [PATCH 11/20] Update cmake to handle gr3.8 and gr3.9 Due to the existence of the ubuntu ppa's, development builds of gnuradio are becoming more common with the version 3.9. This updates cmake to handle 3.8 and 3.9 with some minor changes for windows includes. Fixes #72 Signed-off-by: Travis F. Collins --- CMakeLists.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cd4e88..0ad5c2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,7 +120,14 @@ ENDIF() ######################################################################## # Find packages ######################################################################## -find_package(Gnuradio "3.8" REQUIRED) +set(GR_COMPONENTS blocks analog volk pmt filter fft) +find_package(Gnuradio "3.8" COMPONENTS ${GR_COMPONENTS}) +if(NOT Gnuradio_FOUND) + find_package(Gnuradio "3.9" COMPONENTS ${GR_COMPONENTS}) + if(NOT Gnuradio_FOUND) + message(FATAL_ERROR "Unable to find GNURadio") + endif(NOT Gnuradio_FOUND) +endif(NOT Gnuradio_FOUND) include(GrVersion) include(GrPlatform) #define LIB_SUFFIX >>>>>>> Update to 3.8 with new cmake requirements @@ -143,13 +150,9 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## # Find gnuradio build dependencies ######################################################################## - -# Search for GNU Radio and its components and versions. Add any -# components required to the list of GR_REQUIRED_COMPONENTS (in all -# caps such as FILTER or FFT) and change the version to the minimum -# API compatible version required. -find_package(Gnuradio COMPONENTS blocks analog volk pmt filter fft) -find_package(Gnuradio PATHS "c:/Program Files/gnuradio/lib/cmake/gnuradio" REQUIRED) +if(WIN32) + find_package(Gnuradio PATHS "c:/Program Files/gnuradio/lib/cmake/gnuradio" REQUIRED) +endif() find_library(IIO_LIBRARIES iio) find_path(IIO_INCLUDE_DIRS iio.h) From 39d8b143da60ed664fabc6b2b7b39ca9cbc9edc2 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Fri, 3 Apr 2020 10:09:10 -0700 Subject: [PATCH 12/20] Fix grc yml file install path Update new yml install path for 3.8+ Signed-off-by: Travis F. Collins --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ad5c2a..a8c1477 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}) set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d) set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) -set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) +set(GRC_BLOCKS_DIR ${GR_DATA_DIR}/gnuradio/grc/blocks) ######################################################################## # Find gnuradio build dependencies From 15ccadc126f5efaad32db012cc6ff7861c1e7e2a Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Mon, 26 Jul 2021 10:13:57 -0700 Subject: [PATCH 13/20] Fix merge conflict Signed-off-by: Travis F. Collins --- lib/attr_source_impl.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/attr_source_impl.cc b/lib/attr_source_impl.cc index 5633cb1..f46c400 100644 --- a/lib/attr_source_impl.cc +++ b/lib/attr_source_impl.cc @@ -26,8 +26,8 @@ #include #include "attr_source_impl.h" #include -#include -#include +#include +#include #include @@ -255,7 +255,7 @@ namespace gr { for (sample = 0; sample Date: Thu, 4 Jun 2020 10:15:35 +0300 Subject: [PATCH 14/20] CMakeLists.txt: Fix the .so/.dylib displayed version for gr-iio libs. The GR_LIBRARY_FOO function sets the target properties to LIBVER and VERSION which are not defined inside gr-iio. Those versions represent the GNURadio version (3.8.0). This leads to wrong library suffixes. Signed-off-by: AlexandraTrifan --- CMakeLists.txt | 3 +++ lib/CMakeLists.txt | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8c1477..5e1e441 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,10 @@ set(VERSION_INFO_MAJOR_VERSION 0) set(VERSION_INFO_API_COMPAT 0) set(VERSION_INFO_MINOR_VERSION 3) set(VERSION_INFO_MAINT_VERSION git) +set(GR_IIO_VERSION_MAJOR ${VERSION_INFO_MAJOR_VERSION}) +set(GR_IIO_VERSION_MINOR ${VERSION_INFO_MINOR_VERSION}) set(VERSION_INFO_VERSION ${GR_IIO_VERSION_MAJOR}.${GR_IIO_VERSION_MINOR}) +set(GR_IIO_VERSION ${VERSION_INFO_VERSION}) # Install to PyBOMBS target prefix if defined if(DEFINED ENV{PYBOMBS_PREFIX}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 7b66d6d..b34ca46 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -76,11 +76,6 @@ target_include_directories(gnuradio-iio PUBLIC $ PUBLIC $ ) -set_target_properties(gnuradio-iio PROPERTIES - VERSION ${GR_IIO_VERSION} - SOVERSION ${GR_IIO_VERSION_MAJOR} - DEFINE_SYMBOL "gnuradio_iio_EXPORTS" -) if(APPLE) set_target_properties(gnuradio-iio PROPERTIES @@ -93,3 +88,9 @@ endif(APPLE) ######################################################################## include(GrMiscUtils) GR_LIBRARY_FOO(gnuradio-iio) + +set_target_properties(gnuradio-iio PROPERTIES + VERSION ${GR_IIO_VERSION} + SOVERSION ${GR_IIO_VERSION_MAJOR} + DEFINE_SYMBOL "gnuradio_iio_EXPORTS" +) From 16d776b8d3208815433252d3b108658823fc8157 Mon Sep 17 00:00:00 2001 From: 7m4mon <7m4mon@gmail.com> Date: Sun, 1 Nov 2020 20:46:43 +0900 Subject: [PATCH 15/20] Changed block's category "Core" to "Industrial IO". --- grc/iio.tree.yml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/grc/iio.tree.yml b/grc/iio.tree.yml index 05171d2..7bb6dbb 100644 --- a/grc/iio.tree.yml +++ b/grc/iio.tree.yml @@ -1,16 +1,15 @@ -'[Core]': -- 'Industrial I/O': - - 'Generic': - - iio_device_source - - iio_device_sink - - iio_attr_source - - iio_attr_sink - - iio_attr_updater - - 'FMComms': - - iio_fmcomms2_source - - iio_fmcomms2_sink - - iio_fmcomms5_source - - iio_fmcomms5_sink - - 'PlutoSDR': - - iio_pluto_source - - iio_pluto_sink +'[Industrial IO]': +- 'Generic': + - iio_device_source + - iio_device_sink + - iio_attr_source + - iio_attr_sink + - iio_attr_updater +- 'FMComms': + - iio_fmcomms2_source + - iio_fmcomms2_sink + - iio_fmcomms5_source + - iio_fmcomms5_sink +- 'PlutoSDR': + - iio_pluto_source + - iio_pluto_sink From b5faadee723595c6ff32785689e15bb83bafd0d8 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Mon, 26 Jul 2021 10:14:58 -0700 Subject: [PATCH 16/20] Update azure to use gr-3.8 Signed-off-by: Travis F. Collins --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 00db5fc..3713697 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,12 +5,12 @@ jobs: - job: LinuxBuilds # Host Box pool: - vmImage: 'ubuntu-18.04' + vmImage: 'ubuntu-20.04' # Docker Images strategy: matrix: ubuntu18: - image: tfcollins/test-ubuntu:18.04 + image: tfcollins/test-ubuntu:20.04 container: $[ variables['image'] ] steps: - script: | From 123feac6b0409283ed39c11559109e48f7c7b208 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Mon, 26 Jul 2021 10:25:51 -0700 Subject: [PATCH 17/20] Fix incomplete merge Signed-off-by: Travis F. Collins --- CMakeLists.txt | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e1e441..e98b757 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,43 +63,6 @@ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR add_definitions(-fvisibility=hidden) endif() -<<<<<<< HEAD -######################################################################## -# Find boost -######################################################################## -if(UNIX AND EXISTS "/usr/lib64") - list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix -endif(UNIX AND EXISTS "/usr/lib64") -set(Boost_ADDITIONAL_VERSIONS - "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" - "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" - "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" - "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" - "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" - "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" - "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" -) - -set(BOOST_REQUIRED_COMPONENTS filesystem system thread date_time chrono) - -if(MSVC) - if (NOT DEFINED BOOST_ALL_DYN_LINK) - set(BOOST_ALL_DYN_LINK TRUE) - endif() - set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking") - if(BOOST_ALL_DYN_LINK) - add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc - else(BOOST_ALL_DYN_LINK) - unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link - endif(BOOST_ALL_DYN_LINK) -endif(MSVC) - -find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) - -if(NOT Boost_FOUND) - message(FATAL_ERROR "Boost required to compile iio") -endif() -======= IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") SET(CMAKE_CXX_STANDARD 11) ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -126,14 +89,10 @@ ENDIF() set(GR_COMPONENTS blocks analog volk pmt filter fft) find_package(Gnuradio "3.8" COMPONENTS ${GR_COMPONENTS}) if(NOT Gnuradio_FOUND) - find_package(Gnuradio "3.9" COMPONENTS ${GR_COMPONENTS}) - if(NOT Gnuradio_FOUND) - message(FATAL_ERROR "Unable to find GNURadio") - endif(NOT Gnuradio_FOUND) + message(FATAL_ERROR "Unable to find GNURadio") endif(NOT Gnuradio_FOUND) include(GrVersion) include(GrPlatform) #define LIB_SUFFIX ->>>>>>> Update to 3.8 with new cmake requirements ######################################################################## # Install directories From b5a0521ca4f448627ce01d8b6ce8a03f6e0980bb Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Mon, 26 Jul 2021 10:32:20 -0700 Subject: [PATCH 18/20] Make failures stop build Signed-off-by: Travis F. Collins --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3713697..ea3a28a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,11 +16,12 @@ jobs: - script: | sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y git cmake doxygen graphviz libaio-dev libusb-1.0-0-dev libserialport-dev libavahi-client-dev rpm tar bzip2 gzip + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libxml2 libxml2-dev bison flex libboost-all-dev + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgmp-dev swig gnuradio gnuradio-dev displayName: "Setup Ubuntu" condition: contains(variables['image'], 'ubuntu') - script: | - sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libxml2 libxml2-dev bison flex libboost-all-dev git clone https://github.com/analogdevicesinc/libiio.git cd libiio mkdir build && cd build @@ -45,12 +46,12 @@ jobs: displayName: Install libad9361-iio - script: | - sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgmp-dev swig gnuradio gnuradio-dev mkdir build && cd build cmake .. make cd .. displayName: Build + failOnStderr: 'true' ########################################################### # Deploy From 3d88d3756d44488af056953ea44105876618f61a Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Mon, 26 Jul 2021 10:54:00 -0700 Subject: [PATCH 19/20] Make failures stop build Signed-off-by: Travis F. Collins --- azure-pipelines.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ea3a28a..4307ba7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ jobs: sudo DEBIAN_FRONTEND=noninteractive apt-get -qq update sudo DEBIAN_FRONTEND=noninteractive apt-get install -y git cmake doxygen graphviz libaio-dev libusb-1.0-0-dev libserialport-dev libavahi-client-dev rpm tar bzip2 gzip sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libxml2 libxml2-dev bison flex libboost-all-dev - sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgmp-dev swig gnuradio gnuradio-dev + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgmp-dev swig liborc-dev gnuradio gnuradio-dev displayName: "Setup Ubuntu" condition: contains(variables['image'], 'ubuntu') @@ -49,9 +49,8 @@ jobs: mkdir build && cd build cmake .. make - cd .. + exit $? displayName: Build - failOnStderr: 'true' ########################################################### # Deploy From 13a37a5d0550ee15ae219f0fd341d12a13556777 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Tue, 27 Jul 2021 11:28:43 -0700 Subject: [PATCH 20/20] Update README to discuss separate branches Signed-off-by: Travis F. Collins --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index ce420da..792cdd9 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,12 @@ IIO blocks for GNU Radio ## Documentaion [GNU Radio IIO Blocks](https://wiki.analog.com/resources/tools-software/linux-software/gnuradio) + +## Branches + +This repository supports different versions of GNU Radio by utilizing separate branches. + +- **maint-3.7** supports GNU Radio 3.7 +- **master** supports GNU Radio 3.8 +- GNU Radio 3.9 is **not** supported yet +- gr-iio is supported within upstream GNU Radio 3.10 \ No newline at end of file