Makefile.am 28.5 KB
Newer Older
1
## Process this file with automake to produce Makefile.in
2

3
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
4

5 6
AM_FCFLAGS = $(SCALAPACK_FCFLAGS) @FC_MODINC@modules @FC_MODOUT@modules
AM_LDFLAGS = $(SCALAPACK_LDFLAGS)
7 8

# libelpa
9 10
lib_LTLIBRARIES = libelpa@SUFFIX@.la
libelpa@SUFFIX@_la_LINK = $(FCLINK) $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
11

12
libelpa@SUFFIX@_la_SOURCES = src/mod_precision.F90 \
13 14
                             src/mod_mpi.F90 \
			     src/mod_mpi_stubs.F90 \
15
			     src/elpa2_kernels/mod_fortran_interfaces.F90 \
16
                             src/elpa_utilities.F90 \
Andreas Marek's avatar
Andreas Marek committed
17
	                     src/elpa1_compute.F90 \
Andreas Marek's avatar
Andreas Marek committed
18 19
	                     src/elpa1.F90 \
			     src/elpa2_utilities.F90 \
20 21 22
			     src/check_for_gpu.F90 \
			     src/mod_cuda.F90 \
			     src/interface_c_kernel.F90 \
23
			     src/mod_pack_unpack_real.F90 \
24
			     src/mod_pack_unpack_real_gpu.F90 \
25
			     src/elpa2_kernels/mod_single_hh_trafo_real.F90 \
26 27
			     src/mod_compute_hh_trafo_real.F90 \
			     src/mod_compute_hh_trafo_complex.F90 \
28
			     src/mod_pack_unpack_complex.F90 \
29
			     src/aligned_mem.F90 \
30
			     src/elpa2_compute.F90 \
Andreas Marek's avatar
Andreas Marek committed
31 32
			     src/elpa2.F90 \
			     src/elpa_c_interface.F90 \
33
                             src/elpa_qr/qr_utils.F90 \
34
                             src/elpa_qr/elpa_qrkernels.F90 \
35
                             src/elpa_qr/elpa_pdlarfb.F90 \
36
                             src/elpa_qr/elpa_pdgeqrf.F90
37 38 39

EXTRA_libelpa@SUFFIX@_la_DEPENDENCIES = src/elpa_reduce_add_vectors.X90 \
					src/elpa_transpose_vectors.X90 \
40 41 42 43 44
					src/redist_band.X90 \
					src/elpa1_compute_complex_template.X90 \
					src/elpa1_compute_real_template.X90 \
					src/elpa2_compute_real_template.X90 \
					src/elpa2_compute_complex_template.X90
45

46
if HAVE_DETAILED_TIMINGS
47 48 49 50 51 52 53 54 55 56
  libelpa@SUFFIX@_la_SOURCES += \
        src/timer.F90 \
        src/ftimings/ftimings.F90 \
        src/ftimings/ftimings_type.F90 \
        src/ftimings/ftimings_value.F90 \
        src/ftimings/highwater_mark.c \
        src/ftimings/resident_set_size.c \
        src/ftimings/time.c \
        src/ftimings/virtual_memory.c \
        src/ftimings/papi.c
57 58
endif

59
if WITH_GPU_VERSION
60 61
  libelpa@SUFFIX@_la_SOURCES +=  src/cudaFunctions.cu src/cuUtils.cu src/ev_tridi_band_gpu_c_v2.cu
  #src/interface_cuda.F90 src/interface_c_kernel.F90 src/ev_tridi_band_gpu_c_v2.cu src/cuUtils.cu
62
  EXTRA_libelpa@SUFFIX@_la_DEPENDENCIES +=   src/ev_tridi_band_gpu_c_v2_complex_template.Xcu src/ev_tridi_band_gpu_c_v2_real_template.Xcu
63 64
endif

65 66 67 68 69 70 71
if !WITH_MPI
  libelpa@SUFFIX@_la_SOURCES += src/mod_time_c.F90
if !HAVE_DETAILED_TIMINGS
  libelpa@SUFFIX@_la_SOURCES += src/ftimings/time.c
endif
endif

Andreas Marek's avatar
Andreas Marek committed
72
if WITH_REAL_GENERIC_KERNEL
73
  libelpa@SUFFIX@_la_SOURCES +=  src/elpa2_kernels/elpa2_kernels_real.F90
74 75
endif

Andreas Marek's avatar
Andreas Marek committed
76
if WITH_COMPLEX_GENERIC_KERNEL
77
  libelpa@SUFFIX@_la_SOURCES +=  src/elpa2_kernels/elpa2_kernels_complex.F90
78 79
endif

Andreas Marek's avatar
Andreas Marek committed
80
if WITH_REAL_GENERIC_SIMPLE_KERNEL
81
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_simple.F90
82 83
endif

Andreas Marek's avatar
Andreas Marek committed
84
if WITH_COMPLEX_GENERIC_SIMPLE_KERNEL
85
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.F90
86 87
endif

Andreas Marek's avatar
Andreas Marek committed
88
if WITH_REAL_BGP_KERNEL
89
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90
90 91
endif

Andreas Marek's avatar
Andreas Marek committed
92
if WITH_REAL_BGQ_KERNEL
93
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90
94 95
endif

96
if WITH_REAL_SSE_ASSEMBLY_KERNEL
97 98 99 100
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64_double_precision.s
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64_single_precision.s
endif
101

Andreas Marek's avatar
Andreas Marek committed
102
else
103
if WITH_COMPLEX_SSE_ASSEMBLY_KERNEL
104 105 106 107
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64_double_precision.s
if WANT_SINGLE_PRECISION_COMPLEX
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64_single_precision.s
endif
108 109
endif
endif
Andreas Marek's avatar
Andreas Marek committed
110

111
if WITH_REAL_SSE_BLOCK2_KERNEL
112 113 114 115
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse_2hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse_2hv_single_precision.c
endif
116 117
endif

Andreas Marek's avatar
Andreas Marek committed
118
if WITH_REAL_AVX_BLOCK2_KERNEL
119 120 121 122
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_2hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_2hv_single_precision.c
endif
123 124
else
if WITH_REAL_AVX2_BLOCK2_KERNEL
125 126 127 128
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_2hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_2hv_single_precision.c
endif
129
endif
130 131
endif

132
if WITH_REAL_SSE_BLOCK4_KERNEL
133 134 135 136
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse_4hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse_4hv_single_precision.c
endif
137 138
endif

Andreas Marek's avatar
Andreas Marek committed
139
if WITH_REAL_AVX_BLOCK4_KERNEL
140 141 142 143
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_4hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_4hv_single_precision.c
endif
144 145
else
if WITH_REAL_AVX2_BLOCK4_KERNEL
146 147 148 149
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_4hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_4hv_single_precision.c
endif
150
endif
151 152
endif

153
if WITH_REAL_SSE_BLOCK6_KERNEL
154 155 156 157
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse_6hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse_6hv_single_precision.c
endif
158 159
endif

Andreas Marek's avatar
Andreas Marek committed
160
if WITH_REAL_AVX_BLOCK6_KERNEL
161 162 163 164
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_6hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_6hv_single_precision.c
endif
165 166
else
if WITH_REAL_AVX2_BLOCK6_KERNEL
167 168 169 170
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_6hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_6hv_single_precision.c
endif
171
endif
172 173
endif

174
if WITH_COMPLEX_SSE_BLOCK1_KERNEL
175
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse_1hv_double_precision.c
176
if WANT_SINGLE_PRECISION_COMPLEX
177
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse_1hv_single_precision.c
178
endif
179 180
endif

Andreas Marek's avatar
Andreas Marek committed
181
if WITH_COMPLEX_AVX_BLOCK1_KERNEL
182
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_1hv_double_precision.c
183
if WANT_SINGLE_PRECISION_COMPLEX
184
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_1hv_single_precision.c
185
endif
186 187
else
if WITH_COMPLEX_AVX2_BLOCK1_KERNEL
188 189 190 191
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_1hv_double_precision.c
if WANT_SINGLE_PRECISION_COMPLEX
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_1hv_single_precision.c
endif
192
endif
193 194
endif

195
if WITH_COMPLEX_SSE_BLOCK2_KERNEL
196
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse_2hv_double_precision.c
197
if WANT_SINGLE_PRECISION_COMPLEX
198
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse_2hv_single_precision.c
199
endif
200 201
endif

Andreas Marek's avatar
Andreas Marek committed
202
if WITH_COMPLEX_AVX_BLOCK2_KERNEL
203
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_2hv_double_precision.c
204
if WANT_SINGLE_PRECISION_COMPLEX
205
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_2hv_single_precision.c
206
endif
207 208
else
if WITH_COMPLEX_AVX2_BLOCK2_KERNEL
209 210 211 212
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_2hv_double_precision.c
if WANT_SINGLE_PRECISION_COMPLEX
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_2hv_single_precision.c
endif
213
endif
214 215
endif

216
.cu.lo:
217
	NVCC="$(NVCC)" libtool --mode=compile --tag=CC $(top_srcdir)/nvcc_wrap $(NVCCFLAGS) $(LDFLAGS) -I$(top_builddir)/ -I$(top_srcdir)/  -c $< -o $@
Andreas Marek's avatar
Andreas Marek committed
218

219
# install any .mod files in the include/ dir
220
elpa_includedir = $(includedir)/elpa@SUFFIX@-@PACKAGE_VERSION@
221
nobase_elpa_include_HEADERS = $(wildcard modules/*)
Andreas Marek's avatar
Andreas Marek committed
222
nobase_elpa_include_HEADERS += elpa/elpa.h elpa/elpa_kernel_constants.h elpa/elpa_generated.h
223

Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
224
dist_man_MANS = \
225
           man/solve_evp_real.3 \
226
	   man/solve_evp_real_1stage_double.3 \
Andreas Marek's avatar
Andreas Marek committed
227
	   man/solve_evp_complex.3 \
228 229 230
	   man/solve_evp_complex_1stage_double.3 \
	   man/solve_evp_real_2stage_double.3 \
	   man/solve_evp_complex_2stage_double.3 \
Andreas Marek's avatar
Andreas Marek committed
231
	   man/get_elpa_row_col_comms.3 \
232
	   man/get_elpa_communicators.3 \
233
	   man/elpa2_print_kernels.1
Andreas Marek's avatar
Andreas Marek committed
234

235 236
if WANT_SINGLE_PRECISION_REAL

237
dist_man_MANS += man/solve_evp_real_1stage_single.3 \
238 239 240 241 242
	    man/solve_evp_real_2stage_single.3
endif

if WANT_SINGLE_PRECISION_COMPLEX

243
dist_man_MANS += man/solve_evp_complex_1stage_single.3 \
244 245 246
	    man/solve_evp_complex_2stage_single.3
endif

247
dist_doc_DATA = README.md USERS_GUIDE.md INSTALL.md CONTRIBUTING.md LICENSE Changelog COPYING/COPYING COPYING/gpl.txt COPYING/lgpl.txt
248

249 250
# pkg-config stuff
pkgconfigdir = $(libdir)/pkgconfig
251
pkgconfig_DATA = @PKG_CONFIG_FILE@
252

253 254
# programs
bin_PROGRAMS = \
255
  elpa2_print_kernels@SUFFIX@
256 257

noinst_PROGRAMS = \
258
  elpa1_test_real@SUFFIX@ \
259 260
  elpa1_test_complex@SUFFIX@ \
  elpa2_test_real@SUFFIX@ \
Andreas Marek's avatar
Andreas Marek committed
261 262 263 264
  elpa2_test_real_default_kernel@SUFFIX@ \
  elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@ \
  elpa2_test_real_choose_kernel_with_api@SUFFIX@ \
  elpa2_test_complex@SUFFIX@ \
265 266 267 268 269 270 271
  elpa2_test_complex_default_kernel@SUFFIX@ \
  elpa2_test_complex_choose_kernel_with_api@SUFFIX@

#if WITH_OPENMP
# nothing yet
#endif

272
if !WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
273
noinst_PROGRAMS += \
274
  elpa1_test_real_with_c@SUFFIX@ \
Andreas Marek's avatar
Andreas Marek committed
275 276 277 278 279 280
  elpa1_test_real_c_version@SUFFIX@ \
  elpa1_test_complex_c_version@SUFFIX@ \
  elpa2_test_real_c_version@SUFFIX@ \
  elpa2_test_complex_c_version@SUFFIX@
endif

281 282
if WANT_SINGLE_PRECISION_COMPLEX
noinst_PROGRAMS += \
283 284
  elpa1_test_complex_single_precision@SUFFIX@ \
  elpa2_test_complex_single_precision@SUFFIX@ \
285 286 287 288 289 290
  elpa2_test_complex_default_kernel_single_precision@SUFFIX@ \
  elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@
endif

if WANT_SINGLE_PRECISION_REAL
noinst_PROGRAMS += \
291 292
  elpa1_test_real_single_precision@SUFFIX@ \
  elpa2_test_real_single_precision@SUFFIX@ \
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
  elpa2_test_real_default_kernel_single_precision@SUFFIX@ \
  elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@ \
  elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@
endif

if WITH_GPU_VERSION
noinst_PROGRAMS += \
  elpa2_test_complex_gpu_version@SUFFIX@ \
  elpa2_test_real_gpu_version@SUFFIX@

if WANT_SINGLE_PRECISION_REAL
noinst_PROGRAMS += \
  elpa2_test_real_gpu_version_single_precision@SUFFIX@
endif

if WANT_SINGLE_PRECISION_COMPLEX
noinst_PROGRAMS += \
  elpa2_test_complex_gpu_version_single_precision@SUFFIX@
endif

endif

315
build_lib = libelpa@SUFFIX@.la
Andreas Marek's avatar
Andreas Marek committed
316

317
if HAVE_REDIRECT
Andreas Marek's avatar
Andreas Marek committed
318
  redirect_sources = test/shared_sources/redir.c test/shared_sources/redirect.F90
319 320 321 322
else
  redirect_sources =
endif

323 324 325 326 327
shared_sources = test/shared_sources/util.F90 \
		 test/shared_sources/read_input_parameters.F90  \
		 test/shared_sources/check_correctnes.F90 \
		 test/shared_sources/setup_mpi.F90 \
		 test/shared_sources/blacs_infrastructure.F90 \
328
		 test/shared_sources/mod_output_types.F90 \
329
		 test/shared_sources/prepare_matrix.F90
330 331
#test/shared_sources/mod_precision_created.f90: src/mod_precision.f90
#	cp $(top_srcdir)/src/mod_precision.f90 $(top_srcdir)/test/shared_sources/mod_precision_created.f90
Andreas Marek's avatar
Andreas Marek committed
332

Andreas Marek's avatar
Andreas Marek committed
333
if !WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
334
elpa1_test_real_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa1_test_real_c_version.c $(shared_sources) $(redirect_sources)
Andreas Marek's avatar
Andreas Marek committed
335
elpa1_test_real_c_version@SUFFIX@_LDADD = $(build_lib)
336
elpa1_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
337
EXTRA_elpa1_test_real_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
338

339
elpa1_test_real_with_c@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_real_c.F90 test/shared_sources/mod_from_c.F90 test/shared_sources/call_elpa1.c $(shared_sources) $(redirect_sources)
340
elpa1_test_real_with_c@SUFFIX@_LDADD = $(build_lib)
341
EXTRA_elpa1_test_real_with_c@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
342

Andreas Marek's avatar
Andreas Marek committed
343 344 345
elpa1_test_complex_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa1_test_complex_c_version.c $(shared_sources) $(redirect_sources)
elpa1_test_complex_c_version@SUFFIX@_LDADD = $(build_lib)
elpa1_test_complex_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
346
EXTRA_elpa1_test_complex_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
347 348 349 350

elpa2_test_real_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa2_test_real_c_version.c $(shared_sources) $(redirect_sources)
elpa2_test_real_c_version@SUFFIX@_LDADD = $(build_lib)
elpa2_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
351
EXTRA_elpa2_test_real_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
352 353 354 355

elpa2_test_complex_c_version@SUFFIX@_SOURCES = test/c_test_programs/elpa2_test_complex_c_version.c $(shared_sources) $(redirect_sources)
elpa2_test_complex_c_version@SUFFIX@_LDADD = $(build_lib)
elpa2_test_complex_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
356
EXTRA_elpa2_test_complex_c_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
357
endif
Andreas Marek's avatar
Andreas Marek committed
358

359
elpa1_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_real.F90 $(shared_sources) $(redirect_sources)
360
elpa1_test_real@SUFFIX@_LDADD = $(build_lib)
Lorenz Huedepohl's avatar
Typo  
Lorenz Huedepohl committed
361
EXTRA_elpa1_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
362

363 364
#elpa1_test_complex_with_c@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex_with_c.F90 test/shared_sources/mod_from_c.F90 test/shared_sources/call_elpa1.c $(shared_sources) $(redirect_sources)
#elpa1_test_complex_with_c@SUFFIX@_LDADD = $(build_lib)
365
#EXTRA_elpa1_test_complex_with_c@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
366

367
elpa2_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real.F90 $(shared_sources) $(redirect_sources)
368
elpa2_test_real@SUFFIX@_LDFLAGS = -static
369
elpa2_test_real@SUFFIX@_LDADD = $(build_lib)
370
EXTRA_elpa2_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
371

372
elpa2_test_real_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_default_kernel.F90 $(shared_sources) $(redirect_sources)
373
elpa2_test_real_default_kernel@SUFFIX@_LDADD = $(build_lib)
374
EXTRA_elpa2_test_real_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
375

376
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_qr_default_kernel.F90 \
377
								   $(shared_sources) $(redirect_sources)
378
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_LDADD = $(build_lib)
379
EXTRA_elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
380

381
elpa2_test_real_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_kernel_by_api.F90 \
382
							 $(shared_sources) $(redirect_sources)
383
elpa2_test_real_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
384
EXTRA_elpa2_test_real_choose_kernel_with_api@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
385

386
elpa1_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_complex.F90 $(shared_sources) $(redirect_sources)
387
elpa1_test_complex@SUFFIX@_LDADD = $(build_lib)
388
EXTRA_elpa1_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
389

390
elpa2_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex.F90 $(shared_sources) $(redirect_sources)
391
elpa2_test_complex@SUFFIX@_LDADD = $(build_lib)
392
EXTRA_elpa2_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
393

394
elpa2_test_complex_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_default_kernel.F90 $(shared_sources) $(redirect_sources)
395
elpa2_test_complex_default_kernel@SUFFIX@_LDADD = $(build_lib)
396
EXTRA_elpa2_test_complex_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
397

398
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_kernel_by_api.F90 \
399
							    $(shared_sources) $(redirect_sources)
400
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
401
EXTRA_elpa2_test_complex_choose_kernel_with_api@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
402

403
elpa2_print_kernels@SUFFIX@_SOURCES = src/elpa2_print_kernels.F90 $(shared_sources) $(redirect_sources)
404
elpa2_print_kernels@SUFFIX@_LDADD = $(build_lib)
Andreas Marek's avatar
Andreas Marek committed
405

406
if WANT_SINGLE_PRECISION_REAL
407
elpa1_test_real_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_real_single.F90 $(shared_sources) $(redirect_sources)
408
elpa1_test_real_single_precision@SUFFIX@_LDADD = $(build_lib)
409
EXTRA_elpa1_test_real_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
410

411
elpa2_test_real_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_single.F90 $(shared_sources) $(redirect_sources)
412 413
elpa2_test_real_single_precision@SUFFIX@_LDFLAGS = -static
elpa2_test_real_single_precision@SUFFIX@_LDADD = $(build_lib)
414
EXTRA_elpa2_test_real_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
415

416
elpa2_test_real_default_kernel_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_default_kernel_single.F90 \
417
								  $(shared_sources) $(redirect_sources)
418
elpa2_test_real_default_kernel_single_precision@SUFFIX@_LDADD = $(build_lib)
419
#elpa2_test_real_default_kernel_single_precision@SUFFIX@_LDFLAGS = -static
420
EXTRA_elpa2_test_real_default_kernel_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
421

422
elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_SOURCES = \
423
	        test/fortran_test_programs/test_elpa2_real_qr_default_kernel_single.F90 $(shared_sources) $(redirect_sources)
424
elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_LDADD = $(build_lib)
425
EXTRA_elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
426

427
elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_kernel_by_api_single.F90 $(shared_sources) $(redirect_sources)
428
elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@_LDADD = $(build_lib)
429
EXTRA_elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
430 431 432
endif

if WANT_SINGLE_PRECISION_COMPLEX
433
elpa1_test_complex_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_complex_single.F90 $(shared_sources) $(redirect_sources)
434
elpa1_test_complex_single_precision@SUFFIX@_LDADD = $(build_lib)
435
EXTRA_elpa1_test_complex_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
436

437
elpa2_test_complex_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_single.F90 $(shared_sources) $(redirect_sources)
438
elpa2_test_complex_single_precision@SUFFIX@_LDADD = $(build_lib)
439
EXTRA_elpa2_test_complex_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
440

441
elpa2_test_complex_default_kernel_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_default_kernel_single.F90 $(shared_sources) $(redirect_sources)
442
elpa2_test_complex_default_kernel_single_precision@SUFFIX@_LDADD = $(build_lib)
443
#elpa2_test_complex_default_kernel_single_precision@SUFFIX@_LDFLAGS = -static
444
EXTRA_elpa2_test_complex_default_kernel_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
445

446
elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_kernel_by_api_single.F90 $(shared_sources) $(redirect_sources)
447
elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@_LDADD = $(build_lib)
448
EXTRA_elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
449 450 451
endif

if WITH_GPU_VERSION
452
elpa2_test_real_gpu_version@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_gpu.F90 $(shared_sources) $(redirect_sources)
453
elpa2_test_real_gpu_version@SUFFIX@_LDADD = $(build_lib)
454
EXTRA_elpa2_test_real_gpu_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
455

456
elpa2_test_complex_gpu_version@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_gpu.F90 $(shared_sources) $(redirect_sources)
457
elpa2_test_complex_gpu_version@SUFFIX@_LDADD = $(build_lib)
458
EXTRA_elpa2_test_complex_gpu_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
459 460

if WANT_SINGLE_PRECISION_REAL
461
elpa2_test_real_gpu_version_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_gpu_single.F90 $(shared_sources) $(redirect_sources)
462
elpa2_test_real_gpu_version_single_precision@SUFFIX@_LDADD = $(build_lib)
463
EXTRA_elpa2_test_real_gpu_version_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
464 465 466
endif

if WANT_SINGLE_PRECISION_COMPLEX
467
elpa2_test_complex_gpu_version_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_gpu_single.F90 $(shared_sources) $(redirect_sources)
468
elpa2_test_complex_gpu_version_single_precision@SUFFIX@_LDADD = $(build_lib)
469
EXTRA_elpa2_test_complex_gpu_version_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
470 471 472 473
endif

endif

474
check_SCRIPTS = \
475 476 477 478 479 480 481 482 483
  elpa1_test_real@SUFFIX@.sh \
  elpa2_test_real@SUFFIX@.sh \
  elpa2_test_real_default_kernel@SUFFIX@.sh \
  elpa1_test_complex@SUFFIX@.sh \
  elpa2_test_complex@SUFFIX@.sh \
  elpa2_test_complex_default_kernel@SUFFIX@.sh \
  elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@.sh \
  elpa2_test_real_choose_kernel_with_api@SUFFIX@.sh \
  elpa2_test_complex_choose_kernel_with_api@SUFFIX@.sh \
484
  elpa2_print_kernels@SUFFIX@
485

Andreas Marek's avatar
Andreas Marek committed
486 487
if !WITH_OPENMP
check_SCRIPTS += \
488
  elpa1_test_real_with_c@SUFFIX@.sh \
489 490 491 492
  elpa1_test_real_c_version@SUFFIX@.sh \
  elpa1_test_complex_c_version@SUFFIX@.sh \
  elpa2_test_real_c_version@SUFFIX@.sh \
  elpa2_test_complex_c_version@SUFFIX@.sh
Andreas Marek's avatar
Andreas Marek committed
493 494
endif

495 496
if WANT_SINGLE_PRECISION_REAL
check_SCRIPTS += \
497 498 499 500 501
  elpa1_test_real_single_precision@SUFFIX@.sh \
  elpa2_test_real_single_precision@SUFFIX@.sh \
  elpa2_test_real_default_kernel_single_precision@SUFFIX@.sh \
  elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@.sh \
  elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@.sh
502 503 504 505
endif

if WANT_SINGLE_PRECISION_COMPLEX
check_SCRIPTS += \
506 507
  elpa1_test_complex_single_precision@SUFFIX@.sh \
  elpa2_test_complex_single_precision@SUFFIX@.sh \
508 509
  elpa2_test_complex_default_kernel_single_precision@SUFFIX@.sh \
  elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@.sh
510 511 512 513
endif

if WITH_GPU_VERSION
check_SCRIPTS += \
514 515
  elpa2_test_real_gpu_version@SUFFIX@.sh \
  elpa2_test_complex_gpu_version@SUFFIX@.sh
516 517
if WANT_SINGLE_PRECISION_REAL
check_SCRIPTS += \
518
  elpa2_test_real_gpu_version_single_precision@SUFFIX@.sh
519 520 521
endif
if WANT_SINGLE_PRECISION_COMPLEX
check_SCRIPTS += \
522
  elpa2_test_complex_gpu_version_single_precision@SUFFIX@.sh
523 524 525 526
endif

endif

527
# test scripts
528
if WITH_MPI
529
  wrapper="mpiexec -n 2 "
530
else
531
  wrapper=""
532
endif
533 534 535 536
TESTS = $(check_SCRIPTS)
%.sh: %
	echo '$(wrapper)./$^ $$TEST_FLAGS' > $@
	chmod +x $@
537

538

539
## this one does not want any arguments
540 541 542
#elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@.sh:
#	echo '$(wrapper)./elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@' > $@
#	chmod +x $@
543

544
#if WANT_SINGLE_PRECISION_REAL
545 546
#elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@.sh:
#	echo '$(wrapper)./elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@' > $@
547
#	chmod +x $@
548 549
#endif

550
# Preprocessed files (just used for manual inspection)
551 552
mod_precision.i: $(top_srcdir)/src/mod_precision.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -I$(top_srcdir)/ -c $(top_srcdir)/src/mod_precision.F90 -o $@
Andreas Marek's avatar
Andreas Marek committed
553

Andreas Marek's avatar
Andreas Marek committed
554
elpa2_utilities.i: $(top_srcdir)/src/elpa2_utilities.F90
555
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -I$(top_srcdir)/ -c $(top_srcdir)/src/elpa2_utilities.F90 -o $@
Andreas Marek's avatar
Andreas Marek committed
556

Andreas Marek's avatar
Andreas Marek committed
557
elpa2.i: $(top_srcdir)/src/elpa2.F90
558
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -I$(top_srcdir)/ -c $(top_srcdir)/src/elpa2.F90 -o $@
559

Andreas Marek's avatar
Andreas Marek committed
560
elpa1.i: $(top_srcdir)/src/elpa1.F90
561
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -I$(top_srcdir)/ -c $(top_srcdir)/src/elpa1.F90 -o $@
562

563 564 565
elpa1_compute.i: $(top_srcdir)/src/elpa1_compute.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -I$(top_srcdir)/ -c $(top_srcdir)/src/elpa1_compute.F90 -o $@

566 567 568
elpa2_compute.i: $(top_srcdir)/src/elpa2_compute.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -I$(top_srcdir)/ -c $(top_srcdir)/src/elpa2_compute.F90 -o $@

569 570 571
elpa2_kernels_real.i: $(top_srcdir)/src/elpa2_kernels/elpa2_kernels_real.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/src/elpa2_kernels/elpa2_kernels_real.F90 -o $@

572 573 574
mod_compute_hh_trafo_real.i: $(top_srcdir)/src/mod_compute_hh_trafo_real.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/src/mod_compute_hh_trafo_real.F90 -o $@

575 576 577
mod_compute_hh_trafo_complex.i: $(top_srcdir)/src/mod_compute_hh_trafo_complex.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/src/mod_compute_hh_trafo_complex.F90 -o $@

578 579
test_real.i: $(top_srcdir)/test/fortran_test_programs/test_elpa1_real.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/test/fortran_test_programs/test_elpa1_real.F90 -o $@
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598

blacs_infrastructure.i: $(top_srcdir)/test/shared_sources/blacs_infrastructure.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/test/shared_sources/blacs_infrastructure.F90 -o $@

check_correctnes.i: $(top_srcdir)/test/shared_sources/check_correctnes.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/test/shared_sources/check_correctnes.F90 -o $@

prepare_matrix.i: $(top_srcdir)/test/shared_sources/prepare_matrix.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/test/shared_sources/prepare_matrix.F90 -o $@

read_input_parameters.i: $(top_srcdir)/test/shared_sources/read_input_parameters.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/test/shared_sources/read_input_parameters.F90 -o $@

setup_mpi.i: $(top_srcdir)/test/shared_sources/setup_mpi.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/test/shared_sources/setup_mpi.F90 -o $@

cuUtils.i: $(top_srcdir)/src/cuUtils.cu
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/src/cuUtils.cu -o $@

599
include doxygen.am
600 601
include generated_headers.am
BUILT_SOURCES = $(generated_headers)
602

603
CLEANFILES = \
Andreas Marek's avatar
Andreas Marek committed
604
  elpa1_test* \
605
  elpa2_test*\
606
  *.i
607 608

clean-local:
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
609
	-rm -rf modules/* .fortran_dependencies/*
610
	-rm -rf $(generated_headers)
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
611 612 613

distclean-local:
	-rm config-f90.h
614 615 616
	-rm -rf ./src/elpa2_kernels/.deps
	-rm -rf ./src/.deps
	-rm -rf ./test/.deps
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
617
	-rmdir ./src/elpa2_kernels/
618 619
	-rmdir ./src
	-rmdir ./test
620
	-rmdir ./m4
621
	-rmdir modules/
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
622
	-rmdir .fortran_dependencies/
623

624 625 626
EXTRA_DIST = \
  fdep/fortran_dependencies.pl \
  fdep/fortran_dependencies.mk \
627
  test/fortran_test_programs/elpa_test_programs_print_headers.X90 \
628 629
  src/elpa_reduce_add_vectors.X90 \
  src/elpa_transpose_vectors.X90 \
630 631 632 633
  src/elpa1_compute_real_template.X90 \
  src/elpa1_compute_complex_template.X90 \
  src/elpa2_compute_real_template.X90 \
  src/elpa2_compute_complex_template.X90 \
634
  src/redist_band.X90 \
635 636 637 638 639
  src/elpa_qr/elpa_qrkernels.X90 \
  src/ev_tridi_band_gpu_c_v2_complex_template.Xcu \
  src/ev_tridi_band_gpu_c_v2_real_template.Xcu \
  src/cuUtils_complex_template.Xcu \
  src/cuUtils_real_template.Xcu \
640
  nvcc_wrap \
641
  elpa.spec
642

643 644 645 646 647 648
# Rules to re-generated the headers
elpa/elpa_generated.h: $(top_srcdir)/src/elpa_c_interface.F90
	grep -h "^ *!c>" $^ | sed 's/^ *!c>//;' > $@ || { rm $@; exit 1; }

test/shared_sources/generated.h: $(wildcard $(top_srcdir)/test/shared_sources/*.F90)
	grep -h "^ *!c>" $^ | sed 's/^ *!c>//;' > $@ || { rm $@; exit 1; }
649

650 651 652
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
	$(SHELL) ./config.status libtool
653

654

655
@FORTRAN_MODULE_DEPS@
656 657 658 659 660

# Fortran module dependencies only work within each target,
# specify that the test programs need a finished library before
# one can compile them

661
# $1  Object name
662
define require_elpa_lib
663
$1: libelpa@SUFFIX@.la
664 665

endef
666
$(foreach p,$(bin_PROGRAMS) $(noinst_PROGRAMS),$(foreach o,$($p_OBJECTS),$(eval $(call require_elpa_lib,$o))))