https://wiki.gnuradio.org/api.php?action=feedcontributions&user=67.177.248.173&feedformat=atomGNU Radio - User contributions [en]2024-03-28T21:47:58ZUser contributionsMediaWiki 1.39.5https://wiki.gnuradio.org/index.php?title=SuggestedReading&diff=12951SuggestedReading2023-02-11T13:14:51Z<p>67.177.248.173: /* Digital Comms */ update link to MIT OCW 6.450</p>
<hr />
<div>= Suggested Reading =<br />
<br />
If you don't know where to start, look at the [[SuggestedReadingOrder]] page for some hints.<br />
<br />
Feel free to add items, but make sure they are:<br />
<br />
* Up to date<br />
* Easily available<br />
* Widely applicable<br />
<br />
== GNU Radio Specific ==<br />
<br />
* Check out our [[Tutorials]] page<br />
* Gary Schafer's Frequency demodulator posts:<br />
** http://www.site2241.net/november2019.htm<br />
** http://www.site2241.net/may2020.htm<br />
** http://www.site2241.net/august2020.htm<br />
<br />
== Software Radio in General ==<br />
<br />
* [http://en.wikipedia.org/wiki/Software-defined_radio Software Radio] on Wikipedia<br />
* [https://www.analog.com/en/education/education-library/software-defined-radio-for-engineers.html Software-Defined Radio for Engineers (2018)] by Analog Devices. Supplementary material can be found here: https://sdrforengineers.github.io/<br />
* Michael Ossmann's online Videos on SDR/DSP: http://greatscottgadgets.com/sdr/<br />
* Thierry Turletti's software radio resource page: https://www-sop.inria.fr/members/Thierry.Turletti/SoftwareRadio.html<br />
* &quot;Software Radio, A Modern Approach to Radio Engineering&quot; by Jeffrey H. Reed. This has good stuff in it, but the coverage is highly variable. ISBN 0130811580.<br />
* [https://www.pentek.com/fpgahandbook/FPGAHandbookDirect.cfm?GC=11086 Putting FPGAs to Work for Software Radio Handbook, Twelfth Edition]<br />
* [http://www.spectrumsignal.com/resources/pdf/articles/Reconfigurable_Direction_Finding_System_RFDesign-2005-01.pdf SDR platform enables reconfigurable direction finding system]<br />
* &quot;RF and Digital Signal Processing for Software-Defined Radio: A Multi-Standard Multi-Mode Approach&quot;, Rouphael. ISBN-10 0750682108. Covers fundamental concepts behind SDR as well as introductions to wireless digital communications signals and multi-rate digital filtering.<br />
<br />
== Math basics and complex numbers ==<br />
<br />
* Michael Ossman's online Videos on SDR/DSP: http://greatscottgadgets.com/sdr/<br />
* &quot;Quadrature Signals: Complex, But Not Complicated&quot; by Richard Lyons: http://www.dspguru.com/sites/dspguru/files/QuadSignals.pdf<br />
* MIT OpenCourseWare Lecture - "Divide and Conquer: FFT" https://www.youtube.com/watch?v=iTMn0Kt18tg<br />
<br />
== Digital Signal Processing ==<br />
<br />
* [https://pysdr.org/ PySDR: A Guide to SDR and DSP using Python] Lichtman, M.L. (2020)<br />
* Michael Ossman's online Videos on SDR/DSP: http://greatscottgadgets.com/sdr/<br />
* &quot;Practical Signal Processing&quot; by Mark Owen<br />
* &quot;Understanding Digital Signal Processing&quot; by Richard Lyons. Great practical intro to DSP. ISBN 0201634678. 2nd ed (2004) ISBN 0131089897. 3rd ed (2010) ISBN 0137027419.<br />
* &quot;Digital Signal Processing, A Practical Approach&quot;, Ifeachor and Jervis. Another good intro with a little more depth than Lyons. ISBN 020154413X.<br />
* &quot;The Scientist and Engineer's Guide to Digital Signal Processing&quot; by Stephen W. Smith Ph.D, available for free download at http://www.dspguide.com/. Also available in soft cover: ISBN 0-7506-7444-X.<br />
* &quot;Discrete-Time Signal Processing&quot; by Alan V. Oppenheim and Ronald W. Schafer. A standard and comprehensive textbook on DSP.<br />
* [http://www.digitalfilter.com/products/dsplinks/endsplinks.html DSPLinks] A great tool for learning DSP. Comes with lots of examples.<br />
* The [http://www.guerrilla.net/reference/dsp/dsp_faq/dsp_faq.htm comp.dsp FAQ] is also good.<br />
* MIT &quot;Digital Signal Processing&quot; online course. http://ocw.mit.edu/resources/res-6-008-digital-signal-processing-spring-2011/<br />
* &quot;Signal Processing for Communications&quot; by Paolo Prandoni and Martin Vetterli. Available as both printed book and free download from http://www.sp4comm.org/index.html<br />
* [http://greenteapress.com/wp/think-dsp/ Think DSP] by Allen Downey<br />
* DSP Courses by Dan Boschen available through dsprelated.com and IEEE Boston: https://https://www.dsprelated.com/courses/ and https://ieeeboston.org/2022-courses/<br />
<br />
== Digital Comms ==<br />
<br />
* MIT 6.450 Principles of Digital Communications I. Full course available on [https://ocw.mit.edu/courses/6-450-principles-of-digital-communications-i-fall-2006/ OCW] and [https://www.amazon.com/Principles-Digital-Communication-Robert-Gallager/dp/0521879078 Principles of Digital Communications Book ISBN 0521879078] by Professor Gallager .<br />
* &quot;Digital Signal Processing in Communication Systems&quot; by Marvin E. Frerking. Practical engineering focus. Lots of great examples. Frerking often provides mulitiple solutions for a given transmitter or receiver design problem. ISBN 0442016166.<br />
* &quot;Digital Communications, Fundamentals and Applications, 2nd ed.&quot;, Sklar. Good coverage of all aspects digital comms. ISBN 0130847887.<br />
* &quot;Digital and Analog Communication Systems&quot; by Leon W. Couch II. Pretty good balance of theory and application. Covers many of the analog modulations that aren't covered in other comms books. ISBN 0135225833.<br />
* &quot;Digital Communications, 3rd ed&quot;, by John Proakis. Popular textbook, but very detailed and not so good as intro material. ISBN 0070517266.<br />
* [https://people.eecs.berkeley.edu/~dtse/book.html Fundamentals of Wireless Communication] by David Tse and Pramod Viswanathan. Covers topics on wireless channel modeling in detail.<br />
* &quot;Multirate Signal Processing for Communication Systems&quot;, by fredric j harris. ISBN 0131465112.<br />
* &quot;Wireless Digital Communications: Design and Theory&quot;, by Tom McDermott, N5EG. Good high level overview of the basics of digital comms. Published by TAPR, available at http://www.tapr.org. ISBN 0-9644707-2-1.<br />
* &quot;Communication System Design Using DSP Algorithms: With Laboratory Experiments for the TMS320C6701 and TMS320C6711&quot;, by Steven Tretter. Very good book on basics of modems and real-life implementation. Author is the man behind voice-band modem standards like V.34. ISBN 0306474298.<br />
* complextoreal.com's [http://complextoreal.com/tutorials/ Communications Tutorials]<br />
* &quot;Telecommunication Breakdown - Concepts of Communication Transmitted via Software-Defined Radio&quot; by C. Richard Johnson, Jr. and William A. Sethares. ISBN 0131430475. Also available as [http://sethares.engr.wisc.edu/telebreak.html PDF from the author]<br />
* &quot;A Foundation in Digital Communication&quot;, by Amos Lapidoth. A very accessible book that covers all the basics of digital communication theory, without getting complicated and without being afraid of explaining the basic assumptions behind the formulas and methods that other books often fail to mention. Also available as [http://www.afidc.ethz.ch/A_Foundation_in_Digital_Communication/Home.html PDF from the author]<br />
* &quot;Digital Communication, 3rd Edition&quot;, by John R. Barry, Edward A. Lee and David G. Messerschmitt.<br />
* [https://wirelesspi.com/book Wireless Communications From the Ground Up - An SDR Perspective] (2nd ed.) by Qasim Chaudhari. Mostly relies on beautiful figures and intuitive explanations.<br />
<br />
== Radio and RF Design ==<br />
<br />
Introductions to theory, etc.<br />
<br />
* &quot;The Science of Radio&quot; by Paul J Nahin. Accessable intro to the the physics of radio, with specific treatment of the superhetrodyne receiver. It's also got some great history intermixed. 2nd edition: ISBN 0387951504. (First edition: ISBN 1563963477)<br />
* &quot;The Electronics of Radio&quot; by David B. Rutledge. Walks through the theory and operation of the NorCal 40A CW transceiver. Quite interesting. ISBN 0-521-64645-6.<br />
* &quot;RF Circuit Design&quot; by Chris Bowick. This compact book covers lots of what you really need to know for RF. It covers the mysterious Smith Chart, matching circuits, filter design, small signal amplifier design (LNA's) and RF power amps. ISBN 0-7506-9946-9.<br />
* &quot;The Darker Side&quot; by Robert Lacoste. The book takes the reader towards an unconventional yet a very interesting & a practical approach towards RF circuit design. ISBN 978-185617-762-7.<br />
* &quot;Experimental Methods in RF Design&quot; by Wes Hayward, Rick Campbell, Bob Larkin. Good practical book from ARRL. The authors are experienced amateur radio homebrewers. Published by American Radio Relay League (ARRL). ISBN: 0-87259-879-9<br /><br />
Amateur Radio specific<br />
* &quot;The ARRL Handbook.&quot; A kind of hodge-podge of stuff. If you already know what you're looking for, you might be able to find it here. http://www.arrl.org<br />
<br />
== Electronics ==<br />
<br />
* &quot;The Art of Electronics&quot; by Horowitz and Hill. Truly a classic. A great introduction to electronics that works to help you build an intuitive understanding of what's going on. Great techniques for &quot;back of the envelope design&quot;, how to think about circuits, etc. If you're interested in electronics, this is a book to have! ISBN 0521370957. There's a student workbook too.<br />
* http://en.wikibooks.org/wiki/Electronics (really basic, work in progress)<br />
<br />
Books on OpAmp's:<br />
<br />
* &quot;IC Op-Amp Cookbook&quot; by Walter Jung. ISBN 0672224534<br />
* &quot;Intuitive Operational Amplifiers&quot; by Thomas Frederiksen. ISBN 0070219672<br />
* &quot;Analog Electronics with Op Amps&quot; by Peyton and Walsh. ISBN 052133604X<br />
<br />
== C++ ==<br />
<br />
* &quot;C++ Primer&quot; by Stanley Lippman, Josee LaJoie ISBN 0201824701<br />
* &quot;The C++ Standard Library, a Tutorial and Reference&quot;, Nicolai M. Josuttis, ISBN 0-201-379260. Excellent coverage of the Standard Library. Very useful! I keep it near my desk.<br />
* [http://www.boost.org boost.org C++ libraries.] We still use some of these libraries.<br />
* &quot;Effective C++'', 2nd ed.&quot;, Scott Meyers. 50 ways to avoid blowing your foot off with C''++. ISBN 0-201-02488-9.<br />
* &quot;Large-Scale C++ Software Design&quot;, John Lakos. After you've got a pretty good grip on C++, this runs through some techniques for building big systems. We use a lot of them in GnuRadio. ISBN 0-201-63362-0.<br />
* Bruce Eckel's [http://mindview.net/Books/TICPP/ThinkingInCPP2e.html Thinking in C++]<br />
<br />
== Python ==<br />
<br />
* The online tutorial http://docs.python.org/tutorial/<br />
* Python3 Online Docs: https://docs.python.org/3/<br />
* [https://pysdr.org/ PySDR: A Guide to SDR and DSP using Python] Lichtman, M.L. (2020)<br />
* If you prefer bound books, &quot;Python Essential Reference, 2nd ed&quot;, by David M. Beazley is my favorite. ISBN 0-7357-1091-0.<br />
* &quot;How to Think Like a Computer Scientist: Learning with Python&quot;, http://www.openbookproject.net/books/ or http://isbn.nu/0971677506/<br />
* "Python Applications for Digital Design and Signal Processing" course by Dan Boschen available through dsprelated.com and IEEE Boston: https://https://www.dsprelated.com/courses/ and https://ieeeboston.org/2022-courses/<br />
<br />
== Verilog ==<br />
<br />
* [http://academic.csuohio.edu/chu_p/rtl/fpga_vlog.html FPGA Prototyping by Verilog Examples], by Pong P. Chu. Very hands-on, Spartan-3 specific.<br />
* [http://www.amazon.com/Verilog-HDL-Synthesis-Practical-Primer/dp/0965039153 Verilog HDL Synthesis: A Practical Primer], J. Bhasker, ISBN 0-9650391-5-3. Covers the subset of Verilog HDL applicable for synthesizing synchronous and asynchronous logic in hardware, with many example pairings of code and synthesized net lists.<br />
<br />
== Amateur Radio Licensing ==<br />
<br />
How to get a ham license in the US<br />
<br />
* &quot;Now You're Talking!&quot;, ARRL. Read this, pass a 35 question multiple choice test, and you're legal to operate on the ham bands &gt;= 50 MHz. No Morse code required. ISBN 0-87259-881-0.</div>67.177.248.173https://wiki.gnuradio.org/index.php?title=Hier_Blocks_and_Parameters&diff=12399Hier Blocks and Parameters2022-08-01T19:27:56Z<p>67.177.248.173: /* Generate the Hier Block Code */</p>
<hr />
<div><div style="float:right"><br />
{{Template:BeginnerTutorials}}<br />
</div><br />
This tutorial describes how to create a hierarchical block, or ''Hier block'', in GRC.<br />
<br />
The previous tutorial, [[Streams_and_Vectors|Streams and Vectors]], describes the differences between ''Streams'' and ''Vectors''. The next tutorial, [[Creating_Your_First_Block|Creating Your First Block]], describes how to use the ''Embedded Python Block'' to create a signal processing block in GNU Radio.<br />
<br />
<br />
== Creating the Initial Flowgraph ==<br />
<br />
A ''hier block'' is used as a wrapper to simplify multiple GNU Radio blocks into a single block. The example ''hier block'' will be a frequency shifter block which multiplies a ''Signal Source'' against an input signal.<br />
<br />
[[File:FrequencyShifterBlock.png|500px]]<br />
<br />
<br />
The first step is creating the flowgraph. Drag and drop the following blocks into the workspace:<br />
# ''Signal Source''<br />
# ''Multiply''<br />
# ''Noise Source''<br />
# ''Low Pass Filter''<br />
# ''Throttle''<br />
# ''QT GUI Frequency Sink''<br />
# ''QT GUI Range''<br />
<br />
Connect the blocks:<br />
<br />
[[File:StartingFlowgraphHierBlock.png|700px]]<br />
<br />
Update the ''QT GUI Range'' properties:<br />
* Id: ''frequency''<br />
* Default Value: ''0''<br />
* Start: ''-samp_rate/2''<br />
* Stop: ''samp_rate/2''<br />
<br />
Update the ''Low Pass Filter'' properties:<br />
* Cutoff Freq (Hz): ''samp_rate/4''<br />
* Transition Width (Hz): ''samp_rate/8''<br />
<br />
== Create The Hier Block ==<br />
<br />
Click and drag in the workspace window to select the ''Signal Source'' and ''Multiply'' blocks including the connection between them:<br />
<br />
[[File:ClickAndDragSelect.png|700px]]<br />
<br />
<br />
Right-click on the highlighted blocks and select ''More > Create Hier'':<br />
<br />
[[File:ClickCreateHier.png|700px]]<br />
<br />
<br />
A flowgraph is created in a new GRC tab:<br />
<br />
[[File:NewHierBlock.png|500px]]<br />
<br />
<br />
Double-click the ''Options'' block and edit the properties:<br />
* Id: ''FrequencyShifter''<br />
* Title: ''Frequency Shifter Block''<br />
* Generate Options: ''Hier Block''<br />
<br />
[[File:OptionsSelectHierBlock.png|500px]]<br />
<br />
The remaining properties will then change, showing the ''Category'':<br />
<br />
[[File:ShowGRCHierBlocksCategory.png|500px]]<br />
<br />
The ''Category'' is where the block can be found in the block library on the right hand of GRC. The hier block will be located under ''GRC Hier Blocks'', instead of ''Core'' where the rest of the GNU Radio blocks are located.<br />
<br />
Save the flowgraph.<br />
<br />
== Variables vs Parameters ==<br />
<br />
A ''variable'' is different than a ''parameter'' in GNU Radio. A ''parameter'' creates an interface for the ''hier block'' to accept a value from an external source, where as a ''variable'' only exists internally to the ''hier block'':<br />
<br />
[[File:HierBlockParameterVariable.png|500px]]<br />
<br />
<br />
For example, the ''samp_rate'' variable can only be accessed from within the ''hier block'':<br />
<br />
[[File:HierBlockWithVariable.png|500px]]<br />
<br />
<br />
The ''samp_rate'' needs to be converted to a parameter so it can be updated from another block in the larger flowgraph. Delete the ''samp_rate'' variable and add a ''Parameter'' block into the GRC workspace:<br />
<br />
[[File:AddParameterToHierBlock.png|500px]]<br />
<br />
<br />
Edit the ''Parameter'' properties:<br />
* Id: ''samp_rate''<br />
* Label: ''Sample Rate''<br />
* Type: ''Float''<br />
<br />
[[File:EditParameterProperties.png|500px]]<br />
<br />
<br />
Add a second ''Parameter'':<br />
* Id: ''frequency''<br />
* Label: ''Frequency''<br />
* Type: ''float''<br />
<br />
[[File:EditFrequencyParameterProperties.png|500px]]<br />
<br />
Add the ''frequency'' parameter to the Signal Source ''Frequency'' property:<br />
<br />
[[File:AddFrequencyToSignalSourceProperties.png|500px]]<br />
<br />
The flowgraph should look like:<br />
<br />
[[File:HierBlockSampRateFrequencyParameters.png|500px]]<br />
<br />
== Input and Output Ports ==<br />
<br />
A ''pad'' is used to specify input and output ports on a hier block. Add a ''Pad Source'' and ''Pad Sink'' to the flowgraph to act as the ''in'' and ''out'' ports:<br />
<br />
[[File:AddPadSourcePadSink.png|500px]]<br />
<br />
<br />
== Generate the Hier Block Code ==<br />
<br />
Click ''Generate the flow graph'' to create the ''hier block'' source code:<br />
<br />
[[File:ClickGenerateFlowgraph.png|250px]]<br />
<br />
<br />
A Python ''.py'' file and YAML ''.yml'' file will be created. For GNU Radio v3.8 the files will be created in your home directory:<br />
<br />
<pre>/home/$USER/.grc_gnuradio/</pre><br />
<br />
[[File:HierBlockPyYml.png|500px]]<br />
<br />
For GNU Radio v3.10, the files will be created in the directory where the ''.grc'' file is saved. Please create the ''.grc_gnuradio'' directory and copy the ''.py'' and ''.yml'' files there:<br />
<br />
<pre>$ mkdir /home/$USER/.grc_gnuradio<br />
$ cp FrequencyShifter.block.yml /home/$USER/.grc_gnuradio/<br />
$ cp FrequencyShifter.py /home/$USER/.grc_gnuradio/ </pre><br />
<br />
GRC needs to update the internal list of the blocks before the ''Frequency Shifter'' block can be used in a flowgraph. Click the ''Reload Blocks'' button:<br />
<br />
[[File:ClickReloadBlocks.png|250px]]<br />
<br />
<br />
There is a new category ''GRC Hier Blocks'' in the block library below ''Core'', and the ''Frequency Shifter Block'' can be used in flowgraphs:<br />
<br />
[[File:CoreCategoryOnly.png|300px]]<br />
<br />
[[File:GRCHierBlocksUpdated.png|300px]]<br />
<br />
== Using the Hier Block ==<br />
<br />
The hier block can now be used in a flowgraph. Return the starting flowgraph and delete the ''Signal Source'' and ''Multiply'' blocks:<br />
<br />
[[File:DeleteSignalSourceMultiplyBlock.png|700px]]<br />
<br />
<br />
Add the ''Frequency Shifter Block'' to the workspace and connect it to the rest of the flowgraph:<br />
<br />
[[File:ConnectFrequencyShifterBlock.png|700px]]<br />
<br />
<br />
Edit the ''Frequency Shifter Block'' properties by adding the ''samp_rate'' and ''frequency'' variables:<br />
<br />
[[File:EditFrequencyShifterProperties.png|500px]]<br />
<br />
<br />
Running the flowgraph will bring up the ''QT GUI Frequency Sink'' window with the ''QT QUI Range'' slider:<br />
<br />
[[File:HierBlockFreqSink.png|500px]]<br />
<br />
<br />
Dragging the ''frequency'' slider will pass the value through the ''Frequency Shifter Block'' parameter causing the signal's center frequency to be modified:<br />
<br />
[[File:HierBlockFrequencyShift.png|500px]]<br />
<br />
== Deleting a Hier Block ==<br />
<br />
A hier block can be cleared from GRC memory by removing the files from <code>/home/$USER/.grc_gnuradio</code>.<br />
<br />
In a terminal, move to the <code>.grc_gnuradio</code> directory:<br />
<br />
<pre>cd /home/$USER/.grc_gnuradio</pre><br />
<br />
Then remove the files.<br />
<br />
Warning! The <code>rm</code> command cannot be undone!<br />
<br />
For GNU Radio v3.8 the delete command is:<br />
<br />
<pre>rm FrequencyShifter.py FrequencyShifter.py.block.yml</pre><br />
<br />
[[File:DeleteHierBlockCommand.png|700px]]<br />
<br />
For GNU Radio v3.10 the delete command is:<br />
<br />
<pre>rm FrequencyShifter.py FrequencyShifter.block.yml</pre><br />
<br />
Click the ''Reload Blocks'' button to update GRC's memory of blocks, clearing it of the ''Frequency Shifter'' block:<br />
<br />
[[File:ClickReloadBlocks.png|350px]]<br />
<br />
<br />
The ''GRC Hier Blocks'' category is deleted and only the ''Core'' blocks remain:<br />
<br />
[[File:CoreCategoryOnly.png|350px]]<br />
<br />
<br />
The next tutorial, [[Creating_Your_First_Block|Creating Your First Block]], describes how to use the ''Embedded Python Block'' to create a signal processing block in GNU Radio.</div>67.177.248.173https://wiki.gnuradio.org/index.php?title=GNU_Radio_3.8_OOT_Module_Porting_Guide&diff=12397GNU Radio 3.8 OOT Module Porting Guide2022-07-29T19:18:46Z<p>67.177.248.173: Remove extra 'Notes'</p>
<hr />
<div>[[Category:3.8]]<br />
Brace yourself! 3.8 is here. This document, hopefully, eases the transition of your OOT to our new major version. Furthermore, we think it is a good occasion to establish some standards on how an OOT module should be structured and maintained. More uniformity is an advantage for the users, for you as a OOT maintainer, for the GR devs, since it will be easier to integrate it into PyBOMBS, and for the packagers to ship your OOT module.<br />
<br />
== Development Model ==<br />
GNU Radio recently changed the development model. The longstanding next branch was finally merged in to master. From now on, there will only be a maint-X.Y and a master branch. Releasing 3.8 basically means master will be spin off maint-3.8 with the 3.8.0.0 release commit. After that API-breaking changes for 3.9 will end up in master and 3.8 will be maintained in maint-3.8.<br />
<br />
We suggest, you adapt a similar model in your OOT. That means your maint-3.8 branch is compatible with GNU Radio maint-3.8 and your master branch is compatible GNU Radio master. Trying to maintain a single branch that works with all future, present, and past versions of GNU Radio versions is mess and you’d have to differentiate between too many cases (API changes, XML vs YAML GRC bindings, Python 2 vs 3, QT4 vs QT5, log4cpp support or not, CPPUnit or Boost unit tests, etc.).<br />
<br />
Starting your maint-3.7 branch and tagging the current state as the last one that’s compatible with GR 3.7 could be done with:<br />
<syntaxhighlight><br />
git tag v3.7<br />
git checkout -b maint-3.7<br />
</syntaxhighlight><br />
<br />
== Install GNU Radio 3.8 ==<br />
Start by installing the most recent version of GNU Radio. At the moment, there are no pre-built packages, so checkout the most recent master branch and compile from source. This also updates gr_modtool, which we will use in the following.<br />
<br />
<br />
== CMake Updates ==<br />
<br />
<br />
GNU Radio 3.8 comes with changes to the CMake build system. Going forward CMake syntax in GNU Radio core adheres to "Modern CMake". This means no functions setting global variables like <syntaxhighlight inline>include_directories</syntaxhighlight> and <syntaxhighlight inline>add_definition</syntaxhighlight> will be used. Instead only functions which operate on targets and are prefixed with <syntaxhighlight inline>target_</syntaxhighlight> are used. A reference on "Modern CMake" can be found [https://cliutils.gitlab.io/modern-cmake/ here].<br />
<br />
=== Summary === <br />
<br />
* <syntaxhighlight inline>find_package</syntaxhighlight> is only required for dependencies you directly depend on. E.g. Boost, log4cpp will be handled by the GNU Radio Cmake configuration and linker flags and defines are provided transitively.<br />
* GNU Radio CMake adheres to all CMake policy changes up to CMake 3.11. Remove <syntaxhighlight inline>cmake_policy</syntaxhighlight> function calls which set CMake policy to old.<br />
* <syntaxhighlight inline>GR_</syntaxhighlight> variables won't pollute your environment, only the minimum necessary variables are defined by the GNU Radio CMake configuration<br />
* CppUnit in GNU Radio core has been removed and replaced by Boost UTF, same can be done for your OOT. If you like you can still keep CppUnit though.<br />
* Functions setting global include paths and link_directories should be removed<br />
* Custom CMake modules previously located in cmake/Modules in your tree, especially CMakeParseArgumentsCopy.cmake, FindCppUnit.cmake FindGnuradioRuntime.cmake GrPlatform.cmake GrTest.cmake<br />
* <syntaxhighlight inline>target_link_libraries</syntaxhighlight> can use <syntaxhighlight inline>gnuradio::gnuradio-$component</syntaxhighlight> instead of <syntaxhighlight inline>${GNURADIO_ALL_LIBRARIES</syntaxhighlight><br />
* Instead of <syntaxhighlight inline>include_directories(${CMAKE_CURRENT_SOURCE_DIR)</syntaxhighlight> a special cased target_include_directories can specify include directories for build time and for install time<br />
<br />
The easiest way to update CMake for your OOT might be to use gr_modtool and generate a module with the same name and then copy your source files over. If you have multiple GR versions installed, make sure that gr_modtool uses the correct module template, which is defined in the [modtool] section in ~/.gnuradio/config.conf.<br />
<br />
=== Look at Examples === <br />
If you have doubts about any of the following steps, you might want to have a look at OOTs that were already ported. We know of:<br />
https://github.com/ghostop14/gr-grnet (master branch) <br />
<br />
Updating, for example, gr-foo could be done with<br />
<br />
<syntaxhighlight><br />
gr_modtool newmod foo<br />
</syntaxhighlight><br />
<br />
To see how OOT blocks are handled, you can create a C++ and a Python block to see examples of how they are integrated into build system.<br />
<br />
<syntaxhighlight><br />
cd gr-foo<br />
gr_modtool add<br />
</syntaxhighlight><br />
<br />
Then use a diff tool like meld to compare the differences and apply changes as needed.<br />
<br />
<syntaxhighlight><br />
meld <path-to-your-actual-gr-foo-module> gr-foo<br />
</syntaxhighlight><br />
<br />
=== CMake Modules ===<br />
<br />
One thing you might notice is that there are now less FindXXX.cmake modules needed in your OOT (under cmake/Modules). If your module did not require any custom CMake changes (which is likely), you can just go ahead and delete these modules. They now installed as part of GNU Radio and are available in your CMAKE_MODULE_PATH once GNU Radio was loaded through find_package(Gnuradio [...]).<br />
<br />
Note: In the unlikely case that you module requires custom cmake modules, there’s one tricky bit: At the top of your main CMakeLists.txt file the local cmake modules are put at the beginning of the search path and, therefore, take precedence over the ones installed on your system. However, once GNU Radio is loaded, it will put its cmake path at the front, potentially shadowing local modules. If that’s a problem, put your local path again to the front after GNU Radio is loaded like so:<br />
<br />
<syntaxhighlight><br />
#make sure our local CMake Modules path comes first<br />
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)<br />
</syntaxhighlight><br />
<br />
=== GNU Radio Components ===<br />
<br />
GNU Radio now uses CMake components. So if your OOT depends on GNU Radio modules other than runtime and pmt, you have to import these components through the find_package call. For example, change:<br />
<br />
<syntaxhighlight><br />
set(GR_REQUIRED_COMPONENTS RUNTIME PMT BLOCKS ANALOG FILTER)<br />
find_package(Gnuradio “3.7” REQUIRED)<br />
</syntaxhighlight><br />
<br />
to:<br />
<br />
<syntaxhighlight><br />
find_package(Gnuradio "3.8" REQUIRED COMPONENTS blocks analog filter fft)<br />
</syntaxhighlight><br />
<br />
Moreover, and differently to 3.7, <syntaxhighlight inline>lib/CMakeLists.txt</syntaxhighlight> should also be changed, in particular the call to <syntaxhighlight inline>target_link_libraries</syntaxhighlight>. For example, it could look something like this: <br />
<br />
<syntaxhighlight><br />
target_link_libraries(gnuradio-tempest gnuradio::gnuradio-runtime gnuradio::gnuradio-blocks gnuradio::gnuradio-fft gnuradio::gnuradio-filter Volk::volk)<br />
</syntaxhighlight><br />
<br />
Note: Currently the build system doesn’t resolve internal dependent components automatically. The filter component, for example, depends on fft, so it had to be added manually to the list of components above.<br />
<br />
== Python Blocks ==<br />
In python/__init__.py each block must be changed to relative import by putting a period before the block name<br />
<br />
<syntaxhighlight><br />
# import any pure python here<br />
from .foo import foo<br />
</syntaxhighlight><br />
<br />
== Versioning ==<br />
Version your OOT similar to GR?<br />
<br />
== Porting QA Tests ==<br />
<br />
== API Changes ==<br />
At this point, you should be able to recompile the module. Here you can test if you run into any issues with C++ API changes. <br />
<br />
XML to YAML Conversion<br />
The GNU Radio Companion (GRC) bindings are no longer defined in XML but in YAML. To ease the transition, GNU Radio comes with a converter that should do 95% of the work. Make sure your grc bindings are in the grc folder and use the <module name>_<block name>.xml naming scheme. Then, from the root directory of your module, do:<br />
<br />
<syntaxhighlight><br />
gr_modtool update --complete<br />
</syntaxhighlight><br />
<br />
If there are any problems reported you’ll have to fix the by hand.<br />
<br />
Todo: link to examples and documentation<br />
<br />
Don’t forget to update the file names in the grc/CMakeLists.txt file to make sure that the YAML files are installed.<br />
<br />
== WX is Gone ==<br />
GNU Radio 3.8 drops support for WX GUI widgets in favor of QT. If you are using WX widgets in your flow graph, you’d have to replace them with the corresponding QT widgets. For most flow graphs that should be a straight forward drop in replacement. <br />
<br />
== Update PyBombs Recipe ==<br />
If your OOT module is listed in a receipt file for PyBombs, please update, if needed, your Manifest.md file and the receipt.<br />
<br />
== Still not Working? ==<br />
If you have any issues porting your OOT, please join our Slack channel or write to the GNU Radio mailing list. We are happy to help and to improve this guide.<br />
<br />
== Notes ==<br />
Make sure gr-dev package installs cmake modules<br />
Delete unnecessary cmake modules in OOT<br />
Make sure local CMake module path is not shadowed by GR. (does GR have to insert cmake to the front?)<br />
use grcc (through cmake command) to build and install hier blocks<br />
gr_modtool uses ENABLE_GRC how, where, when is this supposed to be set? There does not seem to be a GRC component that can be imported.<br />
Where is Gnuradio_FIND_COMPONETS supposed to be set. It required to make targets available in OOTs.<br />
/ Discuss<br />
What is the PyBombs way to migrate GR and OOTs to 3.8?<br />
Recommendation for branches/development concept</div>67.177.248.173