Blonde Guy

OpenWatcom FORTRAN 77

For FORTRAN users on the OS/2 platform, OpenWatcom F77 is a supported environment with both command line and Integrated Development Environment (IDE) support. OpenWatcom F77 gives FORTRAN users access to OS/2 system features. Sample programs and documentation aid new users in learning to use the product.

OpenWatcom is open-source. Serious developerers may want to consider learning to build the compiler themselves in order to submit bug fixes and enhancements to the product.

OpenWatcom FORTRAN is a cross compiler. If you have installed the product on OS/2 with the appropriate support, you can build executable programs for 32-bit Windows, 16-bit Windows, DOS, Novell and Linux.

Obtaining and Installing OpenWatcomF77

OpenWatcom maintains a website at http://www.openwatcom.org/ which provides downloads of the latest product from ftp://ftp.openwatcom.org/. At the time this article was last updated the released version of FORTRAN for OS/2 is 1.8. The OS/2 installer, 60,550,243 bytes, is a single file OS/2 executable program.

To install, run the installer. Choose an installation directory that does not contain a space character, i.e. not "\Program Files\Watcom" but rather "\Watcom". My preference is to skip updating the OS/2 Config.Sys file. In that case, to use the compiler, I use two command files, one for command line support, and one for IDE support.

This is the script for command line support.

@ECHO OFF
SET WATCOM=G:\OpenWatcomF77
SET TOOLKIT=G:\os2tk45
SET PATH=%WATCOM%\BINP;%WATCOM%\BINW;%PATH%
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\OS2;%TOOLKIT%\H
SET FINCLUDE=%WATCOM%\SRC\FORTRAN;%WATCOM%\SRC\FORTRAN\OS2
SET EDPATH=%WATCOM%\EDDAT
SET HELP=%WATCOM%\BINP\HELP;%HELP%
SET BOOKSHELF=%WATCOM%\BINP\HELP;%BOOKSHELF%
SET BEGINLIBPATH=%WATCOM%\BINP\DLL
Start %WATCOM%\BINP\NMPBIND.EXE

The script for IDE support uses the script for command line support to set up the environment.

call bgenvf77.cmd
binp\ide.exe

Learning to use OpenWatcom FORTRAN

Once the product is installed, there is a useful tutorial in the OpenWatcom FORTRAN folder. View the "Getting Started" help file for more information.

When using the tutorial to build a sample program using the IDE, I found that the sample called for a library named "plbx3r.lib", but it really wanted "plib3r.lib". It is easy enough to add "plib3r.lib" to the link options to get a successful build.

The OpenWatcom developers and users have set up a newsgroup to obtain help and report bugs and problems. That newsgroup is news://news.openwatcom.org and use the group "openwatcom.users.fortran". Support is on a volunteer basis, so be patient.

Last Modified: 31 May 2009
Graphics by Colorful Language
Copyright 2009 by Blonde Guy