gr3.8 build
This commit is contained in:
parent
de370340cf
commit
d90ecd7c89
|
@ -4,6 +4,24 @@ project(gr-op25 CXX C)
|
|||
set(CMAKE_BUILD_TYPE Debug)
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11")
|
||||
|
||||
execute_process(COMMAND python3 -c "
|
||||
import os
|
||||
import sys
|
||||
from distutils import sysconfig
|
||||
pfx = '/usr/local'
|
||||
m1 = os.path.join('lib', 'python' + sys.version[:3], 'dist-packages')
|
||||
m2 = sysconfig.get_python_lib(plat_specific=True, prefix='')
|
||||
f1 = os.path.join(pfx, m1)
|
||||
f2 = os.path.join(pfx, m2)
|
||||
ok2 = f2 in sys.path
|
||||
if ok2:
|
||||
print(m2)
|
||||
else:
|
||||
print(m1)
|
||||
" OUTPUT_VARIABLE OP25_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
MESSAGE(STATUS "OP25_PYTHON_DIR has been set to \"${OP25_PYTHON_DIR}\".")
|
||||
|
||||
add_subdirectory(op25/gr-op25)
|
||||
add_subdirectory(op25/gr-op25_repeater)
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
As of this writing (Sept. 2022) OP25 builds for python3 and GNU Radio 3.8.
|
||||
|
||||
The full list of supported versions is as follows:
|
||||
|
||||
PYTHON 2 AND GNU RADIO 3.7
|
||||
==========================
|
||||
It should still be possible to use the file gr3.8.patch (in reverse) to
|
||||
downgrade the source tree to build against Python 2 and GNU Radio 3.7,
|
||||
although this has not been tested.
|
||||
$ cat gr3.8.patch | patch -p1 -R
|
||||
Once this has been done, proceed by running the install.sh script.
|
||||
|
||||
PYTHON 3 AND GNU RADIO 3.8
|
||||
==========================
|
||||
It is no longer necessary to apply the gr3.8 patch to the op25 source tree,
|
||||
as Python3/GNU Radio 3.8 is now the default. You can proceed directly to
|
||||
running the install.sh script.
|
||||
|
||||
PYTHON 3 AND GNU RADIO 3.9 / 3.10
|
||||
=================================
|
||||
It is no longer necessary to apply the gr3.8 patch to the op25 source tree,
|
||||
See the file README-gr3.9 for procedures for both GNU Radio 3.9 and 3.10.
|
|
@ -1,22 +1,10 @@
|
|||
|
||||
Feb. 2020
|
||||
Updated Sept. 2022
|
||||
|
||||
By default, OP25 builds for python2 and gnuradio3.7.
|
||||
|
||||
Rather than branching the repo source tree and until such time as
|
||||
gnuradio3.8 should become standard, it was decided to distribute
|
||||
the necessary mods to build OP25 for gnuradio3.8 / python3 in
|
||||
the form of a patch (in file gr3.8.patch).
|
||||
|
||||
To apply
|
||||
# first, if necessary "sudo make uninstall" from your build dir
|
||||
# (if op25 already installed)
|
||||
# then, cd to the top level op25 directory
|
||||
cat gr3.8.patch | patch -p1
|
||||
# finally, run "install.sh" as usual
|
||||
|
||||
NOTE: This patch only affects the cmake (build) process; the
|
||||
python apps (.py files) have been rewritten to be compatible with
|
||||
either version (2 or 3) of python. It's possible there may be
|
||||
leftover bugs from that process - please report if so.
|
||||
By default, OP25 now builds for Python3 and GNU Radio3.8.
|
||||
Accordingly, it is no longer necessary to apply the op25 patch
|
||||
for gr3.8.
|
||||
|
||||
It should be possible to use the gr3.8.patch in reverse to downgrade
|
||||
the source tree to build for Python 2 and GNU Radio 3.7. See the
|
||||
file README in this directory for details.
|
||||
|
|
|
@ -9,8 +9,7 @@ Installation
|
|||
cd ...path-to-existing/op25/build
|
||||
sudo make uninstall
|
||||
|
||||
1. Apply the patch for gr3.8 as described in file README-gr3.8.patch
|
||||
in this directory.
|
||||
1. Step 1 is removed.
|
||||
|
||||
2. Run the command
|
||||
./install-gr3.9.sh
|
||||
|
|
|
@ -10,9 +10,12 @@ if [ ! -d op25/gr-op25 ]; then
|
|||
exit
|
||||
fi
|
||||
|
||||
sudo sed -i -- 's/^# *deb-src/deb-src/' /etc/apt/sources.list
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get build-dep gnuradio
|
||||
sudo apt-get install gnuradio gnuradio-dev gr-osmosdr librtlsdr-dev libuhd-dev libhackrf-dev libitpp-dev libpcap-dev cmake git swig build-essential pkg-config doxygen python-numpy python-waitress python-requests
|
||||
sudo apt-get install gnuradio gnuradio-dev gr-osmosdr librtlsdr-dev libuhd-dev libhackrf-dev libitpp-dev libpcap-dev cmake git swig build-essential pkg-config doxygen python3-numpy python3-waitress python3-requests
|
||||
sudo apt-get install liborc-dev
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
|
|
@ -68,6 +68,9 @@ endif()
|
|||
########################################################################
|
||||
find_package(CppUnit)
|
||||
|
||||
set(ENABLE_PYTHON "TRUE" CACHE BOOL "enable python")
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
|
||||
# To run a more advanced search for GNU Radio and it's components and
|
||||
# versions, use the following. Add any components required to the list
|
||||
# of GR_REQUIRED_COMPONENTS (in all caps) and change "version" to the
|
||||
|
@ -76,11 +79,12 @@ find_package(CppUnit)
|
|||
# set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS FILTER ...)
|
||||
# find_package(Gnuradio "version")
|
||||
set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS FILTER PMT)
|
||||
find_package(Gnuradio)
|
||||
|
||||
if(NOT GNURADIO_RUNTIME_FOUND)
|
||||
message(FATAL_ERROR "GnuRadio Runtime required to compile op25")
|
||||
SET(MIN_GR_VERSION "3.8.0")
|
||||
find_package(Gnuradio REQUIRED)
|
||||
if("${Gnuradio_VERSION}" VERSION_LESS MIN_GR_VERSION)
|
||||
MESSAGE(FATAL_ERROR "GnuRadio version required: >=\"" ${MIN_GR_VERSION} "\" found: \"" ${Gnuradio_VERSION} "\"")
|
||||
endif()
|
||||
|
||||
if(NOT CPPUNIT_FOUND)
|
||||
message(FATAL_ERROR "CppUnit required to compile op25")
|
||||
endif()
|
||||
|
|
|
@ -63,7 +63,7 @@ list(APPEND op25_sources
|
|||
)
|
||||
|
||||
add_library(gnuradio-op25 SHARED ${op25_sources})
|
||||
target_link_libraries(gnuradio-op25 ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} itpp pcap)
|
||||
target_link_libraries(gnuradio-op25 ${Boost_LIBRARIES} gnuradio::gnuradio-runtime itpp pcap)
|
||||
set_target_properties(gnuradio-op25 PROPERTIES DEFINE_SYMBOL "gnuradio_op25_EXPORTS")
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -31,7 +31,7 @@ endif()
|
|||
GR_PYTHON_INSTALL(
|
||||
FILES
|
||||
__init__.py
|
||||
DESTINATION ${GR_PYTHON_DIR}/op25
|
||||
DESTINATION ${OP25_PYTHON_DIR}/op25
|
||||
)
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
# Include swig generation macros
|
||||
########################################################################
|
||||
find_package(SWIG)
|
||||
find_package(PythonLibs 2)
|
||||
find_package(PythonLibs 3)
|
||||
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
@ -31,9 +31,7 @@ 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 $<TARGET_PROPERTY:gnuradio::runtime_swig,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
|
||||
set(GR_SWIG_LIBRARIES gnuradio-op25)
|
||||
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/op25_swig_doc.i)
|
||||
|
@ -44,7 +42,7 @@ GR_SWIG_MAKE(op25_swig op25_swig.i)
|
|||
########################################################################
|
||||
# Install the build swig module
|
||||
########################################################################
|
||||
GR_SWIG_INSTALL(TARGETS op25_swig DESTINATION ${GR_PYTHON_DIR}/op25)
|
||||
GR_SWIG_INSTALL(TARGETS op25_swig DESTINATION ${OP25_PYTHON_DIR}/op25)
|
||||
|
||||
########################################################################
|
||||
# Install swig .i files for development
|
||||
|
|
|
@ -68,6 +68,9 @@ endif()
|
|||
########################################################################
|
||||
find_package(CppUnit)
|
||||
|
||||
set(ENABLE_PYTHON "TRUE" CACHE BOOL "enable python")
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
|
||||
# To run a more advanced search for GNU Radio and it's components and
|
||||
# versions, use the following. Add any components required to the list
|
||||
# of GR_REQUIRED_COMPONENTS (in all caps) and change "version" to the
|
||||
|
@ -75,11 +78,12 @@ find_package(CppUnit)
|
|||
#
|
||||
set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS FILTER PMT)
|
||||
# find_package(Gnuradio "version")
|
||||
find_package(Gnuradio)
|
||||
|
||||
if(NOT GNURADIO_RUNTIME_FOUND)
|
||||
message(FATAL_ERROR "GnuRadio Runtime required to compile op25_repeater")
|
||||
set(MIN_GR_VERSION "3.8.0")
|
||||
find_package(Gnuradio REQUIRED)
|
||||
if("${Gnuradio_VERSION}" VERSION_LESS MIN_GR_VERSION)
|
||||
MESSAGE(FATAL_ERROR "GnuRadio version required: >=\"" ${MIN_GR_VERSION} "\" found: \"" ${Gnuradio_VERSION} "\"")
|
||||
endif()
|
||||
|
||||
if(NOT CPPUNIT_FOUND)
|
||||
message(FATAL_ERROR "CppUnit required to compile op25_repeater")
|
||||
endif()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2017, 2018 Graham Norbury
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2017, 2018, 2019, 2020 Max H. Parke KA1RBI
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Max H. Parke KA1RBI
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2008-2011 Steve Glass
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2017, 2018 Graham Norbury
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright 2008-2011 Steve Glass
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
#################################################################################
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/python
|
||||
#! /usr/bin/python3
|
||||
|
||||
from p25craft import make_fakecc_tsdu
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
#################################################################################
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright 2005,2006,2007 Free Software Foundation, Inc.
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/python3
|
||||
#
|
||||
# p25craft.py - utility for crafting APCO P25 packets
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
from gnuradio import gr, audio, eng_notation, blocks
|
||||
from gnuradio.eng_option import eng_option
|
||||
from optparse import OptionParser
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import math
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
#
|
||||
# (C) Copyright 2010, 2014 Max H. Parke, KA1RBI
|
||||
|
|
|
@ -68,7 +68,7 @@ else(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|||
find_library(GR_FILTER_LIBRARY libgnuradio-filter.so )
|
||||
endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(GR_FILTER_LIBRARIES ${GR_FILTER_LIBRARY})
|
||||
target_link_libraries(gnuradio-op25_repeater ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GR_FILTER_LIBRARIES} imbe_vocoder)
|
||||
target_link_libraries(gnuradio-op25_repeater ${Boost_LIBRARIES} gnuradio::gnuradio-runtime ${GR_FILTER_LIBRARIES} imbe_vocoder)
|
||||
set_target_properties(gnuradio-op25_repeater PROPERTIES DEFINE_SYMBOL "gnuradio_op25_repeater_EXPORTS")
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -31,7 +31,7 @@ endif()
|
|||
GR_PYTHON_INSTALL(
|
||||
FILES
|
||||
__init__.py
|
||||
DESTINATION ${GR_PYTHON_DIR}/op25_repeater
|
||||
DESTINATION ${OP25_PYTHON_DIR}/op25_repeater
|
||||
)
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
# Include swig generation macros
|
||||
########################################################################
|
||||
find_package(SWIG)
|
||||
find_package(PythonLibs 2)
|
||||
find_package(PythonLibs 3)
|
||||
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
@ -31,9 +31,7 @@ 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 $<TARGET_PROPERTY:gnuradio::runtime_swig,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
|
||||
set(GR_SWIG_LIBRARIES gnuradio-op25_repeater)
|
||||
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/op25_repeater_swig_doc.i)
|
||||
|
@ -44,7 +42,7 @@ GR_SWIG_MAKE(op25_repeater_swig op25_repeater_swig.i)
|
|||
########################################################################
|
||||
# Install the build swig module
|
||||
########################################################################
|
||||
GR_SWIG_INSTALL(TARGETS op25_repeater_swig DESTINATION ${GR_PYTHON_DIR}/op25_repeater)
|
||||
GR_SWIG_INSTALL(TARGETS op25_repeater_swig DESTINATION ${OP25_PYTHON_DIR}/op25_repeater)
|
||||
|
||||
########################################################################
|
||||
# Install swig .i files for development
|
||||
|
|
Loading…
Reference in New Issue