From a6517c9fa394ccf48206979f1e02608055de6a0c Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 3 Jan 2012 14:32:05 -0500 Subject: build: maybe towards a better way of getting Doxygen docstrings to build with -jN. --- cmake/Modules/GrSwig.cmake | 30 ++++++++++++++++++++---------- docs/doxygen/Doxyfile.swig_doc.in | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake index ced8b16c8..512d8e631 100644 --- a/cmake/Modules/GrSwig.cmake +++ b/cmake/Modules/GrSwig.cmake @@ -66,24 +66,34 @@ function(GR_SWIG_MAKE_DOCS output_file) #call doxygen on the Doxyfile + input headers add_custom_command( - OUTPUT ${OUTPUT_DIRECTORY}/xml/index.xml + OUTPUT ${OUTPUT_DIRECTORY}/tmp/xml/index.xml + ${OUTPUT_DIRECTORY}/tmp/xml/combine.xslt DEPENDS ${input_files} ${GR_SWIG_DOCS_SOURCE_DEPS} ${tag_deps} COMMAND ${DOXYGEN_EXECUTABLE} ${OUTPUT_DIRECTORY}/Doxyfile COMMENT "Generating doxygen xml for ${name} docs" ) - #call sync if we can to flush the doxygen writes to file before python reads - find_program(SYNC_EXECUTABLE sync) - unset(sync_command) - if(SYNC_EXECUTABLE) - set(sync_command COMMAND ${SYNC_EXECUTABLE}) - endif() + # Steps to make sure the Doxygen run is finished before we allow the dependency to be met that + # reads the outputs of this stage. + set(stamp-file "${OUTPUT_DIRECTORY}/xml/${name}.stamp") + add_custom_command( + OUTPUT ${stamp-file} ${OUTPUT_DIRECTORY}/xml/index.xml + DEPENDS ${OUTPUT_DIRECTORY}/tmp/xml/index.xml ${OUTPUT_DIRECTORY}/tmp/xml/combine.xslt + COMMAND "${CMAKE_COMMAND}" -E make_directory "${OUTPUT_DIRECTORY}/xml" + COMMAND "${CMAKE_COMMAND}" -E copy "${OUTPUT_DIRECTORY}/tmp/xml/index.xml" "${OUTPUT_DIRECTORY}/" + COMMAND "${CMAKE_COMMAND}" -E copy_directory "${OUTPUT_DIRECTORY}/tmp/xml/" "${OUTPUT_DIRECTORY}/xml/" + COMMAND "${CMAKE_COMMAND}" -E copy "${OUTPUT_DIRECTORY}/index.xml" "${OUTPUT_DIRECTORY}/xml/" + COMMAND "${CMAKE_COMMAND}" -E touch "${stamp-file}" + COMMENT "Waiting for doxygen to finish" + ) + set_source_files_properties(${OUTPUT_DIRECTORY}/xml/index.xml PROPERTIES GENERATED TRUE) + set_source_files_properties(${OUTPUT_DIRECTORY}/xml/combine.xslt PROPERTIES GENERATED TRUE) + set_source_files_properties(${stamp-file} PROPERTIES GENERATED TRUE) #call the swig_doc script on the xml files add_custom_command( - OUTPUT ${output_file} - DEPENDS ${input_files} ${OUTPUT_DIRECTORY}/xml/index.xml - ${sync_command} + OUTPUT ${output_file} + DEPENDS ${input_files} ${stamp-file} ${OUTPUT_DIRECTORY}/xml/index.xml COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${CMAKE_SOURCE_DIR}/docs/doxygen/swig_doc.py ${OUTPUT_DIRECTORY}/xml diff --git a/docs/doxygen/Doxyfile.swig_doc.in b/docs/doxygen/Doxyfile.swig_doc.in index 94e14bda1..54fdb492d 100644 --- a/docs/doxygen/Doxyfile.swig_doc.in +++ b/docs/doxygen/Doxyfile.swig_doc.in @@ -38,7 +38,7 @@ PROJECT_NUMBER = @CPACK_PACKAGE_VERSION@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@ +OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@/tmp # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output -- cgit From e3068517815363102043363556be654c5b47c5c9 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 3 Jan 2012 17:09:42 -0500 Subject: build: not going to work. Removing changes to cmake files and no sync call. --- cmake/Modules/GrSwig.cmake | 21 ++------------------- docs/doxygen/Doxyfile.swig_doc.in | 2 +- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake index 512d8e631..4bcd67eb9 100644 --- a/cmake/Modules/GrSwig.cmake +++ b/cmake/Modules/GrSwig.cmake @@ -66,30 +66,13 @@ function(GR_SWIG_MAKE_DOCS output_file) #call doxygen on the Doxyfile + input headers add_custom_command( - OUTPUT ${OUTPUT_DIRECTORY}/tmp/xml/index.xml - ${OUTPUT_DIRECTORY}/tmp/xml/combine.xslt + OUTPUT ${OUTPUT_DIRECTORY}/xml/index.xml + ${OUTPUT_DIRECTORY}/xml/combine.xslt DEPENDS ${input_files} ${GR_SWIG_DOCS_SOURCE_DEPS} ${tag_deps} COMMAND ${DOXYGEN_EXECUTABLE} ${OUTPUT_DIRECTORY}/Doxyfile COMMENT "Generating doxygen xml for ${name} docs" ) - # Steps to make sure the Doxygen run is finished before we allow the dependency to be met that - # reads the outputs of this stage. - set(stamp-file "${OUTPUT_DIRECTORY}/xml/${name}.stamp") - add_custom_command( - OUTPUT ${stamp-file} ${OUTPUT_DIRECTORY}/xml/index.xml - DEPENDS ${OUTPUT_DIRECTORY}/tmp/xml/index.xml ${OUTPUT_DIRECTORY}/tmp/xml/combine.xslt - COMMAND "${CMAKE_COMMAND}" -E make_directory "${OUTPUT_DIRECTORY}/xml" - COMMAND "${CMAKE_COMMAND}" -E copy "${OUTPUT_DIRECTORY}/tmp/xml/index.xml" "${OUTPUT_DIRECTORY}/" - COMMAND "${CMAKE_COMMAND}" -E copy_directory "${OUTPUT_DIRECTORY}/tmp/xml/" "${OUTPUT_DIRECTORY}/xml/" - COMMAND "${CMAKE_COMMAND}" -E copy "${OUTPUT_DIRECTORY}/index.xml" "${OUTPUT_DIRECTORY}/xml/" - COMMAND "${CMAKE_COMMAND}" -E touch "${stamp-file}" - COMMENT "Waiting for doxygen to finish" - ) - set_source_files_properties(${OUTPUT_DIRECTORY}/xml/index.xml PROPERTIES GENERATED TRUE) - set_source_files_properties(${OUTPUT_DIRECTORY}/xml/combine.xslt PROPERTIES GENERATED TRUE) - set_source_files_properties(${stamp-file} PROPERTIES GENERATED TRUE) - #call the swig_doc script on the xml files add_custom_command( OUTPUT ${output_file} diff --git a/docs/doxygen/Doxyfile.swig_doc.in b/docs/doxygen/Doxyfile.swig_doc.in index 54fdb492d..94e14bda1 100644 --- a/docs/doxygen/Doxyfile.swig_doc.in +++ b/docs/doxygen/Doxyfile.swig_doc.in @@ -38,7 +38,7 @@ PROJECT_NUMBER = @CPACK_PACKAGE_VERSION@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@/tmp +OUTPUT_DIRECTORY = @OUTPUT_DIRECTORY@ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output -- cgit From 0f3bb8be9d3eb2549de15c7192fcbeb57baf588d Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 3 Jan 2012 17:15:23 -0500 Subject: build: have swig_doc catch the exception when the xml parsing fails on a not-complete file. The method sleeps for a second and tries again 3 times before fully failing. This seems a bit crass... --- docs/doxygen/swig_doc.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/doxygen/swig_doc.py b/docs/doxygen/swig_doc.py index 5034099e3..7b34a523e 100644 --- a/docs/doxygen/swig_doc.py +++ b/docs/doxygen/swig_doc.py @@ -27,7 +27,7 @@ python docstrings. """ -import sys +import sys, time try: from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base @@ -193,7 +193,25 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None): output.append(custom_output) # Create docstrings for the blocks. - blocks = di.in_category(Block) + tries = 0 + while(1): + try: + blocks = di.in_category(Block) + except: + if(tries < 3): + # May not be built just yet; sleep and try again + sys.stderr.write("XML parsing problem with file {0}, retrying.\n".format( + swigdocfilename)) + time.sleep(1) + tries += 1 + else: + # if we've given it three tries, give up and raise an error + sys.stderr.write("XML parsing error with file {0}. giving up.\n".format( + swigdocfilename)) + raise + else: + break + make_funcs = set([]) for block in blocks: try: -- cgit From 0aa47db21afc09b37ac4e0feebeaa624e5549714 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 6 Jan 2012 15:07:35 -0500 Subject: docs: another recheck point in the siwg_doc code. If a parse error happens, try rereading up to 3 times. --- docs/doxygen/swig_doc.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/doxygen/swig_doc.py b/docs/doxygen/swig_doc.py index 7b34a523e..95d143aab 100644 --- a/docs/doxygen/swig_doc.py +++ b/docs/doxygen/swig_doc.py @@ -219,7 +219,7 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None): make_funcs.add(make_func.name()) output.append(make_block_entry(di, block)) except block.ParsingError: - print('Parsing error for block %s' % block.name()) + sys.stderr.write('Parsing error for block {0}'.format(block.name())) # Create docstrings for functions # Don't include the make functions since they have already been dealt with. @@ -228,7 +228,7 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None): try: output.append(make_func_entry(f)) except f.ParsingError: - print('Parsing error for function %s' % f.name()) + sys.stderr.write('Parsing error for function {0}'.format(f.name())) # Create docstrings for classes block_names = [block.name() for block in blocks] @@ -237,7 +237,7 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None): try: output.append(make_class_entry(k)) except k.ParsingError: - print('Parsing error for class %s' % k.name()) + sys.stderr.write('Parsing error for class {0}'.format(k.name())) # Docstrings are not created for anything that is not a function or a class. # If this excludes anything important please add it here. @@ -268,4 +268,24 @@ if __name__ == "__main__": custom_output = "\n\n".join(output) # Generate the docstrings interface file. - make_swig_interface_file(di, swigdocfilename, custom_output=custom_output) + # If parsing error on NoSuchMember, try again by rereading everything. + # Give up after 3 tries. + tries = 0 + while(1): + try: + make_swig_interface_file(di, swigdocfilename, custom_output=custom_output) + except base.Base.NoSuchMember: + if(tries < 3): + # May not be built just yet; sleep and try again + sys.stderr.write("XML parsing problem with file {0}, retrying.\n".format( + swigdocfilename)) + time.sleep(1) + tries += 1 + else: + # if we've given it three tries, give up and raise an error + sys.stderr.write("XML parsing error with file {0}. giving up.\n".format( + swigdocfilename)) + raise + else: + break + -- cgit From f58076ffbba790fd93504ea1d38e39e278e663de Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Mon, 16 Jan 2012 09:30:12 -0500 Subject: docs: another hack to check for errors and retry when building the swigdocs. --- docs/doxygen/swig_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/doxygen/swig_doc.py b/docs/doxygen/swig_doc.py index 95d143aab..0148ba8fb 100644 --- a/docs/doxygen/swig_doc.py +++ b/docs/doxygen/swig_doc.py @@ -274,7 +274,7 @@ if __name__ == "__main__": while(1): try: make_swig_interface_file(di, swigdocfilename, custom_output=custom_output) - except base.Base.NoSuchMember: + except: if(tries < 3): # May not be built just yet; sleep and try again sys.stderr.write("XML parsing problem with file {0}, retrying.\n".format( -- cgit From 26de2814ed10cb3a03d0209e8cbaf22540f2650e Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 19 Jan 2012 21:31:14 -0500 Subject: core: fixed bug in FFT shift operation. --- gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc index 3293e3ab8..c66015c11 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vcc_fftw.cc @@ -67,8 +67,17 @@ gr_fft_vcc_fftw::work (int noutput_items, if (d_window.size()){ gr_complex *dst = d_fft->get_inbuf(); - for (unsigned int i = 0; i < d_fft_size; i++) // apply window - dst[i] = in[i] * d_window[i]; + if(!d_forward && d_shift){ + int offset = (!d_forward && d_shift)?floor(d_fft_size/2):0; + int fft_m_offset = d_fft_size - offset; + for (unsigned int i = 0; i < offset; i++) // apply window + dst[i+fft_m_offset] = in[i] * d_window[i]; + for (unsigned int i = offset; i < d_fft_size; i++) // apply window + dst[i-offset] = in[i] * d_window[i]; + } else { + for (unsigned int i = 0; i < d_fft_size; i++) // apply window + dst[i] = in[i] * d_window[i]; + } } else { if(!d_forward && d_shift) { // apply an ifft shift on the data -- cgit From 6e3ec5d3697274f45bb83e68818402e50c1e23a6 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 19 Jan 2012 22:14:31 -0500 Subject: docs: another try/except/rerun spot. --- docs/doxygen/swig_doc.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/doxygen/swig_doc.py b/docs/doxygen/swig_doc.py index 0148ba8fb..4148a546b 100644 --- a/docs/doxygen/swig_doc.py +++ b/docs/doxygen/swig_doc.py @@ -214,12 +214,28 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None): make_funcs = set([]) for block in blocks: - try: - make_func = di.get_member(make_name(block.name()), DoxyFunction) - make_funcs.add(make_func.name()) - output.append(make_block_entry(di, block)) - except block.ParsingError: - sys.stderr.write('Parsing error for block {0}'.format(block.name())) + tries = 0 + while(1): + try: + make_func = di.get_member(make_name(block.name()), DoxyFunction) + make_funcs.add(make_func.name()) + output.append(make_block_entry(di, block)) + except block.ParsingError: + sys.stderr.write('Parsing error for block {0}'.format(block.name())) + except: + if(tries < 3): + # May not be built just yet; sleep and try again + sys.stderr.write("XML parsing problem with file {0}, retrying.\n".format( + swigdocfilename)) + time.sleep(1) + tries += 1 + else: + # if we've given it three tries, give up and raise an error + sys.stderr.write("XML parsing error with file {0}. giving up.\n".format( + swigdocfilename)) + raise + else: + break # Create docstrings for functions # Don't include the make functions since they have already been dealt with. -- cgit From 2d80e59c2b26de65e5266b8c6fb4be118a7428a0 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 21 Jan 2012 10:41:23 -0500 Subject: noaa: add pc file for gr-noaa to m4 file. --- config/grc_gr_noaa.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/config/grc_gr_noaa.m4 b/config/grc_gr_noaa.m4 index 54df77503..f750a4645 100644 --- a/config/grc_gr_noaa.m4 +++ b/config/grc_gr_noaa.m4 @@ -33,6 +33,7 @@ AC_DEFUN([GRC_GR_NOAA],[ gr-noaa/oct/Makefile \ gr-noaa/python/Makefile \ gr-noaa/swig/Makefile \ + gr-noaa/gnuradio-noaa.pc \ gr-noaa/swig/run_guile_tests \ ]) -- cgit