| Andrew Chen 2008-01-17, 7:14 pm |
| Bil,
" > Uh oh, you've gone to the dark side! :) "
Haha, Ruby was the fun part!
It turned out that FORTRAN is a very structured language to generate,
and Ruby is really a powerful tool!
The main goals of FRUIT are:
1) have FORTRAN code unit tested.
2) make TDD possible in FORTRAN
Ruby is only used to generate FORTRAN driver code. All core parts of
FRUIT are pure FORTRAN (95). User can use FRUIT without the Ruby
part. See my example: "Add Fruit to Your Diet in 3 Minutes - TDD in
FORTRAN" (http://fortranxunit.wiki.sourceforge.net/FruitExample). It
is pure FORTRAN.
>
>
> Excellent; I've been thinking along those lines.
It took me a while to re-make the whole build system in rake.
Discussion of rake vs. make is a little off the FORTRAN topic here,
however, each FORTRAN developer has to maintain some kind of build
system.
Rake has many advantages over make, to compile traditional language:
1. It handles wild-card better. By adding one a.f90, I don't have to
specify that in 4 different places in Makefile. I don't need to do
anything. Well, make can do this, kind of.
2. It handles generated code well. I have a situation that new
FORTRAN modules (drivers) source codes are generated based on test
codes. The build system has to build the original test modules first,
then build the drivers. Rake could handle it.
3. The rakefile is simple and elegant. I don't have to maintain 500
lines Makefile any more.
4. Rake comes with clean and clobber target.
5. Rake can communicate with ruby, and other gems natively. So it is
a lot more powerful than Makefile.
I think the build system comes with FRUIT can be scaled up if you need
one rake example for FORTRAN/C/C++, or mixed languages.
Cheers!
~Andrew Chen
|