Makefile.am 13.3 KB
Newer Older
1
2
3
4
#
# Maintainer: Jörg Behrens <behrens@dkrz.de>
#             Moritz Hanke <hanke@dkrz.de>
#             Thomas Jahns <jahns@dkrz.de>
Moritz Hanke's avatar
Moritz Hanke committed
5
# URL: https://doc.redmine.dkrz.de/yaxt/html/
6
#
7
8
9
# Redistribution and use in source and binary forms, with or without
# modification, are  permitted provided that the following conditions are
# met:
10
#
11
12
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
13
#
14
15
16
# Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
17
#
18
19
20
# Neither the name of the DKRZ GmbH nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
21
#
22
23
24
25
26
27
28
29
30
31
32
33
34
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

35
AM_CPPFLAGS = -I../include -I$(srcdir)/../include $(MPI_C_INCLUDE)
36
37
AM_FCFLAGS  = $(MPI_FC_MOD)
lib_LTLIBRARIES =  libyaxt_c.la libyaxt.la
Thomas Jahns's avatar
Thomas Jahns committed
38

39
40
41
# headers from subdir xt will be installed (after substituting
# definitions from config.h). These must be listed in a sequence in
# which they can be combined in yaxt.h.
42
libyaxt_c_la_SOURCES =						\
43
	xt/xt_core.h						\
Thomas Jahns's avatar
Thomas Jahns committed
44
	xt/xt_config.h						\
45
	xt/xt_handles.h						\
46
47
48
	xt/sort_common.h					\
	xt/mergesort.h						\
	xt/quicksort.h						\
49
	xt/xt_sort.h						\
50
	xt_sort_internal.h					\
51
	xt/xt_idxlist.h						\
Moritz Hanke's avatar
Moritz Hanke committed
52
	xt/xt_idxempty.h					\
53
54
	xt/xt_idxlist_collection.h				\
	xt/xt_idxsection.h					\
55
	xt/xt_idxstripes.h					\
56
	xt/xt_idxvec.h 						\
57
	xt/xt_mpi.h						\
58
	xt/xt_redist.h						\
59
	xt/xt_redist_collection.h				\
60
	xt/xt_redist_collection_static.h			\
61
	xt/xt_redist_p2p.h					\
Moritz Hanke's avatar
Moritz Hanke committed
62
	xt/xt_redist_repeat.h					\
63
	xt/xt_stripe.h						\
64
	xt/xt_xmap.h						\
65
	xt/xt_xmap_all2all.h					\
66
	xt/xt_xmap_dist_dir.h					\
67
	xt/xt_xmap_intersection.h				\
68
	xt/xt_idxmod.h						\
Moritz Hanke's avatar
Moritz Hanke committed
69
70
	xt/xt_request.h						\
	xt/xt_request_msgs.h					\
71
	xt/xt_request_msgs_packed.h				\
72
	xt_arithmetic_util.h					\
73
	xt_arithmetic_long.h					\
Thomas Jahns's avatar
Thomas Jahns committed
74
75
	xt_config_internal.h					\
	xt_config.c						\
76
77
	xt_cover.h						\
	xt_cover.c						\
Joerg Behrens's avatar
Joerg Behrens committed
78
	xt_handles.c						\
79
	xt_idxempty_internal.h					\
Moritz Hanke's avatar
Moritz Hanke committed
80
	xt_idxempty.c						\
81
	xt_idxlist_internal.h					\
Joerg Behrens's avatar
Joerg Behrens committed
82
	xt_idxlist.c						\
83
	xt_idxlist_intersection.c				\
Moritz Hanke's avatar
Moritz Hanke committed
84
	xt_idxlist_collection.c					\
85
	xt_idxlist_collection_internal.h			\
86
	xt_idxlist_unpack.h					\
Moritz Hanke's avatar
Moritz Hanke committed
87
	xt_idxlist_unpack.c 					\
88
	xt_idxmod.c						\
89
	xt_idxsection_internal.h				\
90
	xt_idxsection.c						\
91
	xt_idxstripes_internal.h				\
92
	xt_idxstripes.c						\
Moritz Hanke's avatar
Moritz Hanke committed
93
	xt_idxvec.c 						\
94
	xt_idxvec_internal.h					\
Thomas Jahns's avatar
Thomas Jahns committed
95
	xt_mpi_internal.h					\
Thomas Jahns's avatar
Thomas Jahns committed
96
	xt_mpi.c						\
97
	xt_redist_internal.h					\
98
	xt_redist.c						\
99
	xt_redist_collection.c					\
100
	xt_redist_collection_static.c				\
101
	xt_redist_p2p.c						\
Moritz Hanke's avatar
Moritz Hanke committed
102
	xt_redist_repeat.c					\
103
	xt_redist_single_array_base.c				\
104
	xt/xt_redist_single_array_base.h			\
Moritz Hanke's avatar
Moritz Hanke committed
105
106
	xt_request.c						\
	xt_request_msgs.c					\
107
	xt_request_msgs_packed.c				\
Moritz Hanke's avatar
Moritz Hanke committed
108
	xt_request_internal.h					\
109
	xt_stripe.c						\
110
	xt_stripe_util.h					\
111
	xt_xmap_internal.h					\
Thomas Jahns's avatar
Thomas Jahns committed
112
	xt_xmap.c						\
113
	xt_xmap_all2all.c					\
114
	xt_xmap_dist_dir.c					\
115
116
	xt_xmap_dist_dir_common.h				\
	xt_xmap_dist_dir_common.c				\
117
118
	xt/xt_xmap_dist_dir_intercomm.h				\
	xt_xmap_dist_dir_intercomm.c				\
119
	xt_xmap_intersection.c					\
120
	xt_xmap_intersection_common.h				\
121
	xt_xmap_intersection_ext.c				\
Thomas Jahns's avatar
Thomas Jahns committed
122
	xt_init.c						\
Thomas Jahns's avatar
Thomas Jahns committed
123
124
125
126
	core/core.c						\
	core/core.h						\
	core/ppm_xfuncs.h					\
	core/symprefix.h					\
127
	core/ppm_visibility.h					\
Thomas Jahns's avatar
Thomas Jahns committed
128
129
	core/xmalloc.c						\
	core/xstdio.c						\
130
131
	ensure_array_size.c					\
	ensure_array_size.h					\
132
	xt_quicksort_base.h					\
133
	quicksort.c						\
Joerg Behrens's avatar
Joerg Behrens committed
134
	mergesort.c						\
135
	instr.h							\
136
	xt_sort.c						\
137
138
139
140
141
142
143
	xt_exchanger.c						\
	xt_exchanger.h						\
	xt_exchanger_simple_base.c				\
	xt_exchanger_simple_base.h				\
	xt_exchanger_irecv_send.c				\
	xt_exchanger_irecv_send.h				\
	xt_exchanger_irecv_isend.c				\
Moritz Hanke's avatar
Moritz Hanke committed
144
	xt_exchanger_irecv_isend.h				\
Moritz Hanke's avatar
Moritz Hanke committed
145
146
	xt_exchanger_irecv_isend_packed.c			\
	xt_exchanger_irecv_isend_packed.h			\
147
148
	xt_exchanger_neigh_alltoall.c				\
	xt_exchanger_neigh_alltoall.h				\
Moritz Hanke's avatar
Moritz Hanke committed
149
	xt_exchanger_mix_isend_irecv.c				\
Moritz Hanke's avatar
Moritz Hanke committed
150
	xt_exchanger_mix_isend_irecv.h
151

152
153
154
155
156
157
158
libyaxt_la_SOURCES =						\
	xt_idxlist_collection_f.f90				\
	xt_xmap_intersection_f.f90				\
	xt_ut.f90						\
	xt_ut_c.c						\
	xt_ut_c.h						\
	yaxt_f2c.c						\
159
	core/core_cf.c						\
160
	xt_slice_c_loc.inc					\
161
162
	xt_mpi_f.f90						\
	xt_core_f.f90						\
163
	xt_config_f.f90						\
164
	xt_sort_f.f90						\
165
166
167
168
169
170
	xt_idxlist_f.f90					\
	xt_idxvec_f.f90						\
	xt_idxstripes_f.f90					\
	xt_idxsection_f.f90					\
	xt_xmap_f.f90						\
	xt_redist_f.f90						\
171
172
173
174
175
176
	xt_redist_int_i2.f90					\
	xt_redist_int_i4.f90					\
	xt_redist_int_i8.f90					\
	xt_redist_real_sp.f90					\
	xt_redist_real_dp.f90					\
	xt_redist_logical.f90					\
177
	xt_request_f.f90					\
178
179
180
	yaxt.f90

libyaxt_la_LIBADD = libyaxt_c.la $(MPI_FC_LIB)
Thomas Jahns's avatar
Thomas Jahns committed
181
libyaxt_la_LDFLAGS = -version-info 7:0:6
Thomas Jahns's avatar
Thomas Jahns committed
182
libyaxt_c_la_LIBADD = $(MPI_C_LIB)
Thomas Jahns's avatar
Thomas Jahns committed
183
libyaxt_c_la_LDFLAGS = -version-info 7:0:6
184

185
186
187
if OMPI_DT_WORKAROUND
noinst_LTLIBRARIES = libompi_workaround.la
nodist_libompi_workaround_la_SOURCES = ompi_workaround.c
Thomas Jahns's avatar
Thomas Jahns committed
188
189
libompi_workaround_la_LIBADD = $(xt_mpi_workaround_LIBS) $(MPI_C_LIB)
libyaxt_c_la_LIBADD += libompi_workaround.la
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
endif

ompi_workaround.c: $(acx_opal_datatype_add_workaround)
	cp $^ $@

libompi_workaround_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
	$(OMPI_BUILD_CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@

ompi_workaround.lo: ompi_workaround.c
@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OMPI_MCA_C_INCLUDE) $(OMPI_BUILD_CFLAGS) -MT $@ -MD -MP -MF $(DEPDIR)/ompi_workaround.Tpo -c -o $@ `test -f 'ompi_workaround.c' || echo '$(srcdir)/'`ompi_workaround.c
@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/ompi_workaround.Tpo $(DEPDIR)/ompi_workaround.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ompi_workaround.c' object='ompi_workaround.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(OMPI_MCA_C_INCLUDE) $(OMPI_BUILD_CFLAGS) -c -o $@ `test -f 'ompi_workaround.c' || echo '$(srcdir)/'`ompi_workaround.c



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
EXTRA_DIST = m4-templates/xt_redist_template_module.f90.m4 \
	m4-templates/f03-redist-gen.m4 \
	m4-templates/int-prologue-i2.m4 \
	m4-templates/int-prologue-i4.m4 \
	m4-templates/int-prologue-i8.m4 \
	m4-templates/real-prologue-dp.m4 \
	m4-templates/real-prologue-sp.m4

f03_redist_module_template=`i=m4-templates/xt_redist_template_module.f90.m4 ; \
	if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; `
update_orig=true

BUILT_SOURCES = \
	xt_redist_int_i2.f90					\
	xt_redist_int_i4.f90					\
	xt_redist_int_i8.f90					\
	xt_redist_logical.f90					\
	xt_redist_real_sp.f90					\
	xt_redist_real_dp.f90

xt_redist_real_sp.f90: \
	m4-templates/xt_redist_template_module.f90.m4 \
	m4-templates/f03-redist-gen.m4
	$(M4) -I$(srcdir)/m4-templates -I$(top_srcdir)/m4 \
		-Dfname=$@ -Dmodname=xt_redist_real_sp \
		-Dprologue='{real-prologue-sp.m4}' \
		-Dtypetag=sp -Dtypedecl='REAL(sp)' \
		$< >"$@.tmp"
	cp "$@.tmp" "$@"
	if $(update_orig) ; then \
		cmp "$@.tmp" "$(srcdir)/$@" >/dev/null 2>&1 \
		|| mv "$@.tmp" "$(srcdir)/$@" ; fi
	-rm -f "$@.tmp"

xt_redist_real_dp.f90: \
	m4-templates/xt_redist_template_module.f90.m4 \
	m4-templates/f03-redist-gen.m4
	$(M4) -I$(srcdir)/m4-templates -I$(top_srcdir)/m4 \
		-Dfname=$@ -Dmodname=xt_redist_real_dp \
		-Dprologue='{real-prologue-dp.m4}' \
		-Dtypetag=dp -Dtypedecl='REAL(dp)' \
		$< >"$@.tmp"
	cp "$@.tmp" "$@"
	if $(update_orig) ; then \
		cmp "$@.tmp" "$(srcdir)/$@" >/dev/null 2>&1 \
		|| mv "$@.tmp" "$(srcdir)/$@" ; fi
	-rm -f "$@.tmp"

xt_redist_logical.f90: \
	m4-templates/xt_redist_template_module.f90.m4 \
	m4-templates/f03-redist-gen.m4
	$(M4) -I$(srcdir)/m4-templates -I$(top_srcdir)/m4 \
		-Dfname=$@ -Dmodname=xt_redist_logical \
		-Dtypetag=l -Dtypedecl='LOGICAL' \
		$< >"$@.tmp"
	cp "$@.tmp" "$@"
	if $(update_orig) ; then \
		cmp "$@.tmp" "$(srcdir)/$@" >/dev/null 2>&1 \
		|| mv "$@.tmp" "$(srcdir)/$@" ; fi
	-rm -f "$@.tmp"

xt_redist_int_i4.f90: \
	m4-templates/xt_redist_template_module.f90.m4 \
	m4-templates/f03-redist-gen.m4
	$(M4) -I$(srcdir)/m4-templates -I$(top_srcdir)/m4 \
		-Dfname=$@ -Dmodname=xt_redist_int_i4 \
		-Dprologue='{int-prologue-i4.m4}' \
		-Dtypetag=i4 -Dtypedecl='INTEGER(i4)' \
		$< >"$@.tmp"
	cp "$@.tmp" "$@"
	if $(update_orig) ; then \
		cmp "$@.tmp" "$(srcdir)/$@" >/dev/null 2>&1 \
		|| mv "$@.tmp" "$(srcdir)/$@" ; fi
	-rm -f "$@.tmp"

xt_redist_int_i2.f90: \
	m4-templates/xt_redist_template_module.f90.m4 \
	m4-templates/f03-redist-gen.m4
	$(M4) -I$(srcdir)/m4-templates -I$(top_srcdir)/m4 \
		-Dfname=$@ -Dmodname=xt_redist_int_i2 \
		-Dprologue='{int-prologue-i2.m4}' \
		-Dtypetag=i2 -Dtypedecl='INTEGER(i2)' \
		$< >"$@.tmp"
	cp "$@.tmp" "$@"
	if $(update_orig) ; then \
		cmp "$@.tmp" "$(srcdir)/$@" >/dev/null 2>&1 \
		|| mv "$@.tmp" "$(srcdir)/$@" ; fi
	-rm -f "$@.tmp"

xt_redist_int_i8.f90: \
	m4-templates/xt_redist_template_module.f90.m4 \
	m4-templates/f03-redist-gen.m4
	$(M4) -I$(srcdir)/m4-templates -I$(top_srcdir)/m4 \
		-Dfname=$@ -Dmodname=xt_redist_int_i8 \
		-Dprologue='{int-prologue-i8.m4}' \
		-Dtypetag=i8 -Dtypedecl='INTEGER(i8)' \
		$< >"$@.tmp"
	cp "$@.tmp" "$@"
	if $(update_orig) ; then \
		cmp "$@.tmp" "$(srcdir)/$@" >/dev/null 2>&1 \
		|| mv "$@.tmp" "$(srcdir)/$@" ; fi
	-rm -f "$@.tmp"
311

312

313
xtinclude_Makefile.inc: Makefile
314
	$(AM_V_GEN)headers=`echo $(libyaxt_c_la_SOURCES) | sed 's/[ 	][ 	]*/ /g' | tr ' ' '\n' | grep 'xt/.*\.h$$'` ; \
315
316
317
318
	  echo "xtinclude_HEADERS = \\" >$@ ; \
	  for header in $$headers ; do echo "	$$header \\" ; done \
	    | sed '$$s/\\$$//' >>$@

319
all-local: xtinclude_Makefile.inc
Thomas Jahns's avatar
Thomas Jahns committed
320

321
clean-local:
322
	-rm -f *.$(FCMODEXT) i.*.L *.i ompi_workaround.c *.dbg
323

Thomas Jahns's avatar
Thomas Jahns committed
324

325
326
327
328
329
330
331
332
333
# When an out-of-source build takes place, the recipe of the rule expects that
# the object files are already deleted from the 'core' subdirectory, which is
# not always the case for a parallel run, i.e. when 'make distclean -j2'.
# Therefore, we explicitly specify a dependency on the 'mostlyclean' rule.
# Moreover, the 'distclean' recipe of the top-level Makefile expects the
# directory containing this Makefile to be empty as soon as its 'distclean'
# recipe is executed. This is not the case when the Makefile is generated with
# Automake 1.16 or later because the $(DEPDIR) subdirectories are not deleted.
# Therefore, we delete them explicitly as the older versions of Automake do.
334
335
336
337
338
339
# We also need to clean-up the 'pkgconfig' and 'core' subdirectories before
# trying to delete them in the out-of-source build case. First, we make sure that
# the directory stamps are deleted by introducing a dependency on
# 'distclean-generic'. Second, we delete the pkgconfig files, which, otherwise,
# are deleted later by the top-level Makefile.
distclean-local: mostlyclean distclean-generic
Thomas Jahns's avatar
Thomas Jahns committed
340
	-rm -f xtinclude_Makefile.inc
341
	-rm -rf '$(DEPDIR)' 'core/$(DEPDIR)'
Thomas Jahns's avatar
Thomas Jahns committed
342
	-if test "$(abs_builddir)" != "$(abs_srcdir)" ; then \
343
	  rm -f pkgconfig/yaxt.pc pkgconfig/yaxt_c.pc; rmdir core pkgconfig ; fi
344

Thomas Jahns's avatar
Thomas Jahns committed
345
346
install-exec-local:
	$(mkinstalldirs) "$(DESTDIR)$(libdir)/pkgconfig"
347
348
	for pc in pkgconfig/yaxt.pc pkgconfig/yaxt_c.pc ; do \
		$(install_sh_DATA) "$$pc" "$(DESTDIR)$(libdir)/$$pc" ; done
Thomas Jahns's avatar
Thomas Jahns committed
349
350

uninstall-local:
351
352
	rm -f "$(DESTDIR)$(libdir)/pkgconfig/yaxt.pc" \
		"$(DESTDIR)$(libdir)/pkgconfig/yaxt_c.pc"
Thomas Jahns's avatar
Thomas Jahns committed
353
	-rmdir "$(DESTDIR)$(libdir)/pkgconfig"
354

355
./$(DEPDIR)/FC.deps: $(libyaxt_la_SOURCES) Makefile
356
357
358
359
360
	@unique=`for i in $(SOURCES); do \
	  if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | grep '\.f90$$' ` ; \
	  FC="$(FC)" FPP="$(FPP)" \
	  $(PERL) -I$(top_srcdir)/scripts \
361
362
	  $(top_srcdir)/scripts/makef90depends \
	  --ignore-module=iso_c_binding --ignore-module=mpi \
363
364
365
	  --fc-mod-flag=$(FC_MOD_FLAG) --fc-def-opt=$(FPP_DEFOPT) \
	  --fc-inc-flag=$(FPP_INCOPT) --fc-mod-suf='.$(FCMODEXT)' \
	  --fc-mod-case=$(FCMODCASE) --prog-fpp='$(FPP)' \
Thomas Jahns's avatar
Thomas Jahns committed
366
367
368
	  --fpp-sizeof-int=$(C_SIZEOF_INT) \
	  --fpp-sizeof-long=$(C_SIZEOF_LONG) \
	  --fpp-sizeof-long-long=$(C_SIZEOF_LONG_LONG) \
369
370
371
372
	  --fpp-char-is-`test $(C_CHAR_IS_UNSIGNED) = 0 || echo un`signed \
	  --strip-obj-dirname --parse-cache=./$(DEPDIR)/FC.depdb \
	  --obj-suf='.lo' -- \
	  $(AM_FCFLAGS) $(FCFLAGS) $(FPPFLAGS) -- $$unique \
373
	  >./$(DEPDIR)/FC.deps.temp && \
374
	cmp ./$(DEPDIR)/FC.deps.temp ./$(DEPDIR)/FC.deps >/dev/null 2>&1 \
375
376
	  || ln -f ./$(DEPDIR)/FC.deps.temp ./$(DEPDIR)/FC.deps \
	  && touch ./$(DEPDIR)/FC.deps
377

378
@am__include@ @am__quote@./$(DEPDIR)/FC.deps@am__quote@ # am--include-marker
Thomas Jahns's avatar
Thomas Jahns committed
379
380
381
382
383
384
385

#
# Local Variables:
# coding: utf-8
# show-trailing-whitespace: t
# End:
#