-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.orig
214 lines (178 loc) · 4.61 KB
/
Makefile.orig
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
EXECS = mpiselect
# TARGET_ARCH = AXP
# TARGET_ARCH = AIX_NATIVE
# TARGET_ARCH = AIX_MPICH
# TARGET_ARCH = SGI_NATIVE
# TARGET_ARCH = SGI_MPICH
# TARGET_ARCH = FBSD
# TARGET_ARCH = BEOWULF_LINUX_LAM
TARGET_ARCH = SUN_MPICH
# TARGET_ARCH = LINUX_MPICH
S_VER_MAJ = 1
S_VER_MIN = 4
S_VER_REL = A
OPT = -O$(O_LEVEL)
# OPT = -g
CFLAGS = $(OPT) -D$(TARGET_ARCH) $(MCFLAGS) -I$(MPI_INC)
CC = $(MPI_CC)
ifeq ($(TARGET_ARCH),AXP)
# MESSAGE PASSING LIBRARY FOR "AXP":
MPI = MPICH
# MPI = DAB_MPICH
# MPI = LAM
MCFLAGS =
ifeq ($(MPI),MPICH)
MPI_DIR = /fs/parallel/mpich#
MPI_INC = $(MPI_DIR)/include
MPI_LIB = # -L$(MPI_DIR)/lib/alpha/ch_p4 -lmpi
MPI_CC = mpicc
O_LEVEL = 5 -tune ev4 -fast -unroll 0
endif
ifeq ($(MPI),DAB_MPICH)
MPI_DIR = /fs/tsunami/dbader/mpich#
MPI_INC = $(MPI_DIR)/include
MPI_LIB = # -L$(MPI_DIR)/lib/alpha/ch_p4 -lmpi
MPI_CC = mpicc
O_LEVEL = 5 -tune ev4 -fast -uncroll 0
endif
ifeq ($(MPI),LAM)
MPI_DIR = /fs/parallel/lam#
MPI_INC = $(MPI_DIR)/h
MPI_LIB = -L$(MPI_DIR)/lib -lmpi
MPI_CC = hcc
O_LEVEL = 2
endif
ARZ = Z
endif # AXP
ifeq ($(TARGET_ARCH),AIX_NATIVE)
MPI_CC = mpcc
O_LEVEL = 2
MCFLAGS = -DAIX
MPI_DIR = /usr/lpp/ppe.poe#
MPI_INC = $(MPI_DIR)/include
MPI_LIB = -L/usr/lpp/ppe.poe/lib -lmpi
ARZ =
endif # AIX_NATIVE
ifeq ($(TARGET_ARCH),AIX_MPICH)
MPI_DIR = /fs/nene/dbader/mpich#
MPI_INC = $(MPI_DIR)/include
MPI_LIB = -L$(MPI_DIR)/lib/rs6000/ch_p4 -lmpi
MPI_CC = $(MPI_DIR)/bin/mpicc
O_LEVEL = 2
MCFLAGS = -DAIX
ARZ =
endif # AIX_MPICH
ifeq ($(TARGET_ARCH),FBSD)
MPI_CC = mpicc
O_LEVEL = 2
MCFLAGS =
MPI_DIR = /usr/local/mpich#
MPI_INC = $(MPI_DIR)/include
MPI_LIB = -L$(MPI_DIR)/lib/alpha/ch_p4 -lmpi
ARZ =
endif # FBSD
ifeq ($(TARGET_ARCH),SGI_NATIVE)
MPI_CC = cc
O_LEVEL = 2
MCFLAGS = -DSGI
MPI_INC = /usr/include
MPI_LIB = -L/usr/lib64 -lmpi
ARZ =
endif # SGI_NATIVE
ifeq ($(TARGET_ARCH),SGI_MPICH)
MPI_DIR = /usr/local/apps/mpich-10.13#
MPI_INC = $(MPI_DIR)/include
MPI_LIB = -L$(MPI_DIR)/lib/IRIX64/ch_p4 -lmpi
MPI_CC = $(MPI_DIR)/bin/mpicc
O_LEVEL = 3
MCFLAGS = -DSGI
ARZ =
endif # SGI_MPICH
ifeq ($(TARGET_ARCH),SUN_MPICH)
MPI_DIR = /usr/local/pkg/mpich/mpich-1.1.2#
MPI_INC = $(MPI_DIR)/include -I$(MPI_DIR)/build/solaris/ch_p4/include
MPI_LIB = -L$(MPI_DIR)/build/solaris/ch_p4/lib -lmpich
MPI_CC = $(MPI_DIR)/bin/mpicc
O_LEVEL = 3
MCFLAGS = -DSUN
ARZ =
endif # SUN_MPICH
ifeq ($(TARGET_ARCH),LINUX_MPICH)
MPI_DIR = /home/dbader/linuxcluster/mpich#
MPI_INC = $(MPI_DIR)/include
MPI_LIB = -L$(MPI_DIR)/lib/LINUX/ch_p4 -lmpi
MPI_CC = $(MPI_DIR)/bin/mpicc
O_LEVEL = 3
MCFLAGS = -DLINUX
ARZ =
endif # LINUX_MPICH
ifeq ($(TARGET_ARCH),BEOWULF_LINUX_LAM)
MPI_DIR = /usr#
MPI_INC = $(MPI_DIR)/include
MPI_LIB = -L$(MPI_DIR)/lib -lmpi
MPI_CC = $(MPI_DIR)/bin/hcc
O_LEVEL = 2
MCFLAGS = -DLINUX
ARZ =
endif # BEOWULF_LINUX_LAM
ifeq (,$(findstring BEOWULF_LINUX,$(TARGET_ARCH)))
MAKE = gmake --no-print-directory
else
MAKE = make --no-print-directory
endif
MAKEORIG = Makefile.orig
MAKEFILE = Makefile
MAKEDEPEND = makedepend
RANLIB = ranlib
CP = cp
MV = mv
MKDIR = mkdir
TAR = tar
ZIP = gzip
DIST_DIR = mpiselect-$(S_VER_MAJ).$(S_VER_MIN)$(S_VER_REL)
DIST_NAME = $(DIST_DIR).tar
DIST_SAVE = dist
LIBS = $(MPI_LIB) -lm
SRCS = ${wildcard *.c}
OBJS = $(SRCS:.c=.o)
.PHONY: all depend dist clean tidy cleandist
default: $(MAKEFILE)
$(MAKE) -f $(MAKEFILE) $(EXECS)
all: default
$(EXECS): $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
$(MAKEFILE) :
$(MAKE) -f $(MAKEORIG) depend
depend:
$(CP) $(MAKEORIG) $(MAKEFILE)
-$(MAKEDEPEND) -f$(MAKEFILE) -- $(CFLAGS) -I$(MPI_INC) -- $(SRCS)
$(MAKE) -f $(MAKEFILE)
dist:
$(RM) -fr $(DIST_DIR) $(DIST_NAME).*
$(MKDIR) $(DIST_DIR)
$(CP) $(MAKEORIG) \
$(SRCS) $(SRCS:.c=.h) \
$(DIST_DIR)
$(TAR) cvf $(DIST_NAME) $(DIST_DIR)
$(ZIP) $(DIST_NAME)
if [ ! -d $(DIST_SAVE) ] ; then \
$(MKDIR) $(DIST_SAVE) ; \
fi
$(MV) $(DIST_NAME).* $(DIST_SAVE)
$(CP) README $(DIST_SAVE)
$(CP) ALGORITHMS $(DIST_SAVE)
chown dbader $(DIST_SAVE)/*
chgrp hpc $(DIST_SAVE)/*
chmod 640 $(DIST_SAVE)/*
$(RM) -fr $(DIST_DIR)
.SUFFIXES: .c
.c.o :
$(CC) $(CFLAGS) -c $<
clean :
$(RM) -f core *.o $(EXECS) mon.out PI* *~ \
$(MAKEFILE).bak
tidy :
$(MAKE) -f $(MAKEORIG) clean
$(RM) -f $(MAKEFILE)
cleandist :
$(RM) -fr $(DIST_SAVE)