1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Main Page

From blockit

Jump to: navigation, search


Getting Started

This wiki is intended to help users and developers of BlockIt utilities understand and learn the concepts needed to succeed in their endeavors. The Getting Started page serves as an introduction to BlockIt, and discusses the PyF95++ tool which implements block parsing for Fortran 90 thru 2008 (which we know won't be fully implemented in any compiler until after 2142 and that's actually pretty okay by all of us).

There are several categories currently used in this wiki and can be found at the Categories page. Those interested in developing utilities and templated types to be used in compiled languages like Fortran, C, and C++ should familiarize themselves with the Tools used so that they may develop safe and reusable tools. Of course you could search for a random page, or look at the complete list of pages, and pick your favorite.

Feel free to send the developers emails with comments, suggestions, or requests. Also check out the tools for submission of bugs and feature requests via SourceForge. Assistance in developing and expanding this wiki documentation is also most welcome!


Download the latest BlockIt tarball or better yet clone the public git repository (git://blockit.git.sourceforge.net/gitroot/blockit/blockit) on sourceforge. The README file in the project should be self explanatory. Information on the git branching strategy can be found at nvie.com

Essentially the unzipped directory contains the full project which can be run from where it is, but is better installed. In the directory run "make install" to copy the appropriate files to the selected directory (default is ~/slash/). For use of PyF95++, a few environment variables should be set: PyF95_TEMPLATE_DIR, PyF95_SRC_DIR, PyF95_ADDON_DIR, PyF95_POD_DIR, and PyF95_INC_DIR. More information on these environment variables can be found on the Installing page.


Several tutorials are available for using PyF95++ for advanced Fortran programming. See the tutorials page for more information.

Why Use BlockIt?

BlockIt is quite simply a dumb parser. It uses pyparsing to parse out "blocks" of code which are cognizant of their parents, children, and dependencies. These blocks are inserted in a symbol table and lookups can be performed as necessary. The real power is what has been built upon the parser.

In a comparison of C++ and Fortran 90 for OO scientific programming, Cary, et al. stated the following:

"The most critical feature missing in Fortran 90 is the template..." [1]

The inventor of BlockIt took this to heart, and, having started life as a functional programmer and moved into the world of OOP only to be sucked back to a spinning nightmare of F77 style spaghetti code, did something about it. Thus PyF95++ was born (though now it may more aptly be called PyF03++ due to the excellent features that will one day (probably about 2042) be implemented). The primary difference between the initial version of this "templater" and the one built into C++ is that PyF95++ was not built into a compiler. It was, and always shall remain, a separate pre-processor. This gives several advantages over integration with a compiler:

  1. It spits out your code -- really and truly -- in pure Fortran to do with as YOU see fit. The inventor's major beef (and mine too) with C++ templating, Microsoft products, etc. is that they take our words and information and put them in their proprietary format. Object code is not really proprietary, but would it be so tough for a compiler to dump a human-readable form of the code it's compiling somewhere when it's done crunching on it?
  2. It is not tied to compiler releases and can be worked by the community.
  3. Specialization can be achieved by individual users. Customization is the name of the game and you are free to make the craziest features and code utilities you can imagine.
  4. It runs in Python and as a result, has access to ALL of Python. If you want to do symbolic manipulation on your Fortran code and write back out some polynomials which were formed by multiplying expressions that you put into a template parameter list, DO IT. Download Sage, install the egg, and write a POD to access the functions the way you want.
  5. Some will say this is overstated, but I truly with all my mind/body/soul/basil-in-the-back-yard believe This Tool Has NO Bounds. Python is now your pre-processor. Hmmm. You have a full language at your disposal to produce your code any which way you see fit.
  6. All the hard and redundant code has now been placed at your finger tips: Queues, Stacks, Lists, a Unit Testing framework, reference counting, and much more!
  7. PyF95++ is on Facebook, and although there is no useful content there, we would greatly appreciate it if everyone would join the page to help spread the word about BlockIt! See, we're hip. We're cool. We're with the times, so to speak.
Toolset Description
UnitTest A fully featured unit-testing framework


PyF95++ PyF95_MakeDepend

Have Problems?

Check the Errors page for some common issues. If your problem is not listed, please submit a support request or a bug report through the SourceForge tracker.


http://blockit.sourceforge.net/doxygenpages/index.html is a usually up-to-date listing of the Doxygen source code documentation for the blockit project.

The changelog is also available.


[1] Cary, J. R., Shasharina, S. G., Cummings, J. C. ,Reynders, J. V. W., and Hinker, P. J., "Comparison of C++ and Fortran 90 for Object-Oriented Scientific Programming", Los Alamos National Lab, Report No. LA-UR-96-4064, 1996.

[2] Car, D., and List, M., PyF95++: A Templating Capability for the Fortran 95/2003 Language, ACM Fortran Forum, 29(1), pp 2-20, 2010.

[3] List, M., and Car, D., A Fortran Unit-Testing Framework Utilizing Templating and the PyF95++ Toolset, ACM Fortran Forum, 30(1), pp 3-15, 2011.

Personal tools