From: Carsten Schumm <Carsten.Schumm@sap-ag.de>
Newsgroups: comp.parallel.pvm
Subject: Re: PVM on Win32 problem
Date: Tue, 13 Apr 1999 10:40:12 +0200
Organization: SAP AG
Message-Id: <371302EC.D4696C61@sap-ag.de>
References: <7dtm5e$al8$1@news6.jaring.my>
    <Pine.GSO.3.96.990412223540.29348A-100000@armstrong.cse.Buffalo.EDU>
    <Pine.GSO.3.96.990412234335.4112A-100000@armstrong.cse.Buffalo.EDU>
Reply-To: Carsten.Schumm@gmx.de
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Xref: ukc comp.parallel.pvm:8240


Daniel S Eisner wrote:
> 
> I managed to get the visual c++ .lib files from the web site, but I am
> having MUCH trouble getting them to link correctly. They keep complaining
> that they interfere with with the existing default libraries
> (specifically, lib.a).
> 
> Does anyone know how to alleviate this problem?
> 
> Thanks,
> -Dan
> 
I had similar problems with older versions of pvm.
I think the main problem is MFC support. If you disable MFC (Not Using
MFC in settings/General) you should be able to compile if you link
against:
libpvm3.lib wsock32.lib kernel32.lib libc.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
oldnames.lib
and activate 'Ignore all default libraries' in Settings/Link.

Since I have to use MFC here I had to recompile the pvm-libs. I used
the sources from netlib/pvm3/win32/pvm3.4.0.zip and made the following
changes:
in file conf/WIN32.def:
ARCHCFLAGS = -DHASSTDLIB -DWIN32 -DSYSVBFUNC -DSYSVSTR \
             -DHASERRORVARS -DNOWAIT3 -DNOGETDTBLSIZ -DNOUNIXDOM \
             -DNOTMPNAM -DMAXHOSTNAMELEN=64 -DMAXPATHLEN=64 \
             -DNEEDSFFS \
             -D_CONSOLE -D_MBCS -D_AFXDLL \
             /nologo /MDd /GR /GX \
             /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" \
             /FD

in file conf/win32visual.def:
link_flags 	= 	$(PVM_CLIBDIR)\wsock32.lib \
			$(PVM_CLIBDIR)\kernel32.lib\
#			$(PVM_CLIBDIR)\libc.lib \
			$(PVM_CLIBDIR)\gdi32.lib \
			$(PVM_CLIBDIR)\winspool.lib \
			$(PVM_CLIBDIR)\comdlg32.lib \
			$(PVM_CLIBDIR)\advapi32.lib \
			$(PVM_CLIBDIR)\shell32.lib \
			$(PVM_CLIBDIR)\ole32.lib \
			$(PVM_CLIBDIR)\oleaut32.lib \
			$(PVM_CLIBDIR)\uuid.lib \
			$(PVM_CLIBDIR)\oldnames.lib \
			$(PVM_CLIBDIR)\msvcrtd.lib \
			/nodefaultlib:"LIBCMT.LIB" \

link_multithread	=	$(PVM_CLIBDIR)\wsock32.lib \
				$(PVM_CLIBDIR)\kernel32.lib \
#				$(PVM_CLIBDIR)\libcmt.lib \
				$(PVM_CLIBDIR)\gdi32.lib \
				$(PVM_CLIBDIR)\winspool.lib \
				$(PVM_CLIBDIR)\comdlg32.lib \
				$(PVM_CLIBDIR)\advapi32.lib \
				$(PVM_CLIBDIR)\shell32.lib \
				$(PVM_CLIBDIR)\ole32.lib \
				$(PVM_CLIBDIR)\oleaut32.lib \
				$(PVM_CLIBDIR)\uuid.lib \
				$(PVM_CLIBDIR)\oldnames.lib \
				$(PVM_CLIBDIR)\msvcrtd.lib \
				$(PVM_CLIBDIR)\libcpmt.lib

cflags	=   /c /W2 $(ARCHCFLAGS) /nologo /GX /O2 /D "NDEBUG" \
	    /D "_CONSOLE" -I$(PVM_CINCLUDE) -I$(PVM_ROOT)\include \
	    -I$(PVM_ROOT)\tracer -I$(PVM_ROOT)\src

only needed if you want want to build the libfpvm3:
in libfpvm/Makefile.mak:
libfpvm3.dll:  $(LOBS) $(PVM_ARCH)\ftocstr.obj
        $(linkdll) $(dllspec) $(conflags) \
		$(OUTBIN)$(PVM_ROOT)\libfpvm\$(PVM_ARCH)\libfpvm3.dll \
                $(LOBS) $(PVM_ARCH)\ftocstr.obj \
                $(PVM_CLIBDIR)\oldnames.lib \
                $(PVM_CLIBDIR)\kernel32.lib \
                $(PVM_CLIBDIR)\libcpmtd.lib \
                $(PVM_CLIBDIR)\wsock32.lib \
#               $(PVM_CLIBDIR)\libc.lib \
                $(PVM_CLIBDIR)\gdi32.lib $(PVM_CLIBDIR)\winspool.lib \
                $(PVM_CLIBDIR)\comdlg32.lib \
                $(PVM_CLIBDIR)\advapi32.lib \
                $(PVM_CLIBDIR)\shell32.lib  \
                $(PVM_CLIBDIR)\ole32.lib \
                $(PVM_CLIBDIR)\oleaut32.lib \
                $(PVM_CLIBDIR)\uuid.lib \
                $(PVM_CLIBDIR)\oldnames.lib \
		$(PVM_CLIBDIR)\msvcrtd.lib \
		..\lib\WIN32\libpvm3.lib \
		..\lib\WIN32\libgpvm3.lib \
		/DEBUG /nodefaultlib:"LIBCMTD.LIB"
        copy $(PVM_ARCH)\libfpvm3.dll $(PVM_ROOT)\lib\$(PVM_ARCH)

After these 'patches' do a 'make pvm', 'make ec' and ignore
the warnings about inconsistent linkage but donīt ignore errors :-)

Afterward you should be able to compile and link with these settings:
Use MFC in a Shared DLL (Settings/General)
library modules: libpvm3.lib wsock32.lib (Settings/Link(General))
and _un_checked 'Ignore all default libraries'.

Note1: I use NT4.0SP4 and Visual C++ 5.0
Note2: I hadnīt a look at the new pvm3.4.0 Installshield version.

HTH

Carsten

