Welcome!

Open Source Authors: Maureen O'Gara, Jeremy Geelan, Liz McMillan, Reuven Cohen, Lavenya Dilip

Related Topics: Open Source

Open Source: Article

Migration of Legacy Scientific and Engineering Applications

From mainframes to PCs with open source technologies

The program is written with VB.Net (compatible with VB.Net 2003 and 2005); VB.Net 2005 professional edition was used to develop and compile the program. However, nothing will prevent you from compiling it using the free Visual Basic 2005 express edition.

To call G77 from Crimson (or VS.Net if it is already installed on your PC), the program emulates the user who is typing within CygWin by doing the following:

  • Starting CygWin
  • Sending appropriate keystrokes to CygWin for calling G77
  • Redirecting G77 standard output and errors (if any) into special variables
  • Closing CygWin
  • Calling Notepad and filling it out with G77 errors (if any)
The program will be started from the command line when appropriate points are selected from the menu within Crimson or VS.Net 2005 (please see above for a similar activity with regard to the calling of a native or external compiler from the IDE). Debugging note: G77 errors (if any) are written in a special file within the directory from which the program was called; after you make sure the program works, you may want to delete or comment out the related block of code.

Similar functionality probably can be achieved with other languages (for instance, with Java using java.awt.Robot for sending keys and using other means to redirect G77 standard output and errors, etc.), but as we work under Windows XP within this article, you may find that using VB.Net is more convenient. The source code for the program is given in Listing 1.

There are several hard-coded values that are used within the program. Most will be correct (for instance, the hard-coded location for CygWin), but others will need to be adjusted (like the name of your CygWin home directory).

It is assumed that the code (received from the mainframe as described earlier) will be placed under any subdirectory of your CygWin home directory. This assumption works for me. However, the program can easily be adjusted, if needed, to work with a directory from any reasonable location. (Please keep in mind that CygWin, like any software, has its own limitations.)

Use of the program within Crimson and VS.Net 2005 is simple and illustrated in Figures 1 and 2. What you need to do is put the executable file of the program (the name used in this article is: SendingKeysToCygwinAndRedirectOut.exe) under some directory of your choice that you may want to include in Windows XP path (in this article, it is C:\G77Start). Next, include the needed calls in your Tools | Conf. User tools for Crimson (See Figure 1) or Tools | External tools for VS.Net 2005 (See Figure 2). In this article, the menu text for the call is G77start. At this point, you may call G77 within CygWin from Crimson or from VS.Net 2005 by selecting Tools | G77start, and you will see the results in Notepad.

To test this technique, you may use my file for performance measurement (dwhet.f from www.myjavaserver.com/~akrivitsky/G77.html). First, use it "as is" within Crimson or VS.Net 2005. In this case, no meaningful error message will be returned. Second, copy this file to dwhet_error.f, and, within Crimson or VS.Net 2005, type the word "error" in the place of your choice. In this case, you will obtain the appropriate error message from G77.

Note that similar techniques can be applied to programs written in C, or any other legacy application language, with appropriate compilers that exist both in mainframes and CygWin.

What Was Done
The described technology that is based on free and open sourced CygWin will allow (in many cases) the migration of legacy applications from mainframes to PCs. The only thing you need to purchase is Quick327- which is very cheap - if you don't have it installed already. All other products used for the technology are either free or require no additional investments, which makes the described migration budget-friendly.

Resources

  • A.S. Krivitskii, et. al. (1995). "A System of Equations for Calculating on a Personal Computer the Thermodynamic Properties of Water and Steam on the Saturation Curve." Thermal Engineering. Vol. 42, no. 12.
  • A.S. Krivitsky, et. al. (1996). "Tables of Thermodynamic Derivatives for Water and Steam." Electrogorsk Research and Engineering Centre of Nuclear Power Plants.
  • A. Krivitsky. (2005). "Remote Benchmarking with Servlets and JSF." JDJ. Vol.10, issue 5.
  • A. Krivitsky. (2006). "Running Fedora Core 5 Under Windows XP - Tips and Tricks." LinuxWorld. Vol. 4, issue 5.
  • A. Krivitsky." (2006). "The Best of Both Worlds: Debugging Linux/Unix code using Windows XP software development tools." Enterprise OpenSource. Vol. 4, issue 8.
  • My Web site: www.myjavaserver.com/~akrivitsky/.
  • More Stories By Anatoly Krivitsky

    Anatoly Krivitsky has a PhD in computer science and has more than 24 years of working experience in the IT field. He's the author of 20 published papers and books and five patents. For more information, please visit http://www.myjavaserver.com/~akrivitsky/index.html.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.