source: trunk/README.developer @ 2451

Last change on this file since 2451 was 2451, checked in by Peter, 11 years ago

update copyright years

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