summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Modules/GrSwig.cmake41
-rw-r--r--docs/doxygen/other/build_guide.dox12
-rw-r--r--gnuradio-runtime/swig/gr_types.i20
-rw-r--r--gr-blocks/include/gnuradio/blocks/tagged_stream_align.h4
-rw-r--r--gr-digital/lib/mpsk_snr_est.cc1
-rw-r--r--gr-digital/lib/ofdm_chanest_vcvc_impl.cc2
-rw-r--r--gr-digital/lib/pn_correlator_cc_impl.cc3
-rw-r--r--gr-digital/lib/simple_correlator_impl.cc1
-rw-r--r--gr-fec/include/gnuradio/fec/awgn_bp.h11
-rw-r--r--gr-fec/include/gnuradio/fec/gf2mat.h25
-rw-r--r--gr-uhd/examples/c++/tags_demo.cc3
-rw-r--r--grc/base/Block.py5
-rw-r--r--grc/base/FlowGraph.py18
13 files changed, 89 insertions, 57 deletions
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake
index abf4dc4612..ef3a76eb4c 100644
--- a/cmake/Modules/GrSwig.cmake
+++ b/cmake/Modules/GrSwig.cmake
@@ -105,17 +105,36 @@ endfunction(GR_SWIG_MAKE_DOCS)
macro(GR_SWIG_MAKE name)
set(ifiles ${ARGN})
- # Shimming this in here to take care of a SWIG bug with handling
- # vector<size_t> and vector<unsigned int> (on 32-bit machines) and
- # vector<long unsigned int> (on 64-bit machines). Use this to test
- # the size of size_t, then set SIZE_T_32 if it's a 32-bit machine
- # or not if it's 64-bit. The logic in gr_type.i handles the rest.
- INCLUDE(CheckTypeSize)
- CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
- CHECK_TYPE_SIZE("unsigned int" SIZEOF_UINT)
- if(${SIZEOF_SIZE_T} EQUAL ${SIZEOF_UINT})
- list(APPEND GR_SWIG_FLAGS -DSIZE_T_32)
- endif(${SIZEOF_SIZE_T} EQUAL ${SIZEOF_UINT})
+ # Take care of a SWIG < 3.0 bug with handling std::vector<size_t>,
+ # by mapping to the correct sized type on the runtime system, one
+ # of "unsigned int", "unsigned long", or "unsigned long long".
+ # Compare the sizeof(size_t) with the sizeof the other types, and
+ # pick the first one in the list with the same sizeof. The logic
+ # in gnuradio-runtime/swig/gr_types.i handles the rest. It is
+ # probably not necessary to do this assignment all of the time,
+ # but it's easier to do it this way than to figure out the
+ # conditions when it is necessary -- and doing it this way won't
+ # hurt. This bug seems to have been fixed with SWIG >= 3.0, and
+ # mostly happens when not doing a native build (e.g., on Mac OS X
+ # when using a 64-bit CPU but building for 32-bit).
+
+ if(SWIG_VERSION VERSION_LESS "3.0.0")
+ include(CheckTypeSize)
+ check_type_size("size_t" SIZEOF_SIZE_T)
+ check_type_size("unsigned int" SIZEOF_UINT)
+ check_type_size("unsigned long" SIZEOF_UL)
+ check_type_size("unsigned long long" SIZEOF_ULL)
+
+ if(${SIZEOF_SIZE_T} EQUAL ${SIZEOF_UINT})
+ list(APPEND GR_SWIG_FLAGS -DSIZE_T_UINT)
+ elseif(${SIZEOF_SIZE_T} EQUAL ${SIZEOF_UL})
+ list(APPEND GR_SWIG_FLAGS -DSIZE_T_UL)
+ elseif(${SIZEOF_SIZE_T} EQUAL ${SIZEOF_ULL})
+ list(APPEND GR_SWIG_FLAGS -DSIZE_T_ULL)
+ else()
+ message(FATAL_ERROR "GrSwig: Unable to find replace for std::vector<size_t>; this should never happen!")
+ endif()
+ endif()
#do swig doc generation if specified
if(GR_SWIG_DOC_FILE)
diff --git a/docs/doxygen/other/build_guide.dox b/docs/doxygen/other/build_guide.dox
index ebf47dc7e2..8fc3f911fb 100644
--- a/docs/doxygen/other/build_guide.dox
+++ b/docs/doxygen/other/build_guide.dox
@@ -1,4 +1,4 @@
-/*! \page build_guide Build Instructions and Information
+ /*! \page build_guide Build Instructions and Information
\section dependencies Dependencies
@@ -24,11 +24,11 @@ installation tool (apt-get, pkg_install, YaST, yum, urpmi, etc.)
first. Most recent systems have these packages available.
\subsection dep_global Global Dependencies
-\li git http://code.google.com/p/msysgit
+\li git http://git-scm.com/downloads
\li cmake (>= 2.6.3) http://www.cmake.org/cmake/resources/software.html
-\li boost (>= 1.35) http://www.boostpro.com/download
-\li cppunit (>= 1.9.14) http://gaiacrtn.free.fr/cppunit/index.html
-\li fftw3f (>= 3.0.1) http://www.fftw.org/install/windows.html
+\li boost (>= 1.35) http://www.boost.org/users/download/
+\li cppunit (>= 1.9.14) http://freedesktop.org/wiki/Software/cppunit/
+\li fftw3f (>= 3.0.1) http://www.fftw.org/download.html
\subsection dep_python Python Wrappers
\li python (>= 2.5) http://www.python.org/download/
@@ -176,7 +176,7 @@ If not specified, the "Release" mode is the default.
Here are som other potentially helpful CMake flags. These are to help you specifically locate certain dependencies. While the CMake scripts themselves should generally find these for us, we can use these to help direct CMake to specific locations if we have installed a different version elsewhere on the system that CMake doesn't know about.
-\li QWT_LIBRARIES: shared library to use for Qwt (in the form <path>/libqwt.so).
+\li QWT_LIBRARIES: shared library to use for Qwt (in the form \<path\>/libqwt.so).
\li QWT_INCLUDE_DIRS: path to Qwt include files (e.g., /usr/include/qwt).
\li PYTHON_EXECUTABLE: Location of the 'python' binary you want to use (e.g., /usr/bin/python2.7).
\li PYTHON_INCLUDE_PATH: path to Python include files (e.g., /usr/include/python2.7).
diff --git a/gnuradio-runtime/swig/gr_types.i b/gnuradio-runtime/swig/gr_types.i
index 8ae953b904..e329a4ce9f 100644
--- a/gnuradio-runtime/swig/gr_types.i
+++ b/gnuradio-runtime/swig/gr_types.i
@@ -80,15 +80,19 @@ namespace std {
%template(gr_vector_vector_complexf) std::vector< std::vector< std::complex<float> > >;
%template(gr_vector_vector_complexd) std::vector< std::vector< std::complex<double> > >;
-// Fix for Issue #529
-#ifdef SIZE_T_32
- // On 32-bit systems, whenever we see std::vector<size_t>, replace it
- // with vector<unsigned int>
+// Fix for Issue #529: replace std::vector<size_t> with its equivalent
+// in element size, one of "unsigned int", "unsigned long", or
+// "unsigned long long". The replacement depends on the sizeof each
+// type, as determined in GrSwig.cmake GR_SWIG_MAKE. For SWIG >=
+// 3.0.0, none of these will be defined because this issue seems to
+// have been fixed.
+
+#if defined(SIZE_T_UINT)
%apply std::vector<unsigned int> { std::vector<size_t> };
-#else
- // On 64-bit systems, whenever we see std::vector<size_t>, replace it
- // with vector<long unsigned int>
- %apply std::vector<long unsigned int> { std::vector<size_t> };
+#elif defined(SIZE_T_UL)
+ %apply std::vector<unsigned long> { std::vector<size_t> };
+#elif defined(SIZE_T_ULL)
+ %apply std::vector<unsigned long long> { std::vector<size_t> };
#endif
#endif /* SWIG_GR_TYPES_I */
diff --git a/gr-blocks/include/gnuradio/blocks/tagged_stream_align.h b/gr-blocks/include/gnuradio/blocks/tagged_stream_align.h
index 979629317c..ae01198113 100644
--- a/gr-blocks/include/gnuradio/blocks/tagged_stream_align.h
+++ b/gr-blocks/include/gnuradio/blocks/tagged_stream_align.h
@@ -43,7 +43,8 @@ namespace gr {
/*!
* Make a tagged stream align
*
- * \param lengthtagname Length tag key
+ * \param itemsize The size (in bytes) of the item datatype.
+ * \param lengthtagname Name of the TSB's length tag key.
*/
static sptr make(size_t itemsize, const std::string &lengthtagname);
};
@@ -52,4 +53,3 @@ namespace gr {
} // namespace gr
#endif /* INCLUDED_TAGGED_STREAM_ALIGN_H */
-
diff --git a/gr-digital/lib/mpsk_snr_est.cc b/gr-digital/lib/mpsk_snr_est.cc
index 4e7825b894..098e465b2b 100644
--- a/gr-digital/lib/mpsk_snr_est.cc
+++ b/gr-digital/lib/mpsk_snr_est.cc
@@ -131,6 +131,7 @@ namespace gr {
{
d_y1 = 0;
d_y2 = 0;
+ d_y3 = 0;
d_counter = 1;
}
diff --git a/gr-digital/lib/ofdm_chanest_vcvc_impl.cc b/gr-digital/lib/ofdm_chanest_vcvc_impl.cc
index 8d2c17ca8b..f27107f2db 100644
--- a/gr-digital/lib/ofdm_chanest_vcvc_impl.cc
+++ b/gr-digital/lib/ofdm_chanest_vcvc_impl.cc
@@ -63,6 +63,8 @@ namespace gr {
d_corr_v(sync_symbol2),
d_known_symbol_diffs(0, 0),
d_new_symbol_diffs(0, 0),
+ d_first_active_carrier(0),
+ d_last_active_carrier(sync_symbol2.size()-1),
d_interpolate(false)
{
// Set index of first and last active carrier
diff --git a/gr-digital/lib/pn_correlator_cc_impl.cc b/gr-digital/lib/pn_correlator_cc_impl.cc
index 649b73be14..fa86de8cfe 100644
--- a/gr-digital/lib/pn_correlator_cc_impl.cc
+++ b/gr-digital/lib/pn_correlator_cc_impl.cc
@@ -43,7 +43,8 @@ namespace gr {
: sync_decimator("pn_correlator_cc",
io_signature::make(1, 1, sizeof(gr_complex)),
io_signature::make(1, 1, sizeof(gr_complex)),
- (unsigned int)((1ULL << degree)-1)) // PN code length
+ (unsigned int)((1ULL << degree)-1)), // PN code length
+ d_pn(0.0f)
{
d_len = (unsigned int)((1ULL << degree)-1);
if(mask == 0)
diff --git a/gr-digital/lib/simple_correlator_impl.cc b/gr-digital/lib/simple_correlator_impl.cc
index 6524e906a4..0e0b05a9a1 100644
--- a/gr-digital/lib/simple_correlator_impl.cc
+++ b/gr-digital/lib/simple_correlator_impl.cc
@@ -51,6 +51,7 @@ namespace gr {
io_signature::make(1, 1, sizeof(unsigned char))),
d_payload_bytesize(payload_bytesize),
d_state(ST_LOOKING), d_osi(0),
+ d_transition_osi(0), d_center_osi(0),
d_bblen((payload_bytesize + GRSF_PAYLOAD_OVERHEAD) * GRSF_BITS_PER_BYTE),
d_bitbuf(new unsigned char[d_bblen]),
d_pktbuf(new unsigned char[d_bblen/GRSF_BITS_PER_BYTE]),
diff --git a/gr-fec/include/gnuradio/fec/awgn_bp.h b/gr-fec/include/gnuradio/fec/awgn_bp.h
index f420d76394..62fe7e26a4 100644
--- a/gr-fec/include/gnuradio/fec/awgn_bp.h
+++ b/gr-fec/include/gnuradio/fec/awgn_bp.h
@@ -119,13 +119,14 @@ class FEC_API awgn_bp
int get_max_iterations();
/*!
- \brief Decodes the given vector rx_word by message passing.
-
- \param *niterations is the number of message passing iterations
- done to decode this codeword
+ * \brief Decodes the given vector rx_word by message passing.
+ *
+ * \param rx_word The received samples for decoding.
+ * \param niterations The number of message passing iterations
+ * done to decode this codeword.
*/
std::vector<char> decode (std::vector<float> rx_word,
- int *niterations);
+ int *niterations);
private:
//! The number of check nodes in the tanner-graph
int M;
diff --git a/gr-fec/include/gnuradio/fec/gf2mat.h b/gr-fec/include/gnuradio/fec/gf2mat.h
index 963b20830d..51aa310518 100644
--- a/gr-fec/include/gnuradio/fec/gf2mat.h
+++ b/gr-fec/include/gnuradio/fec/gf2mat.h
@@ -54,7 +54,7 @@ class GF2Mat
int get_M();
//! Returns the variable N
- int get_N();
+ int get_N();
//! Set the element at (i, j) coordinate to val
void set_element(int i, int j, char val);
@@ -93,17 +93,18 @@ class GF2Mat
std::vector<std::vector<char> > get_H();
/*!
- \brief Obtains an equivalent representation of H for encoding
-
- For encoding a G matrix in the form [I P] is obtained from the
- parity matrix H, by (a) Column permutations, (b) Row additions
- and (c) Row permutations. Details of encoding is given in
- section A.1 of the reference given below.
- - "Modern Coding Theory", T Richardson and R Urbanke.
-
- \param p is the column permutation during this operation
- \
- */
+ * \brief Obtains an equivalent representation of H for encoding
+ *
+ * For encoding a G matrix in the form [I P] obtained from the
+ * parity matrix H, by (a) Column permutations, (b) Row additions
+ * and (c) Row permutations. Details of encoding is given in
+ * section A.1 of the reference:
+ *
+ * - "Modern Coding Theory", T Richardson and R Urbanke.
+ *
+ * \param p The column permutation during this operation.
+ * \param rank The rank of the matrix.
+ */
GF2Mat get_G(std::vector<int> & p, int & rank);
};
diff --git a/gr-uhd/examples/c++/tags_demo.cc b/gr-uhd/examples/c++/tags_demo.cc
index 787e3d2e4b..42cbb46874 100644
--- a/gr-uhd/examples/c++/tags_demo.cc
+++ b/gr-uhd/examples/c++/tags_demo.cc
@@ -24,6 +24,7 @@
#include <gnuradio/uhd/usrp_sink.h>
#include <tag_source_demo.h>
#include <tag_sink_demo.h>
+#include <uhd/utils/safe_main.hpp>
#include <boost/make_shared.hpp>
#include <boost/thread/thread.hpp> //sleep
#include <boost/program_options.hpp>
@@ -41,7 +42,7 @@ void sig_int_handler(int){stop_signal_called = true;}
/***********************************************************************
* Main w/ program options
**********************************************************************/
-int main(int argc, char *argv[]){
+int UHD_SAFE_MAIN(int argc, char *argv[]){
std::string device_addr, length_tag;
double center_freq, samp_rate, burst_dur, idle_dur;
diff --git a/grc/base/Block.py b/grc/base/Block.py
index cadff12c0a..b367e60e69 100644
--- a/grc/base/Block.py
+++ b/grc/base/Block.py
@@ -141,8 +141,9 @@ class Block(Element):
and (self._key != "virtual_sink") \
and (self._key != "pad_source") \
and (self._key != "pad_sink"))
+ is_variable = self._key.startswith('variable')
- if is_not_virtual_or_pad:
+ if is_not_virtual_or_pad and not is_variable:
self.get_params().append(self.get_parent().get_parent().Param(
block=self,
n=odict({'name': 'Block Alias',
@@ -413,7 +414,7 @@ class Block(Element):
"""
n = odict()
n['key'] = self.get_key()
- n['param'] = map(lambda p: p.export_data(), self.get_params())
+ n['param'] = map(lambda p: p.export_data(), sorted(self.get_params(), key=str))
if 'bus' in map(lambda a: a.get_type(), self.get_sinks()):
n['bus_sink'] = str(1);
if 'bus' in map(lambda a: a.get_type(), self.get_sources()):
diff --git a/grc/base/FlowGraph.py b/grc/base/FlowGraph.py
index fb25b46821..790aed07f6 100644
--- a/grc/base/FlowGraph.py
+++ b/grc/base/FlowGraph.py
@@ -126,13 +126,13 @@ class FlowGraph(Element):
def get_block(self, id): return filter(lambda b: b.get_id() == id, self.get_blocks())[0]
def get_blocks_unordered(self): return filter(lambda e: e.is_block(), self.get_elements())
def get_blocks(self):
- blocks = self.get_blocks_unordered();
- for i in range(len(blocks)):
- if blocks[i].get_key() == 'variable':
- blk = blocks[i];
- blocks.remove(blk);
- blocks.insert(1, blk);
- return blocks;
+ # refactored the slow, ugly version
+ # don't know why we need this here, using it for sorted export_data()
+ return sorted(self.get_blocks_unordered(), key=lambda b: (
+ b.get_key() != 'options', # options to the front
+ not b.get_key().startswith('variable'), # then vars
+ str(b)
+ ))
def get_connections(self): return filter(lambda e: e.is_connection(), self.get_elements())
def get_children(self): return self.get_elements()
def get_elements(self):
@@ -250,8 +250,8 @@ class FlowGraph(Element):
"""
n = odict()
n['timestamp'] = self._timestamp
- n['block'] = [block.export_data() for block in self.get_blocks()]
- n['connection'] = [connection.export_data() for connection in self.get_connections()]
+ n['block'] = [b.export_data() for b in self.get_blocks()] # already sorted
+ n['connection'] = [c.export_data() for c in sorted(self.get_connections(), key=str)]
instructions = odict({
'created': self.get_parent().get_version_short(),
'format': FLOW_GRAPH_FILE_FORMAT_VERSION,