source: trunk/README.developer @ 2500

Last change on this file since 2500 was 2500, checked in by Peter, 12 years ago

document that developers should have doxygen available. refs #392

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mime-type set to text/x-trac-wiki
File size: 8.6 KB
RevLine 
[2]1$Id: README.developer 2500 2011-06-26 21:47:14Z peter $
2
[1674]3= Coding Style =
[1605]4
[1674]5We follow the coding style described in
6[http://cbbp.thep.lu.se/~jari/documents/c++_coding_guidelines/index.html C++ coding guidelines]
7[http://cbbp.thep.lu.se/~jari/documents/c++_coding_guidelines/c++_coding_guidelines.pdf pdf] 
8[http://cbbp.thep.lu.se/~jari/documents/c++_coding_guidelines/c++_coding_guidelines.ps postscript]
9with the additions described here.
10
[1721]11=== Subversion usage ===
12
13Commits should be minimalistic and the project should always compile
14(`make` and `make check`) when someone makes a clean checkout. There
15is a short introduction to subversion and its usage available as
[2404]16[http://cbbp.thep.lu.se/~jari/documents/subversion_guidelines/index.html Subversion guidelines].
17We follow these guidelines.
[1721]18
[1674]19=== Testing ===
20
[1721]21The test suite is run with `make check` at the project root directory
22level.
[1674]23
[1721]24The test suite should at minimum include creation of all classes (to
25catch linking errors) and calls to template functions (as template
26functions are not compiled until they are needed). There is a test
[2500]27that checks that minimum amount of documentation is written. This test
28is skipped if doxygen is not available and for that reason it is
29recommended to have doxygen available if you modify header files.
[1721]30
31For more details on writing and running tests, see file
32[source:trunk/test/README test/README].
33
[1674]34=== Interfacing [http://www.gnu.org/software/gsl/ Gnu Scientific Library, GSL] ===
35
36The GSL documentation describes how
[2404]37[http://www.gnu.org/software/gsl/manual/html_node/Error-Handling.html GSL error handling]
[1674]38works. The GSL library follows the thread-safe
39error reporting conventions of the posix Threads library. That is,
40functions return a non-zero error code to indicate an error. In most
41cases yat just returns whatever the underlying GSL library calls
42returns. If GSL errors occur in constructors yat handles them
43accordingly. If GSL reports errors that cannot be resolved by yat a
44[http://cbbp.thep.lu.se/~jari/documents/yat/classtheplu_1_1yat_1_1utility_1_1GSL__error.html GSL_error]
45exception will be thrown. However, the default behaviour of
46GSL library is to call abort() when unrecoverable errors occur and
47puts the yat (and any other) GSL error treatment out of play. For
[2067]48production environments, yat and GSL users should turn off the default
[1674]49GSL error treatment by calling gsl_set_error_handler_off(), but also
50when yat's GSL error treatment is preferred.
51
52When new GSL functionality is introduced to yat, it is the
[1721]53responsibility of the programmer to make sure that GSL errors are
[1674]54treated properly. Proper GSL error treatment is very important in
55cases when yat users turn off the default GSL error handler since:
56
57yat aims at treating GSL errors appropriately in an
58[http://www.gotw.ca/gotw/008.htm exception safe and neutral]
59way but there is still some work to do before we do exceptions in a neutral way.
60
61=== Doxygen ===
[2071]62We generate our documentation using [http://www.doxygen.org Doxygen]
63(version 1.5 or later). Doxygen allows several different styles. We
64try to use the following style as we have found this minimizes parsing
65problems:
[1674]66
67{{{
68/**
69   \brief My class
70
71   Some text documenting the class MyClass
72*/
73class MyClass
74}}}
75
76or similarly
77
78{{{
79/**
80   \brief magic function
81
82   Some text documenting my_function
83*/
84void my_function(void);
85}}}
86
[2071]87We use doxygen keywords preceded by `\` such as `\brief`,
88`\return`. All classes and functions have a brief description, which
89increases clarity on summary pages.
[1674]90
[2071]91Try to keep comment line lengths within the terminal character limit,
92in other words, less than 80 characters per line. This makes the
93comments more readable.
[1674]94
95'''Internal Interface'''
96
97Helper functions and classes that are not part of yat API should either be
98labeled with doxygen flag `\internal` or placed in sub-namespace `detail`.
99
100= Build =
101
102== Requirements ==
103
[2404]104To build from a subversion checkout, you will need GNU Autotools. More
[1674]105specifically
[2404]106 * Automake 1.11 (or later), http://www.gnu.org/software/automake/
107 * Autoconf 2.63 (or later), http://www.gnu.org/software/automake/
108 * Libtool 1.5 (or later), http://www.gnu.org/software/libtool/
[1605]109
[1674]110== Disable shared library ==
[573]111
[2404]112yat uses GNU Libtool in order to build shared libraries on a variety
[1368]113of systems.  While this is very nice for making usable binaries, it
114can be a pain when trying to debug a program. For that reason,
115compilation of shared libraries can be turned off by specifying the
116`--disable-shared` option to configure.
117
[1674]118== Debugging using GDB ==
[1372]119
[2404]120If shared library is enabled (default), Libtool creates wrapper
121scripts in directory `test/` that call the test programs located in
122directory `test/.libs/`. While this allows us to dynamically link against
123the temporary library in `yat/`, it makes straightforward usage of GDB
[1372]124impossible. For that reason libtool provides a wrapper:
125
126`#> libtool --mode=execute gdb foo_test`
127
128that sets the necessary environment variables. For more detailed
129discussion, please refer to the libtool manual:
130
131http://www.gnu.org/software/libtool/manual/libtool.html#Debugging-executables
132
[1674]133= Versioning =
134
[2404]135We use a softened version of
136[http://apr.apache.org/versioning.html APR guidelines] which in short implies
[1674]137
138''"The basic intent is that '''`MAJOR`''' versions are incompatible,
[2404]139large-scale upgrades of the API. '''`MINOR`''' versions retain
140compatibility with older minor versions, and changes in the
141'''`PATCH`''' level are perfectly compatible, forwards and
142backwards."''
[1674]143
144== '''`MAJOR`''' Releases ==
145
146No compatibility is guaranteed between '''`MAJOR`''' versions.
147
148== '''`MINOR`''' Releases ==
149
150'''`MINOR`''' versions should be compatible with earlier minor
151versions. However, in the `0.x` line we may allow exceptions to this
152rule, if developers agree the gain of change is sufficient. Binary compatibility is typically not guaranteed between '''`MINOR`''' versions. The `YAT_LT_VERSION` in [source:trunk/build_support/version.m4 version.m4] should reflect which versions are binary compatible.
153 
154== '''`PATCH`''' Releases ==
155
156Versions with same '''`MAJOR.MINOR`''' are perfectly compatible,
157forwards and backwards.
158 
159This implies that only implementations can be modified in a `PATCH`
160release. You cannot change the API, not even add functions or
161classes because it will break forward compatibility for the previous
162`PATCH` version. A `PATCH` release is a pure bug fix release
163
164=== Backward Source Compatibility ===
165
166Backward Source Compatibility means that an application that could build
167against version `x.y` shall also build without error against
168`x.y+1`. An application that compiled against header files from
169previous `MINOR` version shall also compile without errors against the
170header files of the new version.
171
172Specifically this implies:
173  - Do not remove any public, protected, or free functions.
174  - If you modify a function, its signature must be compatible with
175    previous signature, e.g., new parameters with default values may
[1721]176    be added to signature.
[1674]177  - Do not remove any class or inheritance for a class.
178
179=== Backward Binary Compatibility ===
180
181Backward Binary Compatibility means that an application that has been
182compiled against version `x.y` can be linked against version
183`x.y+1`.
184
185Specifically this implies:
186
187  - Do not remove or modify any function (except private), not even
188    add a parameter with default value because it will make the
189    function incompatible with earlier header files.
190
191  - Do not add, remove, or modify member variables, because that will
192    change the allocated size of the class. Therefore, to allow
193    modifications of the internal representation, it is preferable to
194    hold member variable is a ''pimpl'' that is allocated privately.
195    http://developer.gnome.org/doc/guides/programming-guidelines/binary.html
196
197  - Do not add or change order among virtual functions because it will
198    change the layout of the virtual table.
199
200
201
202
[1262]203----------------------------------------------------------------------
204{{{
[2119]205Copyright (C) 2003 Jari Häkkinen, Peter Johansson
206Copyright (C) 2004 Jari Häkkinen
207Copyright (C) 2006, 2007, 2008, 2009 Jari Häkkinen, Peter Johansson
[2451]208Copyright (C) 2010, 2011 Peter Johansson
[1262]209
[1469]210This file is part of yat library, http://dev.thep.lu.se/yat
[1262]211
212The yat library is free software; you can redistribute it and/or
213modify it under the terms of the GNU General Public License as
[1486]214published by the Free Software Foundation; either version 3 of the
[1262]215License, or (at your option) any later version.
216
217The yat library is distributed in the hope that it will be useful, but
218WITHOUT ANY WARRANTY; without even the implied warranty of
219MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
220General Public License for more details.
221
222You should have received a copy of the GNU General Public License
[1487]223along with yat. If not, see <http://www.gnu.org/licenses/>.
[1262]224}}}
Note: See TracBrowser for help on using the repository browser.