Makefile.am 27.9 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
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_4hv_double_precision.c
if WANT_SINGLE_PRECISION_REAL
135
    e ./configure SCALAPACK_LDFLAGS="-L$MKLROOT/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -Wl,-rpath,$MKL_HOME/lib/intel64 -L/afs/ipp/.cs/cuda/6.5/amd64_sles11/lib64 -lcublas -I/afs/ipp/.cs/cuda/6.5/amd64_sles11/include" SCALAPACK_FCFLAGS="-L$MKLROOT/mkl/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -I$MKLROOT/include/intel64/lp64 -L/afs/ipp/.cs/cuda/6.5/amd64_sles11/lib64 -lcublas -I/afs/ipp/.cs/cuda/6.5/amd64_sles11/include"  --prefix=/home/amarek/ELPA_GPU CFLAGS="-O2" CXXFLAGS="-O2" FCFLAGS="-O0" --enable-gpu-support --with-cuda-path=/afs/ipp/.cs/cuda/6.5/amd64_sles11/
136 137
  libelpa@SUFFIX@_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_avx-avx2_4hv_single_precision.c
endif
138 139
endif

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

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

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

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

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

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

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

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

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

201 202
if WANT_SINGLE_PRECISION_REAL

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

if WANT_SINGLE_PRECISION_COMPLEX

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

213
dist_doc_DATA = README.md USERS_GUIDE.md INSTALL.md CONTRIBUTING.md LICENSE Changelog COPYING/COPYING COPYING/gpl.txt COPYING/lgpl.txt
214

215 216
# pkg-config stuff
pkgconfigdir = $(libdir)/pkgconfig
217
pkgconfig_DATA = @PKG_CONFIG_FILE@
218

219 220
# programs
bin_PROGRAMS = \
221
  elpa2_print_kernels@SUFFIX@
222 223

noinst_PROGRAMS = \
224
  elpa1_test_real@SUFFIX@ \
225 226
  elpa1_test_complex@SUFFIX@ \
  elpa2_test_real@SUFFIX@ \
Andreas Marek's avatar
Andreas Marek committed
227 228 229 230
  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@ \
231 232 233 234 235 236 237
  elpa2_test_complex_default_kernel@SUFFIX@ \
  elpa2_test_complex_choose_kernel_with_api@SUFFIX@

#if WITH_OPENMP
# nothing yet
#endif

238
if !WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
239
noinst_PROGRAMS += \
240
  elpa1_test_real_with_c@SUFFIX@ \
Andreas Marek's avatar
Andreas Marek committed
241 242 243 244 245 246
  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

247 248
if WANT_SINGLE_PRECISION_COMPLEX
noinst_PROGRAMS += \
249 250
  elpa1_test_complex_single_precision@SUFFIX@ \
  elpa2_test_complex_single_precision@SUFFIX@ \
251 252 253 254 255 256
  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 += \
257 258
  elpa1_test_real_single_precision@SUFFIX@ \
  elpa2_test_real_single_precision@SUFFIX@ \
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
  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

281
build_lib = libelpa@SUFFIX@.la
Andreas Marek's avatar
Andreas Marek committed
282

283
if HAVE_REDIRECT
Andreas Marek's avatar
Andreas Marek committed
284
  redirect_sources = test/shared_sources/redir.c test/shared_sources/redirect.F90
285 286 287 288
else
  redirect_sources =
endif

289 290 291 292 293
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 \
294
		 test/shared_sources/mod_output_types.F90 \
295
		 test/shared_sources/prepare_matrix.F90
296 297
#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
298

Andreas Marek's avatar
Andreas Marek committed
299
if !WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
300
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
301
elpa1_test_real_c_version@SUFFIX@_LDADD = $(build_lib)
302
elpa1_test_real_c_version@SUFFIX@_LINK = $(LINK) $(FCLIBS)
303
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
304

305
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)
306
elpa1_test_real_with_c@SUFFIX@_LDADD = $(build_lib)
307
EXTRA_elpa1_test_real_with_c@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
308

Andreas Marek's avatar
Andreas Marek committed
309 310 311
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)
312
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
313 314 315 316

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)
317
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
318 319 320 321

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)
322
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
323
endif
Andreas Marek's avatar
Andreas Marek committed
324

325
elpa1_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_real.F90 $(shared_sources) $(redirect_sources)
326
elpa1_test_real@SUFFIX@_LDADD = $(build_lib)
Lorenz Huedepohl's avatar
Typo  
Lorenz Huedepohl committed
327
EXTRA_elpa1_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
328

329 330
#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)
331
#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
332

333
elpa2_test_real@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real.F90 $(shared_sources) $(redirect_sources)
334
elpa2_test_real@SUFFIX@_LDFLAGS = -static
335
elpa2_test_real@SUFFIX@_LDADD = $(build_lib)
336
EXTRA_elpa2_test_real@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
337

338
elpa2_test_real_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_default_kernel.F90 $(shared_sources) $(redirect_sources)
339
elpa2_test_real_default_kernel@SUFFIX@_LDADD = $(build_lib)
340
EXTRA_elpa2_test_real_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
341

342
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_qr_default_kernel.F90 \
343
								   $(shared_sources) $(redirect_sources)
344
elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_LDADD = $(build_lib)
345
EXTRA_elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
346

347
elpa2_test_real_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_kernel_by_api.F90 \
348
							 $(shared_sources) $(redirect_sources)
349
elpa2_test_real_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
350
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
351

352
elpa1_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_complex.F90 $(shared_sources) $(redirect_sources)
353
elpa1_test_complex@SUFFIX@_LDADD = $(build_lib)
354
EXTRA_elpa1_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
Andreas Marek's avatar
Andreas Marek committed
355

356
elpa2_test_complex@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex.F90 $(shared_sources) $(redirect_sources)
357
elpa2_test_complex@SUFFIX@_LDADD = $(build_lib)
358
EXTRA_elpa2_test_complex@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
359

360
elpa2_test_complex_default_kernel@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_default_kernel.F90 $(shared_sources) $(redirect_sources)
361
elpa2_test_complex_default_kernel@SUFFIX@_LDADD = $(build_lib)
362
EXTRA_elpa2_test_complex_default_kernel@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
363

364
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_kernel_by_api.F90 \
365
							    $(shared_sources) $(redirect_sources)
366
elpa2_test_complex_choose_kernel_with_api@SUFFIX@_LDADD = $(build_lib)
367
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
368

369
elpa2_print_kernels@SUFFIX@_SOURCES = src/elpa2_print_kernels.F90 $(shared_sources) $(redirect_sources)
370
elpa2_print_kernels@SUFFIX@_LDADD = $(build_lib)
Andreas Marek's avatar
Andreas Marek committed
371

372
if WANT_SINGLE_PRECISION_REAL
373
elpa1_test_real_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_real_single.F90 $(shared_sources) $(redirect_sources)
374
elpa1_test_real_single_precision@SUFFIX@_LDADD = $(build_lib)
375
EXTRA_elpa1_test_real_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
376

377
elpa2_test_real_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_single.F90 $(shared_sources) $(redirect_sources)
378 379
elpa2_test_real_single_precision@SUFFIX@_LDFLAGS = -static
elpa2_test_real_single_precision@SUFFIX@_LDADD = $(build_lib)
380
EXTRA_elpa2_test_real_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
381

382
elpa2_test_real_default_kernel_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_default_kernel_single.F90 \
383
								  $(shared_sources) $(redirect_sources)
384
elpa2_test_real_default_kernel_single_precision@SUFFIX@_LDADD = $(build_lib)
385
#elpa2_test_real_default_kernel_single_precision@SUFFIX@_LDFLAGS = -static
386
EXTRA_elpa2_test_real_default_kernel_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
387

388
elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_SOURCES = \
389
	        test/fortran_test_programs/test_elpa2_real_qr_default_kernel_single.F90 $(shared_sources) $(redirect_sources)
390
elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_LDADD = $(build_lib)
391
EXTRA_elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
392

393
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)
394
elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@_LDADD = $(build_lib)
395
EXTRA_elpa2_test_real_choose_kernel_with_api_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
396 397 398
endif

if WANT_SINGLE_PRECISION_COMPLEX
399
elpa1_test_complex_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa1_complex_single.F90 $(shared_sources) $(redirect_sources)
400
elpa1_test_complex_single_precision@SUFFIX@_LDADD = $(build_lib)
401
EXTRA_elpa1_test_complex_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
402

403
elpa2_test_complex_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_single.F90 $(shared_sources) $(redirect_sources)
404
elpa2_test_complex_single_precision@SUFFIX@_LDADD = $(build_lib)
405
EXTRA_elpa2_test_complex_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
406

407
elpa2_test_complex_default_kernel_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_default_kernel_single.F90 $(shared_sources) $(redirect_sources)
408
elpa2_test_complex_default_kernel_single_precision@SUFFIX@_LDADD = $(build_lib)
409
#elpa2_test_complex_default_kernel_single_precision@SUFFIX@_LDFLAGS = -static
410
EXTRA_elpa2_test_complex_default_kernel_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
411

412
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)
413
elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@_LDADD = $(build_lib)
414
EXTRA_elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
415 416 417
endif

if WITH_GPU_VERSION
418
elpa2_test_real_gpu_version@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_gpu.F90 $(shared_sources) $(redirect_sources)
419
elpa2_test_real_gpu_version@SUFFIX@_LDADD = $(build_lib)
420
EXTRA_elpa2_test_real_gpu_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
421

422
elpa2_test_complex_gpu_version@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_gpu.F90 $(shared_sources) $(redirect_sources)
423
elpa2_test_complex_gpu_version@SUFFIX@_LDADD = $(build_lib)
424
EXTRA_elpa2_test_complex_gpu_version@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
425 426

if WANT_SINGLE_PRECISION_REAL
427
elpa2_test_real_gpu_version_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_real_gpu_single.F90 $(shared_sources) $(redirect_sources)
428
elpa2_test_real_gpu_version_single_precision@SUFFIX@_LDADD = $(build_lib)
429
EXTRA_elpa2_test_real_gpu_version_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
430 431 432
endif

if WANT_SINGLE_PRECISION_COMPLEX
433
elpa2_test_complex_gpu_version_single_precision@SUFFIX@_SOURCES = test/fortran_test_programs/test_elpa2_complex_gpu_single.F90 $(shared_sources) $(redirect_sources)
434
elpa2_test_complex_gpu_version_single_precision@SUFFIX@_LDADD = $(build_lib)
435
EXTRA_elpa2_test_complex_gpu_version_single_precision@SUFFIX@_DEPENDENCIES = test/fortran_test_programs/elpa_test_programs_print_headers.X90
436 437 438 439
endif

endif

440
check_SCRIPTS = \
441 442 443 444 445 446 447 448 449
  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 \
450
  elpa2_print_kernels@SUFFIX@
451

Andreas Marek's avatar
Andreas Marek committed
452 453
if !WITH_OPENMP
check_SCRIPTS += \
454
  elpa1_test_real_with_c@SUFFIX@.sh \
455 456 457 458
  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
459 460
endif

461 462
if WANT_SINGLE_PRECISION_REAL
check_SCRIPTS += \
463 464 465 466 467
  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
468 469 470 471
endif

if WANT_SINGLE_PRECISION_COMPLEX
check_SCRIPTS += \
472 473
  elpa1_test_complex_single_precision@SUFFIX@.sh \
  elpa2_test_complex_single_precision@SUFFIX@.sh \
474 475
  elpa2_test_complex_default_kernel_single_precision@SUFFIX@.sh \
  elpa2_test_complex_choose_kernel_with_api_single_precision@SUFFIX@.sh
476 477 478 479
endif

if WITH_GPU_VERSION
check_SCRIPTS += \
480 481
  elpa2_test_real_gpu_version@SUFFIX@.sh \
  elpa2_test_complex_gpu_version@SUFFIX@.sh
482 483
if WANT_SINGLE_PRECISION_REAL
check_SCRIPTS += \
484
  elpa2_test_real_gpu_version_single_precision@SUFFIX@.sh
485 486 487
endif
if WANT_SINGLE_PRECISION_COMPLEX
check_SCRIPTS += \
488
  elpa2_test_complex_gpu_version_single_precision@SUFFIX@.sh
489 490 491 492
endif

endif

493
# test scripts
494
if WITH_MPI
495
  wrapper="mpiexec -n 2 "
496
else
497
  wrapper=""
498
endif
499 500 501 502
TESTS = $(check_SCRIPTS)
%.sh: %
	echo '$(wrapper)./$^ $$TEST_FLAGS' > $@
	chmod +x $@
503

504

505
## this one does not want any arguments
506 507 508
#elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@.sh:
#	echo '$(wrapper)./elpa2_test_real_default_kernel_qr_decomposition@SUFFIX@' > $@
#	chmod +x $@
509

510
if WANT_SINGLE_PRECISION_REAL
511 512
#elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@.sh:
#	echo '$(wrapper)./elpa2_test_real_default_kernel_qr_decomposition_single_precision@SUFFIX@' > $@
513
#	chmod +x $@
514
endif
515
# Preprocessed files (just used for manual inspection)
516 517
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
518

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

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

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

528 529 530
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 $@

531 532 533
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 $@

534 535 536
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 $@

537 538 539
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 $@

540 541 542
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 $@

543 544
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 $@
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563

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

564
include doxygen.am
565 566
include generated_headers.am
BUILT_SOURCES = $(generated_headers)
567

568
CLEANFILES = \
Andreas Marek's avatar
Andreas Marek committed
569
  elpa1_test* \
570
  elpa2_test*\
571
  *.i
572 573

clean-local:
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
574
	-rm -rf modules/* .fortran_dependencies/*
575
	-rm -rf $(generated_headers)
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
576 577 578

distclean-local:
	-rm config-f90.h
579 580 581
	-rm -rf ./src/elpa2_kernels/.deps
	-rm -rf ./src/.deps
	-rm -rf ./test/.deps
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
582
	-rmdir ./src/elpa2_kernels/
583 584
	-rmdir ./src
	-rmdir ./test
585
	-rmdir ./m4
586
	-rmdir modules/
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
587
	-rmdir .fortran_dependencies/
588

589 590 591
EXTRA_DIST = \
  fdep/fortran_dependencies.pl \
  fdep/fortran_dependencies.mk \
592
  test/fortran_test_programs/elpa_test_programs_print_headers.X90 \
593 594
  src/elpa_reduce_add_vectors.X90 \
  src/elpa_transpose_vectors.X90 \
595 596 597 598
  src/elpa1_compute_real_template.X90 \
  src/elpa1_compute_complex_template.X90 \
  src/elpa2_compute_real_template.X90 \
  src/elpa2_compute_complex_template.X90 \
599
  src/redist_band.X90 \
600 601 602 603 604
  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 \
605
  nvcc_wrap \
606
  elpa.spec
607

608 609 610 611 612 613
# 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; }
614

615 616 617
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
	$(SHELL) ./config.status libtool
618

619

620
@FORTRAN_MODULE_DEPS@
621 622 623 624 625

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

626
# $1  Object name
627
define require_elpa_lib
628
$1: libelpa@SUFFIX@.la
629 630

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