Go to the first, previous, next, last section, table of contents.


Makefile for MPI example

CC  = cl /G5 /Ox /nologo
CPP = cl /nologo /EP
F77 = fl32 /G5 /Ox /nologo
LDR = link

# Define HPVM_HOME variable to point to correct spot:
#HPVM_HOME = V:\hpvm-1.0-win32-x86

# Define LIB_TYPE variable to choose the desired implementation:
#LIB_TYPE = Myrinet
#LIB_TYPE = sockets

MPI_LIB = $(HPVM_HOME)\$(LIB_TYPE)\lib\mpi.lib
MPI_INCLUDE = /I$(HPVM_HOME)\$(LIB_TYPE)\include
FM_LIB = $(HPVM_HOME)\$(LIB_TYPE)\lib\fm.lib
LIBS = $(MPI_LIB) $(FM_LIB) $(IMPLEMENTATION_LIBS)

RM = del
MV = move

#######################################################
# Check if we can find the libraries and include files:
#######################################################
!IF "$(HPVM_HOME)" == ""
!MESSAGE *** To build MPI example programs please define             ***
!MESSAGE *** the environment variable HPVM_HOME with something like  ***
!MESSAGE *** "set HPVM_HOME=V:\hpvm-1.0-win32-x86"                   ***
!ERROR Invalid HPVM_HOME variable specified
!ENDIF

!IF "$(LIB_TYPE)" == ""
!MESSAGE *** To build MPI example programs please define             ***
!MESSAGE *** the environment variable LIB_TYPE with either           ***
!MESSAGE *** "set LIB_TYPE=Myrinet" or "set LIB_TYPE=sockets"        ***
!ERROR Invalid HPVM_HOME variable specified
!ENDIF

!IF "$(LIB_TYPE)" == "Myrinet"
IMPLEMENTATION_LIBS = $(HPVM_HOME)\$(LIB_TYPE)\myrilib.lib
!ELSE
!IF "$(MS_HOME)" == ""
!MESSAGE *** Please define MS_HOME to point to Microsoft Develelopor 
!MESSAGE *** environment (by something like "set MS_HOME=X:\msdev")
!ERROR Invalid MS_HOME variable specified
!ENDIF
IMPLEMENTATION_LIBS = $(MS_HOME)\lib\wsock32.lib
!ENDIF

EXECS = helloF.exe

all:  $(EXECS)

helloF.exe:  hello.f
	$(F77) -c $(MPI_INCLUDE) hello.f
	$(LDR) /OUT:helloF.exe hello.obj $(LIBS)
	$(RM) hello.obj

clean:  
	$(RM) $(EXECS) *.obj


Go to the first, previous, next, last section, table of contents.