Difference between revisions of "Contributing new programs to Madagascar"

From Madagascar
Jump to navigation Jump to search
(moved content from Manual)
Line 11: Line 11:
 
If you introduce or notice a feature that is used solely for backwards compatibility with an old version of a dependency, please document it here, so that the feature can be eliminated when the Madagascar community stops supporting that version of that dependency. This could be more elegantly done by using a special string to flag a backwards compatibility comment in the code, then have the documentation builder build this list automatically. This would make it more likely for this page to be kept in synch with the codebase.
 
If you introduce or notice a feature that is used solely for backwards compatibility with an old version of a dependency, please document it here, so that the feature can be eliminated when the Madagascar community stops supporting that version of that dependency. This could be more elegantly done by using a special string to flag a backwards compatibility comment in the code, then have the documentation builder build this list automatically. This would make it more likely for this page to be kept in synch with the codebase.
  
==Python 2.2 and older==
+
===Python 2.2 and older===
 
* In <tt>framework/rsfdoc.py</tt>: Everything in the <tt>have_datetime_module=False</tt> branches
 
* In <tt>framework/rsfdoc.py</tt>: Everything in the <tt>have_datetime_module=False</tt> branches
  
==Python 2.3 and older==
+
===Python 2.3 and older===
 
* In <tt>user/ivlad/ivlad.py</tt>: Everything in the <tt>have_subprocess=False</tt> branches
 
* In <tt>user/ivlad/ivlad.py</tt>: Everything in the <tt>have_subprocess=False</tt> branches
 
* The entire <tt>api/python/rsfbak.py</tt> (also needed on systems which do not have recent versions of numpy ''and'' SWIG)
 
* The entire <tt>api/python/rsfbak.py</tt> (also needed on systems which do not have recent versions of numpy ''and'' SWIG)
 +
 +
==cfortran.h==
 +
This source code file provides a machine-independent interface between C procedures, Fortran procedures and global data (more details [http://www-zeus.desy.de/~burow/cfortran/ on the website of its initial author]). It is a dependency of the F77 and F90 APIs, as well as of vplot. It is included in m8r in two places. Version 4.3 (2002) is still distributed through the website of the original author. Another version (fork?) is [http://root.cern.ch/viewvc/trunk/montecarlo/eg/inc/cfortran.h?view=log maintained at CERN] and distributed in the include directory of the interface to event generators in the Monte Carlo libraries in the [http://cernlib.web.cern.ch/cernlib/ CERN Program Library] (CERNlib). Debian distributes the Free Software part of this package as <tt>cernlib</tt>. Under Fedora, <tt>cfortran.h</tt> is included in <tt>cernlib-g77-devel</tt> and <tt>cernlib-devel</tt>, which happily overwrite each other's files and create copies of <tt>cfortran.h</tt> in two different locations deeply nested under <tt>/usr/include</tt>. CERNlib's Debian maintainer states that [http://people.debian.org/~kmccarty/cernlib/index.html "CERNlib is an ancient mass of mostly Fortran code"] and that [http://people.debian.org/~kmccarty/physics-software-rant.html "Most components of CERNLIB are completely broken on modern 64-bit architectures"], so m8r developers should be aware that CERNlib will probably be superseded at some point in the future by [http://en.wikipedia.org/wiki/ROOT ROOT], with upstream <tt>cfortran.h</tt> maintenance possibly continuing this way.
 +
 +
==Automated code checks==
 +
Madagascar contains the beginning of an implementation of static code checks for security vulnerabilities and coding mistakes with [http://www.splint.org/ Splint]. This is visible in the code through the presence of comments like <tt>/*@out@*/</tt> and <tt>/*@null@*/</tt>, which instruct Splint about the intent of different variables and function return values. Future plans include using also dynamic checking by [http://valgrind.org/ Valgrind] or IBM's [http://www-306.ibm.com/software/awdtools/purify/ Rational Purify].

Revision as of 11:16, 9 January 2009

Fotolia 10977350 XS.jpg

This page is intended for developers maintaining Madagascar infrastructure and programs.

Style suggestions

Please try to:

  • Do atomic commits
  • Use svn commit -m "your message here" to let others know what changed
  • If you plan to do large-scale substantive changes, use a repository branch

Backward compatibility features

If you introduce or notice a feature that is used solely for backwards compatibility with an old version of a dependency, please document it here, so that the feature can be eliminated when the Madagascar community stops supporting that version of that dependency. This could be more elegantly done by using a special string to flag a backwards compatibility comment in the code, then have the documentation builder build this list automatically. This would make it more likely for this page to be kept in synch with the codebase.

Python 2.2 and older

  • In framework/rsfdoc.py: Everything in the have_datetime_module=False branches

Python 2.3 and older

  • In user/ivlad/ivlad.py: Everything in the have_subprocess=False branches
  • The entire api/python/rsfbak.py (also needed on systems which do not have recent versions of numpy and SWIG)

cfortran.h

This source code file provides a machine-independent interface between C procedures, Fortran procedures and global data (more details on the website of its initial author). It is a dependency of the F77 and F90 APIs, as well as of vplot. It is included in m8r in two places. Version 4.3 (2002) is still distributed through the website of the original author. Another version (fork?) is maintained at CERN and distributed in the include directory of the interface to event generators in the Monte Carlo libraries in the CERN Program Library (CERNlib). Debian distributes the Free Software part of this package as cernlib. Under Fedora, cfortran.h is included in cernlib-g77-devel and cernlib-devel, which happily overwrite each other's files and create copies of cfortran.h in two different locations deeply nested under /usr/include. CERNlib's Debian maintainer states that "CERNlib is an ancient mass of mostly Fortran code" and that "Most components of CERNLIB are completely broken on modern 64-bit architectures", so m8r developers should be aware that CERNlib will probably be superseded at some point in the future by ROOT, with upstream cfortran.h maintenance possibly continuing this way.

Automated code checks

Madagascar contains the beginning of an implementation of static code checks for security vulnerabilities and coding mistakes with Splint. This is visible in the code through the presence of comments like /*@out@*/ and /*@null@*/, which instruct Splint about the intent of different variables and function return values. Future plans include using also dynamic checking by Valgrind or IBM's Rational Purify.