The Queen's University of Belfast

Parallel Computer Centre
[Next] [Previous] [Top]
Makefiles
Makefiles
- make command allows the programmer to maintain, update, and regenerate groups of computer programs
- aimk - portable make wrapper script - architecture independent
- used to portably select options to build PVM and PVM applications on various machines
- each port of PVM is assigned an architecture name - the name is used both during compilation (to conditionally switch in code) and at runtime (to select an executable or host)
- aimk determines the machine architecture and execs make, passing it the architecture and a configuration file
- aimk runs make in a subdirectory to prevent executables from becoming intermixed and to permit overlapping compiles ie different makefile can be placed in each subdirectory or a single makefile, Makefile.aimk, can be shared between architectures
- aimk uses the value of environment variable $PVM_ARCH if it is set, otherwise it calls $PVM_ROOT/pvmgetarch to determine the architecture name
- $PVM_ROOT - Root path of PVM installation.
- $PVM_ARCH - PVM architecture name for machine.
EXAMPLE Makefile.aimk
PVMLIB = $(PVM_ROOT)/lib/$(PVM_ARCH)/libpvm3.a
SDIR = ..
BDIR = $(HOME)/pvm3/bin
XDIR = $(BDIR)/$(PVM_ARCH)
F77 = f77
FFLAGS = -g
FLIBS = $(PVM_ROOT)/lib/$(PVM_ARCH)/libfpvm3.a
default: fmaster fslave
$(XDIR):
- mkdir $(BDIR)
- mkdir $(XDIR)
clean:
rm -f *.o fmaster fslave testall
fmaster: $(SDIR)/master1.f $(XDIR)
$(F77) $(FFLAGS) -o master1 $(SDIR)/master1.f $(FLIBS) $(LIBS)
mv master1 $(XDIR)
fslave: $(SDIR)/slave1.f $(XDIR)
$(F77) $(FFLAGS) -o slave1 $(SDIR)/slave1.f $(FLIBS) $(LIBS)
mv slave1 $(XDIR)
testall: $(SDIR)/testall.f $(XDIR)
$(F77) $(FFLAGS) -o testall $(SDIR)/testall.f $(FLIBS) $(LIBS)
mv testall $(XDIR)
Practical
- Modify supplied Makefile.aimk and recompile and test previous practicals
[Next] [Previous] [Top]
All documents are the responsibility of, and copyright, © their authors and do not represent the views of The Parallel Computer Centre, nor of The Queen's University of Belfast.
Maintained by Alan Rea, email A.Rea@qub.ac.uk
Generated with CERN WebMaker