We help IT Professionals succeed at work.

Installing PVM

new_x asked
Medium Priority
Last Modified: 2012-05-05
I want to install PVM (Parallel Virtual Machine) on RedHat9 and on Windows Xp by using cygwin but could not do it. Is there anybody that could help thanks.

Watch Question

Duncan RoeSoftware Developer

Can you give a bit more detail as to what went wrong please?


Hi duncan_roe, I am new to Linux world what I am trying to do is to install pvm on a redhat9,
and want to write some parallel code by using PVM library. I downloaded an rmp for pvm and installed it onto linux. after that I typed pvm to get into the pvm console it responded as expected and gave the prompt  "pvm>" i tested it by using some console commands like conf and it was running successfully.

I downloaded hello.c and world.c written by some experinced authors (these codes use pvm) but could not compile them by using gcc hello.c -o hello -lpvm3 command.

Compilation gave the result
hello.c:3:18: pvm3.h: No such file or directory
then I changed the include<pvm3.h> line to the include</usr/local/pvm3/include/pvm3.h>

and tried to compile then it gave the error
/usr/bin/ld: cannot find -lpvm3
without  -lpvm3 it gave the following errors;
undefined reference to pcm_recv

I searched the internet and found that I must set some environement variables $PVM_ROOT and $PVM_ARCH but I could not eventually.

So could you provide me how to make this pvm running, by listing the steps

Duncan RoeSoftware Developer

Go back to the original unmodified source. Your command line should look like:
   gcc -g3 -ggdb -I/usr/local/pvm3/include -L/usr/local/pvm3/lib hello.c -o hello -lpvm3
Use the extensive documentation available at http://www.csm.ornl.gov/pvm/pvm_home.html to resolve any problems you encounter thereafter.
-g3 -ggdb are debugging options for max debugging info - it will work without these but I recommend them.
You never want to supply absolute pathnames in #include lines. The reason for this is that it that an included (header() file may well include other files which it is entitled to expect will be found in the same directory as itself.
PVM_ROOT & PVM_ARCH might be required by some Makefiles but will make no difference to the gcc command line you are using. I expect you would set them as:
   export PVM_ROOT=/usr/local/pvm3
   export PVM_ARCH=i386


I typed the following and got the following answers;

echo $PVM_ROOT

echo $PVM_ARCH

After correcting the source file I gave command you gave me(gcc....) ; it returned
/usr/bin/ld: cannot find -lpvm3

collect2: ld returned 1 exit status

Duncan RoeSoftware Developer

You need to find out where libpvm3 is installed, and give -L{that dir} on the command line instead of -L/usr/local/pvm3/lib.
To find out where the libraray is, type
   locate libpvm3
This should find a .a or a .so file somewhere. If it doesn't find a library, your installation is incomplete.


locate libpvm3 gave the following lines

then do i have to  use  -L/usr/share/pvm3/lib/LINUXI386 and are you sure to set PVM_ARCH to i386?



and searched the net someone asked the following

Subject: cannot find -lpvm3
> On Thu, 2004-10-21 at 14:00, A Nayar wrote:
> > I am having this error when trying to compile my mw app. However the
> > funny thing is this doesnt happen everytime, it looks like I need to set
> > reference to pvm somewhere when logging in. Any ideas??
> >
> > Arun

then he also sent another message just saying;
"Solved I hadnt set PVM_ARCH in my environment.."



Try to use these environment settting:


and compile using:
gcc -o myprog myprog.c -lpvm3 -I$(PVM_ROOT)/include -L$(PVM_ROOT)/lib/$(PVM_ARCH)

or just put everything in hardcoded:
gcc -o myprog myprog.c -lpvm3 -I/usr/share/pvm3/include -L/usr/share/pvm3/lib/LINUXI386
Duncan RoeSoftware Developer

You need to us -L/usr/share/pvm3/src/LINUXI386. For some strange reason, the file created in lib has lost its ".a" extension. Did you build from source? I just did - see below (my architecture is different from yours, don't worry about that).

In your case, set PVM_ARCH to LINUXI386

I visited the web site, fetched the source tarball, untarred and tried building it myself:

10:25:32$ pwd
10:26:16$ ./lib/pvmtmparch   # Found in Makefile
10:27:47$ export PVM_ARCH=LINUX64
10:29:54$ export PVM_ROOT=`pwd`
10:31:16$ make 2>&1|tee hee   # keep log in hee file in case it went wrong, or to check for warnings afterwards
(copious output)
10:34:58$ find . -name 'libpvm3*' -print
10:44:41$ diff src/LINUX64/libpvm3.a ./lib/LINUX64/libpvm3.a

The files in src & lib are identical, so it's OK to use either.

There are a number of warnings which are nothing to worry about concerning the use of "sys_nerr" & "sys_errlist".

I get 2 potentially serious warnings which you won't get "cast to pointer from integer of different size" which may indicate some 64-bit non-compliance. 32-bit linux will be fine because int long & pointer are all 32 bits.

Now you should be all set to build your test app.


Hi duncan_roe,

in fact I am from one click world (M$ Windows) so I might have done something wrong, What I have done so far is the following;

- I searched google and downloaded an rpm for redhat9.
- I used rpm -i .... to install that package. No error came out when installing..
- I tried to check if installation successfull by typing pvm
  it gave me pvm> prompt I typed conf to check if it was functioning it was ok then gave command halt.

no reboot no compilation or anything else.

So I am not sure whether I did the installation properly or not... Or Do I have to install it from sources and compile then.

if so and if I am not too much could you provide me a step by step guideline. (like for dummies series... :) )



have you been able to compile using:

$ gcc -o myprog myprog.c -lpvm3 -I/usr/share/pvm3/include -L/usr/share/pvm3/lib/LINUXI386


Software Developer
rpm -i should have installed it properly. Did locate really find /usr/share/pvm3/lib/LINUXI386/libpvm3 and not /usr/share/pvm3/lib/LINUXI386/libpvm3.a? Anyway using -L/usr/share/pvm3/src/LINUXI386 as I suggested before should work based on what you posted earlier (and from my own testing). Please do confirm the .a or not in /usr/share/pvm3/lib/LINUXI386.
As for installing from source, I documented most of the steps in my previous post, except the really early ones: go to the home url in previous post, select "download source" which will fetch you the file pvm3.4.5.tgz; get your browser to store that where you want; untar it: "cd {your source path}" "tar -xzf {pathname}/pvm3.4.5.tgz". This will create {your source path}/pvm3: cd there then follow the steps in my previous post. You don't need to type the comments ("#" character and following text). You will not need to reboot linux.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Hi experts,
 I was using Linux on VMPlayer today I deleted and Redhat VMWare files recopied them install the rpm and did what you said and finally have a working PVM now. (Both of two experts' comments are correct)

I will restart writing program that uses PVM library if I have troubles and open new threads for my questions, Could you help me?..

Best Regards


For slyong, I specially want to thank you for your comment, (your solution was also correct one) as soon as I will have another 200 points I will open a dummy question for you.



If I am not too much; one final question

In parallel computing programming if I spawned programs (slaves) more than the number of available processors, does PVM make neccessary adjustments or Do I have to take the number of hosts into account...


Hi new_x,

You are welcome.  For your final question, if you have 2 nodes (1 master, 1 slave) and pvm_spawn 3 processes, one of the node will get 2 processes and the other get one process.  This can be controlled within the program itself (e.g. which process to be spawn on which specific node).


But if I do not make any arrangements than PVM does it automatically in an efficient way?


Could you also provide some sites about some basic parallel algorithms?

The whole PVM book is actually online and downloadable (http://www.netlib.org/pvm3/book/pvm-book.html).  If you look at man pvm_spawn (http://www.physics.oregonstate.edu/~rubin/nacphy/PVM/ref/routines/pvm_spawn.html), the default if I am correct is in a round-robin fashion.  There are some toy examples in the PVM book that you should try out first.  Once you are familiar with the architecture, the you should read up about parallel algorithm, there are a lot of algorithm out there like matrix multiplication and such.
Duncan RoeSoftware Developer

You already have the man pages on your computer if you downloaded the source, and possibly from the RPM. Look in $PVM_ROOT/man for man subdirs (man1, man3 &c). Put $PVM_ROOT/man in your MANPATH environment variable to access them where they are, or copy them to e.g. the /usr/local/man tree


Thanks you both for your kind help.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.