Installing PVM on a Microsoft Windows machine

This page describes how I set up PVM on a Microsoft Windows machine.  This is not the only way, or even the simplest way, to set up PVM under Windows, but it worked for me.   If you download the Windows installation of PVM from the official PVM web site, you will install libraries for use with Microsoft Visual C++.  If you have Microsoft Visual C++, you can probably get it to work pretty easily. 

I did not have Microsoft Visual C++, so had to use a more complicated method, described below.

Things to Download

The latest 'unofficial' release of PVM, from http://www.csm.ornl.gov/~kohl.   When I downloaded it, this was PVM 3.4.3+7, but I notice that it's up to PVM 3.4.4 now.  Also, the directions in this document assume you have downloaded the zip version of the file.  If you download another version of the file, you may need to adjust directory names.

SUNRpc for Cygwin, from ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Vinschen_Corinna/B20/, file name is sunrpc-4.0.cygwin1.bin.tar.gz.

The latest version of Cygwin from www.cygwin.com.   Look for the "Install Now" icon about halfway down the page.  This will download an installation program for Cygwin.

Where to Put Things

First, install the latest version of Cygwin.  This will take quite some time, as the installation program downloads everything it needs from the Internet.  On a 56K modem, it took me a couple of hours to download the full version of Cygwin.  The default installation location is C:\Cygwin.   

Second, unzip the SUNRpc files into your main Cygwin directory.  For example, if you installed Cygwin to C:\Cygwin, then unzip the files into that directory.  Make sure you are unzipping them keeping the directory structure from the zip file (Winzip defaults to this).

Third, unzip the PVM files into your main Cygwin directory, also keeping the directory structure from the zip file. 

How to Get it Working

Ideally, we would be finished and ready to go.  But, we still need to build the version of PVM that we downloaded so we have libraries to link with and the PVM deamon and console to run.  Unfortunately, it will not build without us doing a few things first.

1) Edit the pvmlog.c and lpvmgen.c files in the PVM3.4/src directory.  You want to comment out the lines that contain either sys_errlist or sys_nerr.

2) Edit the win32cygwin.def file in the PVM3.4/conf directory.  Remove -DHASREADLINE from where ever it occurs.  There should only be one occurrence of it in the file.

3) Create a subdirectory called win32 in the following directories: PVM3.4/bin, PVM3.4/console, PVM3.4/examples, PVM3.4/lib, PVM3.4/pvmgs, PVM3.4/src, PVM3.4/tracer.

4) Create the following environment variables (use the System icon in the Windows control panel). 

            Variable Name                     Value

            PVM_ARCH                       Win32
            PVM_ROOT                       Windows path to the PVM root directory (e.g. c:\cygwin\PVM3.4)
            PVM_ROOT_U                   Unix path to the PVM root directory (e.g. /PVM3.4)

5) Add the c:\cygwin\bin directory to the start of your system path variable.   This is an environment variable named PATH that should already exist.  Edit it to add c:\cygwin\bin to the beginning of it.

6) Add the current directory (.\) to the start of your system path variable.  This allows Cygwin to find files in the current directory correctly when you are using the Cygwin shell.

Now, you should be ready to build PVM.  Start a Cygwin shell.  This was installed with Cygwin, and gives you a Unix shell for your Windows machine.  In the Cygwin shell, cd to /PVM3.4 and type make -f cygwin.mak pvm.   PVM should build, unless I've forgotten something I did to get it working. 

How to Compile Programs That Use PVM

To compile programs that use PVM, I use the Cygwin shell and gcc.  Rather than try to figure out how to set the include paths and library paths, I simply edited the cygwin.mak file in the PVM3.4/examples directory.. 

1) To the CProgs list, add a line similar to the others, but make the name of the file whatever you want (I used assignment1). 

2) To the default target, add whatever you added to the CProgs list.

3) In the section that has a comment of:

###############################################################
# C
###############################################################

copy the entry for the first program (timing).  The entry is several lines line, and you want to copy the entire thing.  Paste the copy just below the original, and change the word timing to whatever you used in CProgs (for example, I changed timing to assignment1). 

4) In the section that has a comment of:

#############
# C OBJS
#############

copy the entry for the timing program (it's the third one in this section) and paste a copy just below the original.  Again, change timing to whatever you have named your program.

5) You should be able to create a .c file in the PVM3.4/examples subdirectory.   You can edit this file with whatever editor you like.  When you compile it, compile it from the Cygwin shell by going to the PVM3.4/examples subdirectory and typing make -f cygwin.mak.  This will compile your program (along with the hello and hello_other programs).

How to Run PVM

Now that you have a program compiled, you want to run it.  Start the PVM daemon by starting a Cygwin shell.  CD to the /PVM3.4/lib directory and type pvmd.bat &.  This will start the PVM daemon in the background.  Now start the PVM console by typing pvm.cygwin.bat.

At the PVM console, type spawn -> assignment1  (or whatever you named your program) to start it.

The only other thing I found that might be helpful is that doing a printf statment to display something to the PVM console often did not display until I flushed the stdout buffer.  So I got in the habit of following each printf with fflush (stdout);.  You may not have this problem, but if so try flushing the stream.