-
Notifications
You must be signed in to change notification settings - Fork 57
/
Makefile
77 lines (69 loc) · 3.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Makefile for MPI version of ADDA
# Most options are defined in Makefile
#
# Copyright (C) ADDA contributors
# This file is part of ADDA.
#
# ADDA is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# ADDA is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with ADDA. If not, see
# <http://www.gnu.org/licenses/>.
#=======================================================================================================================
# !!! Start of control section. Flags and options here are designed to be modified by user to choose particular options
# for compilation. However, the default set of options may work out-of-box on some systems.
#=======================================================================================================================
# Heurestics to determine if MPI wrapper is available. If $(MPICC) is defined it is used as is. Otherwise we try to
# locate 'mpicc' wrapper through system call, and reverse to $(CC) as the last resort. This should work fine in many
# cases, but can be replaced by a simple assignment of MPICC.
ifndef MPICC
ifeq ($(shell which mpicc > /dev/null 2>&1 && echo 0),0)
MPICC := mpicc
else
MPICC := $(CC)
endif
endif
# Compiler dependent options
# These are options for a particular Alpha system
ifeq ($(COMPILER),compaq)
MPICC := cc
LDLIBS += -lmpi -lelan
endif
# If the compiler is used directly, a few additional options are needed
ifeq ($(MPICC),$(CC))
# Microsoft MPI on Windows is detected automatically. If you have it installed, but want to use another
# implementation, delete the last symbol on the following line (then this case will not be satisfied)
ifdef MSMPI_INC
$(info Using Microsoft MPI)
CFLAGS += -I'$(MSMPI_INC)'
LDFLAGS += -L'$(MSMPI_LIB64)'
LDLIBS += -lmsmpi
else
# Depending on a particular MPI installation one may need to manually specify paths to MPI headers and libraries.
# Path should be absolute or relative to the location of this Makefile.
#CFLAGS += -I"C:/Program Files/MPICH2/include"
#LDFLAGS += -L"C:/Program Files/MPICH2/lib"
LDLIBS += -lmpi
endif
# If MPI compiler wrapper is used, environmental variables are set to define C compiler and linker
else
# for MPICH
export MPICH_CC = $(CC)
export MPICH_CLINKER = $(CC)
# for Open MPI
export OMPI_CC = $(CC)
endif
#=======================================================================================================================
# !!! End of control section. Everything below is not designed to be modified by user
#=======================================================================================================================
# Finalize flags
CFLAGS += -DADDA_MPI
CSOURCE += matvec.c
PROG := $(PROGMPI)
MYCC := $(MPICC)
MYCF := $(CF)
MYCCPP := $(CCPP)
include $(COMMONMK)