X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=README.hacking;h=ff01a0a539e40c52853f2b4120f12a403e3ce1a2;hb=26185e9077e5e20f71fb515c0e847a5dfd57986c;hp=7e211e0b35673babe2edbb00a7ba29bc8787a218;hpb=559f82a0d10f604b0b27cfb8663d93b1625dbd8b;p=debian%2Fgnuradio diff --git a/README.hacking b/README.hacking index 7e211e0b..ff01a0a5 100644 --- a/README.hacking +++ b/README.hacking @@ -1,12 +1,12 @@ # -*- Outline -*- # -# Copyright 2004 Free Software Foundation, Inc. +# Copyright 2004,2007,2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, @@ -16,24 +16,31 @@ # # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. # - Random notes on coding conventions, some explanations about why things aren't done differently, etc, etc, +* Boost 1.35 + +Until boost 1.35 or later is common in distributions, you'll need to +build boost from source yourself. See README.building-boost. + +Also, when running make distcheck you'll need to provide the +DISTCHECK_CONFIGURE_FLAGS. E.g., + + $ make distcheck DISTCHECK_CONFIGURE_FLAGS=--with-boost=/opt/boost_1_36_0 + + * C++ and Python GNU Radio is now a hybrid system. Some parts of the system are built in C++ and some of it in Python. In general, prefer Python to C++. Signal processing primitives are still built in C++ for performance. -It is no longer possible to build user applications entirely in C++. -Essential parts of the runtime system have been moved into Python. - * C++ namespaces @@ -170,9 +177,172 @@ library and into the program. I haven't tested out this idea. We use the standard unittest package for unit testing of Python code. +* Subversion line ending styles + +All text files in the tree should have the subversion property +'svn:eol-style' set to 'native', with the following exceptions: + +config/*.m4 +configure.ac +gr-howto-write-a-block/config/*.m4 +gr-howto-write-a-block/configure.ac + +The easiest way to ensure this is to add or edit the following lines in +your svn client configuration file (~/.subversion/config): + +enable-auto-props=yes + +[auto-props] +*.c = svn:eol-style=native +*.cc = svn:eol-style=native +*.i = svn:eol-style=native +*.h = svn:eol-style=native +*.am = svn:eol-style=native +*.py = svn:eol-style=native +*.ac = svn:eol-style=LF +*.m4 = svn:eol-style=LF + * Misc tips ccache, a compiler cache, can really speed up your builds. See http://ccache.samba.org/ Be sure to create links for gcc and g++ + + +* Standard command line options + +When writing programs that are executable from the command line, +please follow these guidelines for command line argument names (short +and long) and types of the arguments. We list them below using the +Python optparse syntax. In general, the default value should be coded +into the help string using the "... [default=%default]" syntax. + +** Mandatory options by gr_block + +*** USRP source + +Any program using a USRP source (usrp.source_*) shall include: + + add_option("", "--which-usrp", type="intx", default=0, + help="select which USRP to use [default=%default]") + + add_option("-R", "--rx-subdev-spec", type="subdev", default=(0, 0), + help="select USRP Rx side A or B [default=A]") + +You are free to change the default if it makes sense in your application. + + +*** USRP sink + +Any program using a USRP sink (usrp.sink_*) shall include: + + add_option("", "--which-usrp", type="intx", default=0, + help="select which USRP to use [default=%default]") + + add_option("-T", "--tx-subdev-spec", type="subdev", default=(0, 0), + help="select USRP Tx side A or B [default=A]") + +You are free to change the default if it makes sense in your application. + + +*** Audio source + +Any program using an audio source shall include: + + add_option("-I", "--audio-input", type="string", default="", + help="pcm input device name. E.g., hw:0,0 or /dev/dsp") + +The default must be "". This allows an audio module-dependent default +to be specified in the user preferences file. + + +*** Audio sink + + add_option("-O", "--audio-output", type="string", default="", + help="pcm output device name. E.g., hw:0,0 or /dev/dsp") + +The default must be "". This allows an audio module-dependent default +to be specified in the user preferences file. + + +** Standard options names by parameter + +Whenever you want an integer, use the "intx" type. This allows the +user to input decimal, hex or octal numbers. E.g., 10, 012, 0xa. + +Whenever you want a float, use the "eng_float" type. This allows the +user to input numbers with SI suffixes. E.g, 10000, 10k, 10M, 10m, 92.1M + +If your program allows the user to specify values for any of the +following parameters, please use these options to specify them: + + +To specify a frequency (typically an RF center frequency) use: + + add_option("-f", "--freq", type="eng_float", default=, + help="set frequency to FREQ [default=%default]") + + +To specify a decimation factor use: + + add_option("-d", "--decim", type="intx", default=, + help="set decimation rate to DECIM [default=%default]") + + +To specify an interpolation factor use: + + add_option("-i", "--interp", type="intx", default=, + help="set interpolation rate to INTERP [default=%default]") + + +To specify a gain setting use: + + add_option("-g", "--gain", type="eng_float", default=, + help="set gain in dB [default=%default]") + + +If your application specifies both a tx and an rx gain, use: + + add_option("", "--rx-gain", type="eng_float", default=, + help="set receive gain in dB [default=%default]") + + add_option("", "--tx-gain", type="eng_float", default=, + help="set transmit gain in dB [default=%default]") + + +To specify the number of channels of something use: + + add_option("-n", "--nchannels", type="intx", default=1, + help="specify number of channels [default=%default]") + + +To specify an output filename use: + + add_option("-o", "--output-filename", type="string", default=, + help="specify output-filename [default=%default]") + + +To specify a rate use: + + add_option("-r", "--bit-rate", type="eng_float", default=, + help="specify bit-rate [default=%default]") + or + + add_option("-r", "--sample-rate", type="eng_float", default=, + help="specify sample-rate [default=%default]") + + +If your application has a verbose option, use: + + add_option('-v', '--verbose', action="store_true", default=False, + help="verbose output") + + +If your application allows the user to specify the "fast USB" options, use: + + add_option("", "--fusb-block-size", type="intx", default=0, + help="specify fast usb block size [default=%default]") + + add_option("", "--fusb-nblocks", type="intx", default=0, + help="specify number of fast usb blocks [default=%default]")