PVM applications written in C must be linked with at least the base PVM library, libpvm3.a. Fortran applications must be linked with both libfpvm3.a and libpvm3.a. Programs that use group functions must also be linked with libgpvm3.a. On some operating systems, PVM programs must be linked with still other libraries (for the socket or XDR functions).
Note that the order of libraries in the link command may be important. You may also need to specify the PVM library directory in the link command. A correct order is shown below (your compiler may be called something other than cc or f77).
cc/f77 [ compiler flags ] [ source files ] [ loader flags ] -L$PVM_ROOT/lib/$PVM_ARCH -lfpvm3 -lgpvm3 -lpvm3 [ libraries needed by PVM ] [ other libraries ]
aimk (§4.1.1) automatically sets environment variable PVM_ARCH to the PVM architecture name and ARCHLIB to the necessary system libraries. You can use these variables to write a portable, shared makefile, called Makefile.aimk.