Give me my liberty or give me a sandwich.

Thursday, August 03, 2006

FORTRAN on Windows : A heady mixture

I have lot of friends in software and IT industry. They've been there long before I learned to write a C header file. Most of them had taken Fortran to a be dead language. It was something you learn in collage for Numerical Anaylsis and Computer Programming (NACP) course and then forget its existence for rest of your life. Something you will never see again in your lifetime (like a good Hindi movie). But there are few things you just can't kill (like Darth Vader). It lives in the hearts of its fans (short for fanatics). They may not be many, but they are ferocious. To make it worse, many of them are in love with Microsoft Windows.

I took up a job at a grid computing company. I was hired for my mechanical engineering skills (surprise!!!) and Fortran skills (about which I didn't know till recently). No surprises, I was handed a project in badly written Fortran. Then they told me that most of the expected customers are going to be Windows users. WOW!!! How do you program in a language that every programmer thinks is dead, on an operating system where nothing really works.

One of my guardian angles told me: Get CMake and cygwin. Do what ever you want do, on Linux. When you think you have done enough to survive, bring it on Windows and CMake will do the rest for you.
Only if the life was that simple? IFC will break your VS 7 installation. Command line cmake won't work for Fortran. IFC log function will give different results for same number, when called from multithread-supporting library. WTF?

I survived, but barely.

A program is defined badly written when, the guy who wrote it originally is dead and current releases only have bug-fixes from the previous releases.