There is a maintenance of MPCDF Gitlab on Thursday, April 22st 2020, 9:00 am CEST - Expect some service interruptions during this time

Makefile.am 29 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
endif

125
if WITH_REAL_SSE_BLOCK4_KERNEL
126 127 128 129
  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
130 131
endif

Andreas Marek's avatar
Andreas Marek committed
132
if WITH_REAL_AVX_BLOCK4_KERNEL
133 134 135 136
  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
137 138
endif

139
if WITH_REAL_SSE_BLOCK6_KERNEL
140 141 142 143
  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
144 145
endif

Andreas Marek's avatar
Andreas Marek committed
146
if WITH_REAL_AVX_BLOCK6_KERNEL
147 148 149 150
  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
151 152
endif

153
if WITH_COMPLEX_SSE_BLOCK1_KERNEL
154
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse_1hv_double_precision.c
155
if WANT_SINGLE_PRECISION_COMPLEX
156
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse_1hv_single_precision.c
157
endif
158 159
endif

Andreas Marek's avatar
Andreas Marek committed
160
if WITH_COMPLEX_AVX_BLOCK1_KERNEL
161
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_1hv_double_precision.c
162
if WANT_SINGLE_PRECISION_COMPLEX
163
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_1hv_single_precision.c
164
endif
165 166
endif

167
if WITH_COMPLEX_SSE_BLOCK2_KERNEL
168
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse_2hv_double_precision.c
169
if WANT_SINGLE_PRECISION_COMPLEX
170
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse_2hv_single_precision.c
171
endif
172 173
endif

Andreas Marek's avatar
Andreas Marek committed
174
if WITH_COMPLEX_AVX_BLOCK2_KERNEL
175
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_2hv_double_precision.c
176
if WANT_SINGLE_PRECISION_COMPLEX
177
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_avx-avx2_2hv_single_precision.c
178
endif
179 180
endif

181
.cu.lo:
182
	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
183

184
# install any .mod files in the include/ dir
185
elpa_includedir = $(includedir)/elpa@SUFFIX@-@PACKAGE_VERSION@
186
nobase_elpa_include_HEADERS = $(wildcard modules/*)
Andreas Marek's avatar
Andreas Marek committed
187
nobase_elpa_include_HEADERS += elpa/elpa.h elpa/elpa_kernel_constants.h elpa/elpa_generated.h
188

Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
189
dist_man_MANS = \
190
           man/solve_evp_real.3 \
191
	   man/solve_evp_real_1stage_double.3 \
Andreas Marek's avatar
Andreas Marek committed
192
	   man/solve_evp_complex.3 \
193 194 195
	   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
196
	   man/get_elpa_row_col_comms.3 \
197
	   man/get_elpa_communicators.3 \
198
	   man/elpa2_print_kernels.1
Andreas Marek's avatar
Andreas Marek committed
199

200 201
if WANT_SINGLE_PRECISION_REAL

202
dist_man_MANS += man/solve_evp_real_1stage_single.3 \
203 204 205 206 207
	    man/solve_evp_real_2stage_single.3
endif

if WANT_SINGLE_PRECISION_COMPLEX

208
dist_man_MANS += man/solve_evp_complex_1stage_single.3 \
209 210 211 212
	    man/solve_evp_complex_2stage_single.3
endif


213
# other files to distribute
214
filesdir = $(docdir)/examples
215
dist_files_DATA = \
Andreas Marek's avatar
Andreas Marek committed
216 217 218 219 220 221 222 223 224 225 226
  test/fortran_test_programs/read_real.F90 \
  test/fortran_test_programs/test_complex2.F90 \
  test/fortran_test_programs/test_complex2_default_kernel.F90 \
  test/fortran_test_programs/test_complex2_choose_kernel_with_api.F90 \
  test/fortran_test_programs/test_complex.F90 \
  test/fortran_test_programs/test_real2.F90 \
  test/fortran_test_programs/test_real2_default_kernel.F90 \
  test/fortran_test_programs/test_real2_default_kernel_qr_decomposition.F90 \
  test/fortran_test_programs/test_real2_choose_kernel_with_api.F90 \
  test/fortran_test_programs/test_real.F90 \
  test/fortran_test_programs/test_real_with_c.F90 \
227
  src/elpa2_print_kernels.F90
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
if WANT_SINGLE_PRECISION_COMPLEX
dist_files_DATA += test/fortran_test_programs/test_complex2_single_precision.F90 \
                   test/fortran_test_programs/test_complex2_default_kernel_single_precision.F90 \
                   test/fortran_test_programs/test_complex2_choose_kernel_with_api_single_precision.F90 \
                   test/fortran_test_programs/test_complex_single_precision.F90
endif

if WANT_SINGLE_PRECISION_REAL
dist_files_DATA += test/fortran_test_programs/test_real2_single_precision.F90 \
                   test/fortran_test_programs/test_real2_default_kernel_single_precision.F90 \
                   test/fortran_test_programs/test_real2_default_kernel_qr_decomposition_single_precision.F90 \
                   test/fortran_test_programs/test_real2_choose_kernel_with_api_single_precision.F90 \
                   test/fortran_test_programs/test_real_single_precision.F90
endif

if WITH_GPU_VERSION
dist_files_DATA += test/fortran_test_programs/test_real2_gpu_version.F90 \
                   test/fortran_test_programs/test_complex2_gpu_version.F90

if WANT_SINGLE_PRECISION_REAL
dist_files_DATA += test/fortran_test_programs/test_real2_gpu_version_single_precision.F90
endif

if WANT_SINGLE_PRECISION_COMPLEX
dist_files_DATA += test/fortran_test_programs/test_complex2_gpu_version_single_precision.F90
endif

endif
257
dist_doc_DATA = README.md USERS_GUIDE.md INSTALL.md CONTRIBUTING.md LICENSE Changelog COPYING/COPYING COPYING/gpl.txt COPYING/lgpl.txt
258

259 260
# pkg-config stuff
pkgconfigdir = $(libdir)/pkgconfig
261
pkgconfig_DATA = @PKG_CONFIG_FILE@
262

263 264
# programs
bin_PROGRAMS = \
265
  elpa2_print_kernels@SUFFIX@
266 267

noinst_PROGRAMS = \
268
  elpa1_test_real@SUFFIX@ \
269 270
  elpa1_test_complex@SUFFIX@ \
  elpa2_test_real@SUFFIX@ \
Andreas Marek's avatar
Andreas Marek committed
271 272 273 274
  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@ \
275 276 277 278 279 280 281
  elpa2_test_complex_default_kernel@SUFFIX@ \
  elpa2_test_complex_choose_kernel_with_api@SUFFIX@

#if WITH_OPENMP
# nothing yet
#endif

282
if !WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
283
noinst_PROGRAMS += \
284
  elpa1_test_real_with_c@SUFFIX@ \
Andreas Marek's avatar
Andreas Marek committed
285 286 287 288 289 290
  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

291 292
if WANT_SINGLE_PRECISION_COMPLEX
noinst_PROGRAMS += \
293 294
  elpa1_test_complex_single_precision@SUFFIX@ \
  elpa2_test_complex_single_precision@SUFFIX@ \
295 296 297 298 299 300
  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 += \
301 302
  elpa1_test_real_single_precision@SUFFIX@ \
  elpa2_test_real_single_precision@SUFFIX@ \
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
  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

325
build_lib = libelpa@SUFFIX@.la
Andreas Marek's avatar
Andreas Marek committed
326

327
if HAVE_REDIRECT
Andreas Marek's avatar
Andreas Marek committed
328
  redirect_sources = test/shared_sources/redir.c test/shared_sources/redirect.F90
329 330 331 332
else
  redirect_sources =
endif

333 334 335 336 337
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 \
338
		 test/shared_sources/mod_output_types.F90 \
339
		 test/shared_sources/prepare_matrix.F90
340 341
#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
342

Andreas Marek's avatar
Andreas Marek committed
343
if !WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
344
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
345
elpa1_test_real_c_version@SUFFIX@_LDADD = $(build_lib)
346
elpa1_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
347
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
348

349 350
elpa1_test_real_with_c@SUFFIX@_SOURCES = test/fortran_test_programs/test_real_with_c.F90 test/shared_sources/mod_from_c.F90 test/shared_sources/call_elpa1.c $(shared_sources) $(redirect_sources)
elpa1_test_real_with_c@SUFFIX@_LDADD = $(build_lib)
351
EXTRA_elpa1_test_real_with_c@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
352

Andreas Marek's avatar
Andreas Marek committed
353 354 355
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)
356
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
357 358 359 360

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)
361
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
362 363 364 365

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)
366
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
367
endif
Andreas Marek's avatar
Andreas Marek committed
368 369

elpa1_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_real.F90 $(shared_sources) $(redirect_sources)
370
elpa1_test_real@SUFFIX@_LDADD = $(build_lib)
Lorenz Huedepohl's avatar
Typo  
Lorenz Huedepohl committed
371
EXTRA_elpa1_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
372

373 374
#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)
375
#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
376 377

elpa2_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2.F90 $(shared_sources) $(redirect_sources)
378
elpa2_test_real@SUFFIX@_LDFLAGS = -static
379
elpa2_test_real@SUFFIX@_LDADD = $(build_lib)
380
EXTRA_elpa2_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
381

Andreas Marek's avatar
Andreas Marek committed
382
elpa2_test_real_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_default_kernel.F90 $(shared_sources) $(redirect_sources)
383
elpa2_test_real_default_kernel@SUFFIX@_LDADD = $(build_lib)
384
EXTRA_elpa2_test_real_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
385

386 387
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_default_kernel_qr_decomposition.F90 \
								   $(shared_sources) $(redirect_sources)
388
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_LDADD = $(build_lib)
389
EXTRA_elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
390

391 392
elpa2_test_real_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_choose_kernel_with_api.F90 \
							 $(shared_sources) $(redirect_sources)
393
elpa2_test_real_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
394
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
395

Andreas Marek's avatar
Andreas Marek committed
396
elpa1_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex.F90 $(shared_sources) $(redirect_sources)
397
elpa1_test_complex@SUFFIX@_LDADD = $(build_lib)
398
EXTRA_elpa1_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
399

Andreas Marek's avatar
Andreas Marek committed
400
elpa2_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2.F90 $(shared_sources) $(redirect_sources)
401
elpa2_test_complex@SUFFIX@_LDADD = $(build_lib)
402
EXTRA_elpa2_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
403

Andreas Marek's avatar
Andreas Marek committed
404
elpa2_test_complex_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_default_kernel.F90 $(shared_sources) $(redirect_sources)
405
elpa2_test_complex_default_kernel@SUFFIX@_LDADD = $(build_lib)
406
EXTRA_elpa2_test_complex_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
407

408 409
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_choose_kernel_with_api.F90 \
							    $(shared_sources) $(redirect_sources)
410
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
411
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
412

413
elpa2_print_kernels@SUFFIX@_SOURCES = src/elpa2_print_kernels.F90 src/mod_precisionF90 $(shared_sources) $(redirect_sources)
414
elpa2_print_kernels@SUFFIX@_LDADD = $(build_lib)
Andreas Marek's avatar
Andreas Marek committed
415

416 417 418
if WANT_SINGLE_PRECISION_REAL
elpa1_test_real_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_real_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa1_test_real_single_precision@SUFFIX@_LDADD = $(build_lib)
419
EXTRA_elpa1_test_real_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
420 421 422 423

elpa2_test_real_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa2_test_real_single_precision@SUFFIX@_LDFLAGS = -static
elpa2_test_real_single_precision@SUFFIX@_LDADD = $(build_lib)
424
EXTRA_elpa2_test_real_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
425

426 427
elpa2_test_real_default_kernel_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_default_kernel_single_precision.F90 \
								  $(shared_sources) $(redirect_sources)
428
elpa2_test_real_default_kernel_single_precision@SUFFIX@_LDADD = $(build_lib)
429
#elpa2_test_real_default_kernel_single_precision@SUFFIX@_LDFLAGS = -static
430
EXTRA_elpa2_test_real_default_kernel_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
431

432 433
elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_SOURCES = \
	        test/fortran_test_programs/test_real2_default_kernel_qr_decomposition_single_precision.F90 $(shared_sources) $(redirect_sources)
434
elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_LDADD = $(build_lib)
435
EXTRA_elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
436 437 438

elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_choose_kernel_with_api_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@_LDADD = $(build_lib)
439
EXTRA_elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
440 441 442 443 444
endif

if WANT_SINGLE_PRECISION_COMPLEX
elpa1_test_complex_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa1_test_complex_single_precision@SUFFIX@_LDADD = $(build_lib)
445
EXTRA_elpa1_test_complex_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
446 447 448

elpa2_test_complex_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa2_test_complex_single_precision@SUFFIX@_LDADD = $(build_lib)
449
EXTRA_elpa2_test_complex_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
450 451 452

elpa2_test_complex_default_kernel_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_default_kernel_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa2_test_complex_default_kernel_single_precision@SUFFIX@_LDADD = $(build_lib)
453
#elpa2_test_complex_default_kernel_single_precision@SUFFIX@_LDFLAGS = -static
454
EXTRA_elpa2_test_complex_default_kernel_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
455 456 457

elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_choose_kernel_with_api_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@_LDADD = $(build_lib)
458
EXTRA_elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
459 460 461 462 463
endif

if WITH_GPU_VERSION
elpa2_test_real_gpu_version@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_gpu_version.F90 $(shared_sources) $(redirect_sources)
elpa2_test_real_gpu_version@SUFFIX@_LDADD = $(build_lib)
464
EXTRA_elpa2_test_real_gpu_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
465 466 467

elpa2_test_complex_gpu_version@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_gpu_version.F90 $(shared_sources) $(redirect_sources)
elpa2_test_complex_gpu_version@SUFFIX@_LDADD = $(build_lib)
468
EXTRA_elpa2_test_complex_gpu_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
469 470 471 472

if WANT_SINGLE_PRECISION_REAL
elpa2_test_real_gpu_version_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_real2_gpu_version_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa2_test_real_gpu_version_single_precision@SUFFIX@_LDADD = $(build_lib)
473
EXTRA_elpa2_test_real_gpu_version_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
474 475 476 477 478
endif

if WANT_SINGLE_PRECISION_COMPLEX
elpa2_test_complex_gpu_version_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_complex2_gpu_version_single_precision.F90 $(shared_sources) $(redirect_sources)
elpa2_test_complex_gpu_version_single_precision@SUFFIX@_LDADD = $(build_lib)
479
EXTRA_elpa2_test_complex_gpu_version_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
480 481 482 483
endif

endif

484
check_SCRIPTS = \
485 486 487 488 489 490 491 492 493
  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 \
494
  elpa2_print_kernels@SUFFIX@
495

Andreas Marek's avatar
Andreas Marek committed
496 497
if !WITH_OPENMP
check_SCRIPTS += \
498
  elpa1_test_real_with_c@SUFFIX@.sh \
499 500 501 502
  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
503 504
endif

505 506
if WANT_SINGLE_PRECISION_REAL
check_SCRIPTS += \
507 508 509 510 511
  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
512 513 514 515
endif

if WANT_SINGLE_PRECISION_COMPLEX
check_SCRIPTS += \
516 517 518
  elpa1_test_complex_single_precision@SUFFIX@.sh \
  elpa2_test_complex_single_precision@SUFFIX@.sh \
  elpa2_test_complex_default_kernel_single_precision@SUFFIX@.sh
519 520 521 522
endif

if WITH_GPU_VERSION
check_SCRIPTS += \
523 524
  elpa2_test_real_gpu_version@SUFFIX@.sh \
  elpa2_test_complex_gpu_version@SUFFIX@.sh
525 526
if WANT_SINGLE_PRECISION_REAL
check_SCRIPTS += \
527
  elpa2_test_real_gpu_version_single_precision@SUFFIX@.sh
528 529 530
endif
if WANT_SINGLE_PRECISION_COMPLEX
check_SCRIPTS += \
531
  elpa2_test_complex_gpu_version_single_precision@SUFFIX@.sh
532 533 534 535
endif

endif

536
# test scripts
537
if WITH_MPI
538
  wrapper="mpiexec -n 2 "
539
else
540
  wrapper=""
541
endif
542 543 544 545
TESTS = $(check_SCRIPTS)
%.sh: %
	echo '$(wrapper)./$^ $$TEST_FLAGS' > $@
	chmod +x $@
546

547
# this one does not want any arguments
548
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@.sh:
549 550
	echo '$(wrapper)./elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@' > $@
	chmod +x $@
551

552
# Preprocessed files (just used for manual inspection)
553 554
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
555

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

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

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

565 566 567
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 $@

568 569 570
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 $@

571 572 573
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 $@

574 575 576
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 $@

577 578 579
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 $@

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

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 $@

601
include doxygen.am
602 603
include generated_headers.am
BUILT_SOURCES = $(generated_headers)
604

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

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

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

626 627 628
EXTRA_DIST = \
  fdep/fortran_dependencies.pl \
  fdep/fortran_dependencies.mk \
629
  test/fortran_test_programs/elpa_test_programs_print_headers.X90 \
630 631
  src/elpa_reduce_add_vectors.X90 \
  src/elpa_transpose_vectors.X90 \
632 633 634 635
  src/elpa1_compute_template_real.X90 \
  src/elpa1_compute_template_complex.X90 \
  src/elpa2_compute_template_real.X90 \
  src/elpa2_compute_template_complex.X90 \
636
  src/redist_band.X90 \
637 638 639 640 641
  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 \
642
  nvcc_wrap \
643
  elpa.spec
644

645 646 647 648 649 650
# 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; }
651

652 653 654
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
	$(SHELL) ./config.status libtool
655

656

657
@FORTRAN_MODULE_DEPS@
658 659 660 661 662

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

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

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