Skip to content

Commit b3d4267

Browse files
authored
Merge pull request #1 from gnuradio/master
Downstream
2 parents 57cf0f9 + 27dd99e commit b3d4267

File tree

247 files changed

+16370
-48021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+16370
-48021
lines changed

CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ set(CLANG_MIN_VERSION "3.4.0")
6565
set(APPLECLANG_MIN_VERSION "500")
6666
set(MSVC_MIN_VERSION "1800")
6767

68+
# Enable generation of compile_commands.json for code completion engines
69+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
70+
6871
########################################################################
6972
# Configure CMake policies
7073
########################################################################
@@ -146,7 +149,7 @@ ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
146149
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
147150
SET(CMAKE_CXX_STANDARD 11)
148151
ELSE()
149-
message(warning "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
152+
message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
150153
ENDIF()
151154

152155
IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
@@ -156,7 +159,7 @@ ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang")
156159
ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
157160
SET(CMAKE_C_STANDARD 11)
158161
ELSE()
159-
message(warning "C standard could not be set because compiler is not GNU, Clang or MSVC.")
162+
message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.")
160163
ENDIF()
161164

162165
########################################################################

CODE_OF_CONDUCT.md

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
This Code of Conduct is also available [here on the GNU Radio
4+
wiki](https://wiki.gnuradio.org/index.php/Code_of_Conduct).
5+
6+
## Our Pledge
7+
8+
In the interest of fostering an open and welcoming environment, we as
9+
contributors and maintainers pledge to making participation in our project and
10+
our community a harassment-free experience for everyone, regardless of age, body
11+
size, disability, ethnicity, sex characteristics, gender identity and expression,
12+
level of experience, education, socio-economic status, nationality, personal
13+
appearance, race, religion, or sexual identity and orientation.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to creating a positive environment
18+
include:
19+
20+
* Using welcoming and inclusive language
21+
* Being respectful of differing viewpoints and experiences
22+
* Gracefully accepting constructive criticism
23+
* Focusing on what is best for the community
24+
* Showing empathy towards other community members
25+
26+
Examples of unacceptable behavior by participants include:
27+
28+
* The use of sexualized language or imagery and unwelcome sexual attention or
29+
advances
30+
* Trolling, insulting/derogatory comments, and personal or political attacks
31+
* Public or private harassment
32+
* Publishing others' private information, such as a physical or electronic
33+
address, without explicit permission
34+
* Other conduct which could reasonably be considered inappropriate in a
35+
professional setting
36+
37+
## Our Responsibilities
38+
39+
Project maintainers are responsible for clarifying the standards of acceptable
40+
behavior and are expected to take appropriate and fair corrective action in
41+
response to any instances of unacceptable behavior.
42+
43+
Project maintainers have the right and responsibility to remove, edit, or
44+
reject comments, commits, code, wiki edits, issues, and other contributions
45+
that are not aligned to this Code of Conduct, or to ban temporarily or
46+
permanently any contributor for other behaviors that they deem inappropriate,
47+
threatening, offensive, or harmful.
48+
49+
## Scope
50+
51+
This Code of Conduct applies within all project spaces, and it also applies when
52+
an individual is representing the project or its community in public spaces.
53+
Examples of representing a project or community include using an official
54+
project e-mail address, posting via an official social media account, or acting
55+
as an appointed representative at an online or offline event. Representation of
56+
a project may be further defined and clarified by project maintainers.
57+
58+
## Enforcement
59+
60+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
61+
reported by contacting the project team at [email protected]. All
62+
complaints will be reviewed and investigated and will result in a response that
63+
is deemed necessary and appropriate to the circumstances. The project team is
64+
obligated to maintain confidentiality with regard to the reporter of an incident.
65+
Further details of specific enforcement policies may be posted separately.
66+
67+
Project maintainers who do not follow or enforce the Code of Conduct in good
68+
faith may face temporary or permanent repercussions as determined by other
69+
members of the project's leadership.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
74+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
75+
76+
[homepage]: https://www.contributor-covenant.org
77+
78+
For answers to common questions about this code of conduct, see
79+
https://www.contributor-covenant.org/faq
80+

cmake/Modules/FindTHRIFT.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ endif(THRIFT_VERSION VERSION_LESS THRIFT_REQ_VERSION)
6565
IF (CMAKE_CROSSCOMPILING)
6666
SET(PYTHON_THRIFT_FOUND TRUE)
6767
ELSE (CMAKE_CROSSCOMPILING)
68-
include(GrPython)
6968
GR_PYTHON_CHECK_MODULE("Thrift" thrift "1" PYTHON_THRIFT_FOUND)
7069
ENDIF (CMAKE_CROSSCOMPILING)
7170

cmake/Modules/GnuradioConfig.cmake.in

+44-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2013 Free Software Foundation, Inc.
1+
# Copyright 2013, 2019 Free Software Foundation, Inc.
22
#
33
# This file is part of GNU Radio
44
#
@@ -22,10 +22,6 @@ include(CMakeFindDependencyMacro)
2222
# Allows us to use all .cmake files in this directory
2323
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}")
2424

25-
# Easily access all libraries and includes of GNU Radio
26-
set(GNURADIO_ALL_LIBRARIES "")
27-
set(GNURADIO_ALL_INCLUDE_DIRS "")
28-
2925
find_dependency(LOG4CPP)
3026
find_dependency(MPLIB)
3127
find_dependency(Boost "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMINOR_VERSION@" COMPONENTS
@@ -38,15 +34,54 @@ find_dependency(Boost "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMIN
3834
unit_test_framework
3935
)
4036
find_dependency(Volk)
37+
set(ENABLE_PYTHON @ENABLE_PYTHON@ CACHE BOOL "Enable Python & SWIG")
38+
if(${ENABLE_PYTHON})
39+
set(PYTHON_EXECUTABLE @PYTHON_EXECUTABLE@)
40+
set(GR_PYTHON_DIR @GR_PYTHON_DIR@)
41+
include(GrPython)
42+
endif()
4143

42-
include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-pmtTargets.cmake")
43-
include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-runtimeTargets.cmake")
44+
include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-pmtConfig.cmake")
45+
include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-runtimeConfig.cmake")
4446
cmake_policy(SET CMP0012 NEW)
4547
cmake_policy(SET CMP0057 NEW)
46-
if(@ENABLE_PYTHON@)
47-
include("${CMAKE_CURRENT_LIST_DIR}/runtime_swigTargets.cmake")
48+
49+
#Can't use Python if GNU Radio was built without support for it
50+
if(${ENABLE_PYTHON})
51+
include("${CMAKE_CURRENT_LIST_DIR}/runtime_swigTargets.cmake")
4852
endif()
4953

54+
# Propagate the enabledness of GRC:
55+
# Since GRC doesn't contain proper CMake targets (yet?), we need to do this
56+
# manually
57+
set(ENABLE_GRC @ENABLE_GRC@ CACHE BOOL "Enable GRC features (export block YAML)")
58+
if(@ENABLE_GRC@)
59+
set(GRC_BLOCKS_DIR "@GRC_BLOCKS_DIR@")
60+
endif()
61+
# Same for a few "special" features.
62+
set(GR_PERFORMANCE_COUNTERS @GR_PERFORMANCE_COUNTERS@)
63+
set(GR_CTRLPORT @GR_CTRLPORT@)
64+
set(GR_RPCSERVER_ENABLED @GR_RPCSERVER_ENABLED@)
65+
set(ENABLE_CTRLPORT_THRIFT @ENABLE_CTRLPORT_THRIFT@)
66+
set(GR_RPCSERVER_THRIFT @GR_RPCSERVER_THRIFT@)
67+
68+
# Propagate global options
69+
set(GR_RUNTIME_DIR "@GR_RUNTIME_DIR@")
70+
set(GR_LIBRARY_DIR "@GR_LIBRARY_DIR@")
71+
set(GR_DATA_DIR "@GR_DATA_DIR@")
72+
set(GR_PKG_DATA_DIR "@GR_PKG_DATA_DIR@")
73+
set(GR_DOC_DIR "@GR_DOC_DIR@")
74+
set(GR_PKG_DOC_DIR "@GR_PKG_DOC_DIR@")
75+
set(GR_LIBEXEC_DIR "@GR_LIBEXEC_DIR@")
76+
set(GR_PKG_LIBEXEC_DIR "@GR_PKG_LIBEXEC_DIR@")
77+
set(GR_THEMES_DIR "@GR_THEMES_DIR@")
78+
set(GR_CONF_DIR "@GR_CONF_DIR@")
79+
set(SYSCONFDIR "@SYSCONFDIR@")
80+
set(GR_PREFSDIR "@GR_PREFSDIR@")
81+
82+
83+
# We check the requested components in the order given by the list below –
84+
# ordering matters; we have module interdependencies.
5085
set(GR_COMPONENTS
5186
blocks
5287
fec

cmake/Modules/GrMiscUtils.cmake

+6-37
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,11 @@ macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
5353
include(CheckCXXCompilerFlag)
5454
CHECK_CXX_COMPILER_FLAG(${flag} ${have})
5555
if(${have})
56-
if(${CMAKE_VERSION} VERSION_GREATER "2.8.4")
57-
STRING(FIND "${CMAKE_CXX_FLAGS}" "${flag}" flag_dup)
58-
if(${flag_dup} EQUAL -1)
59-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
60-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
61-
endif(${flag_dup} EQUAL -1)
62-
endif(${CMAKE_VERSION} VERSION_GREATER "2.8.4")
56+
STRING(FIND "${CMAKE_CXX_FLAGS}" "${flag}" flag_dup)
57+
if(${flag_dup} EQUAL -1)
58+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
59+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
60+
endif(${flag_dup} EQUAL -1)
6361
endif(${have})
6462
endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
6563

@@ -72,6 +70,7 @@ endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
7270
function(GR_LIBRARY_FOO target)
7371
#set additional target properties
7472
set_target_properties(${target} PROPERTIES SOVERSION ${LIBVER})
73+
set_target_properties(${target} PROPERTIES VERSION ${VERSION})
7574

7675
#install the generated files like so...
7776
install(TARGETS ${target}
@@ -102,36 +101,6 @@ function(GR_LIBRARY_FOO target)
102101
DESTINATION ${GR_CMAKE_DIR}
103102
)
104103

105-
#extras mode enabled automatically on linux
106-
if(NOT DEFINED LIBRARY_EXTRAS)
107-
set(LIBRARY_EXTRAS ${LINUX})
108-
endif()
109-
110-
#special extras mode to enable alternative naming conventions
111-
if(LIBRARY_EXTRAS)
112-
113-
#give the library a special name with ultra-zero soversion
114-
set_target_properties(${target} PROPERTIES OUTPUT_NAME ${target}-${LIBVER} SOVERSION "0.0.0")
115-
set(target_name lib${target}-${LIBVER}.so.0.0.0)
116-
117-
#custom command to generate symlinks
118-
add_custom_command(
119-
TARGET ${target}
120-
POST_BUILD
121-
COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so
122-
COMMAND ${CMAKE_COMMAND} -E create_symlink ${target_name} ${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0
123-
COMMAND ${CMAKE_COMMAND} -E touch ${target_name} #so the symlinks point to something valid so cmake 2.6 will install
124-
)
125-
126-
#and install the extra symlinks
127-
install(
128-
FILES
129-
${CMAKE_CURRENT_BINARY_DIR}/lib${target}.so
130-
${CMAKE_CURRENT_BINARY_DIR}/lib${target}-${LIBVER}.so.0
131-
DESTINATION ${GR_LIBRARY_DIR}
132-
)
133-
134-
endif(LIBRARY_EXTRAS)
135104
endfunction(GR_LIBRARY_FOO)
136105

137106
########################################################################

cmake/Modules/GrVersion.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ else()
8585
# LIBVER: 3.3.1{.x}
8686
set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}.${MAINT_VERSION}")
8787
set(DOCVER "${VERSION}")
88-
set(LIBVER "${VERSION}")
88+
set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}")
8989
set(RC_MINOR_VERSION ${MINOR_VERSION})
9090
set(RC_MAINT_VERSION ${MAINT_VERSION})
9191
endif()

cmake/Modules/UseSWIG.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
434434
MAIN_DEPENDENCY "${swig_source_file_fullname}"
435435
DEPENDS ${swig_dependencies}
436436
IMPLICIT_DEPENDS CXX "${swig_source_file_fullname}"
437-
COMMENT "Swig source"
437+
COMMENT "Swig source ${infile}"
438438
COMMAND_EXPAND_LISTS)
439439
set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files}
440440
PROPERTIES GENERATED 1)

docs/sphinx/source/analog_blocks.rst

+1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ gnuradio.analog
3737
.. autoblock:: gnuradio.analog.sig_source_f
3838
.. autoblock:: gnuradio.analog.sig_source_i
3939
.. autoblock:: gnuradio.analog.sig_source_s
40+
.. autoblock:: gnuradio.analog.sig_source_b
4041
.. autoblock:: gnuradio.analog.simple_squelch_cc

docs/sphinx/source/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ Waveform Generator Blocks
11351135
gnuradio.analog.sig_source_f
11361136
gnuradio.analog.sig_source_i
11371137
gnuradio.analog.sig_source_s
1138+
gnuradio.analog.sig_source_b
11381139

11391140

11401141
ZeroMQ Interface Blocks

gnuradio-runtime/include/gnuradio/fxpt_nco.h

+18
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@ namespace gr {
113113
step ();
114114
}
115115
}
116+
117+
// compute sin for a block of phase angles
118+
void sin(std::int8_t *output, int noutput_items, double ampl=1.0)
119+
{
120+
for(int i = 0; i < noutput_items; i++) {
121+
output[i] = (std::int8_t)(gr::fxpt::sin(d_phase) * ampl);
122+
step();
123+
}
124+
}
125+
126+
// compute cos for a block of phase angles
127+
void cos(std::int8_t *output, int noutput_items, double ampl=1.0)
128+
{
129+
for(int i = 0; i < noutput_items; i++) {
130+
output[i] = (std::int8_t)(gr::fxpt::cos(d_phase) * ampl);
131+
step();
132+
}
133+
}
116134

117135
// compute sin for a block of phase angles
118136
void sin(short *output, int noutput_items, double ampl=1.0)

gnuradio-runtime/include/gnuradio/rpcregisterhelpers.h

+25
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,31 @@ class rpcbasic_inserter<T,std::vector< int > >
494494
}
495495
};
496496

497+
/*!
498+
* \brief Specialized inserter class for vectors of int64_t data.
499+
*/
500+
template<typename T>
501+
class rpcbasic_inserter<T,std::vector< int64_t > >
502+
: public virtual rpcinserter_base<T,std::vector< int64_t > >
503+
{
504+
public:
505+
rpcbasic_inserter(T* source, std::vector<int64_t > (T::*func)() const)
506+
: rpcinserter_base<T,std::vector<int64_t > >(source, func)
507+
{;}
508+
509+
rpcbasic_inserter(T* source, std::vector<int64_t > (T::*func)())
510+
: rpcinserter_base<T,std::vector<int64_t > >(source, func)
511+
{;}
512+
513+
pmt::pmt_t retrieve()
514+
{
515+
std::vector< int64_t >
516+
vec((rpcinserter_base<T,std::vector<int64_t > >::
517+
_source->*rpcinserter_base<T,std::vector< int64_t > >::_func)());
518+
return pmt::init_s64vector(vec.size(), &vec[0]);
519+
}
520+
};
521+
497522
/*!
498523
* \brief Specialized inserter class for vectors of complex (float) data.
499524
*/

0 commit comments

Comments
 (0)