2006-07-14 01:03:36 +04:00
|
|
|
#
|
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
# University of Stuttgart. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2006-12-21 00:31:30 +03:00
|
|
|
# Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
|
2006-07-14 01:03:36 +04:00
|
|
|
# $COPYRIGHT$
|
|
|
|
#
|
|
|
|
# Additional copyrights may follow
|
|
|
|
#
|
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
2007-01-03 17:39:23 +03:00
|
|
|
# Use the Open MPI-provided wrapper compilers. Note that gmake
|
|
|
|
# requires the CXX macro, while other versions of make (such as Sun's
|
|
|
|
# make) require the CCC macro.
|
2006-07-14 01:03:36 +04:00
|
|
|
|
|
|
|
CC = mpicc
|
|
|
|
CXX = mpic++
|
2006-12-21 00:31:30 +03:00
|
|
|
CCC = mpic++
|
2006-07-14 01:03:36 +04:00
|
|
|
F77 = mpif77
|
|
|
|
FC = mpif90
|
|
|
|
|
|
|
|
# Using -g is not necessary, but it is helpful for example programs,
|
2007-01-03 17:39:23 +03:00
|
|
|
# especially if users want to examine them with debuggers. Note that
|
|
|
|
# gmake requires the CXXFLAGS macro, while other versions of make
|
|
|
|
# (such as Sun's make) require the CCFLAGS macro.
|
2006-07-14 01:03:36 +04:00
|
|
|
|
|
|
|
CFLAGS = -g
|
|
|
|
CXXFLAGS = -g
|
2006-12-21 00:31:30 +03:00
|
|
|
CCFLAGS = -g
|
2006-07-14 01:03:36 +04:00
|
|
|
F77FLAGS = -g
|
|
|
|
FCFLAGS = -g
|
|
|
|
|
|
|
|
# Example programs to build
|
|
|
|
|
|
|
|
EXAMPLES = hello_c hello_cxx hello_f77 hello_f90 \
|
|
|
|
ring_c ring_cxx ring_f77 ring_f90
|
|
|
|
|
|
|
|
# Default target. Always build the C example. Only build the others
|
|
|
|
# if Open MPI was build with the relevant language bindings.
|
|
|
|
|
|
|
|
all: hello_c ring_c
|
|
|
|
@ if test "`ompi_info --parsable | grep bindings:cxx:yes`" != ""; then \
|
|
|
|
$(MAKE) hello_cxx ring_cxx; \
|
|
|
|
fi
|
|
|
|
@ if test "`ompi_info --parsable | grep bindings:f77:yes`" != ""; then \
|
|
|
|
$(MAKE) hello_f77 ring_f77; \
|
|
|
|
fi
|
|
|
|
@ if test "`ompi_info --parsable | grep bindings:f90:yes`" != ""; then \
|
|
|
|
$(MAKE) hello_f90 ring_f90; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# The usual "clean" target
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(EXAMPLES) *~ *.o
|
|
|
|
|
|
|
|
# Don't rely on default rules for the fortran examples
|
|
|
|
|
|
|
|
hello_f77: hello_f77.f
|
2006-12-21 00:31:30 +03:00
|
|
|
$(F77) $(F77FLAGS) $^ -o $@
|
2006-07-14 01:03:36 +04:00
|
|
|
ring_f77: ring_f77.f
|
2006-12-21 00:31:30 +03:00
|
|
|
$(F77) $(F77FLAGS) $^ -o $@
|
2006-07-14 01:03:36 +04:00
|
|
|
|
|
|
|
hello_f90: hello_f90.f90
|
2006-12-21 00:31:30 +03:00
|
|
|
$(FC) $(FCFLAGS) $^ -o $@
|
2006-07-14 01:03:36 +04:00
|
|
|
ring_f90: ring_f90.f90
|
2006-12-21 00:31:30 +03:00
|
|
|
$(FC) $(FCFLAGS) $^ -o $@
|
2006-07-14 01:03:36 +04:00
|
|
|
|