Makefile.am 7.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4

AM_FCFLAGS = @AM_FCFLAGS@ @FC_MODINC@modules @FC_MODOUT@modules 

AM_LDFLAGS = @AM_LDFLAGS@ @BLACS_LDFLAGS@

BLACS_LDFLAGS = @BLACS_LDFLAGS@

# libelpa
if WITH_OPENMP
lib_LTLIBRARIES = libelpa_mt.la
else
lib_LTLIBRARIES = libelpa.la
endif

##rule to produce fortran config file:
#config_f90.h: ./config.h
#	grep "^#define" ./config.h > $@

if WITH_OPENMP
libelpa_mt_la_SOURCES = src/elpa1.F90 src/elpa2.F90
else
libelpa_la_SOURCES = src/elpa1.F90 src/elpa2.F90
endif

Andreas Marek's avatar
Andreas Marek committed
26
if WITH_REAL_GENERIC_KERNEL
27
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
28
  libelpa_mt_la_SOURCES +=  src/elpa2_kernels/elpa2_kernels_real.f90
29
else
Andreas Marek's avatar
Andreas Marek committed
30
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real.f90
31 32 33
endif
endif

Andreas Marek's avatar
Andreas Marek committed
34
if WITH_COMPLEX_GENERIC_KERNEL
35
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
36
  libelpa_mt_la_SOURCES +=  src/elpa2_kernels/elpa2_kernels_complex.f90
37
else
Andreas Marek's avatar
Andreas Marek committed
38
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex.f90
39 40 41
endif
endif

Andreas Marek's avatar
Andreas Marek committed
42
if WITH_REAL_GENERIC_SIMPLE_KERNEL
43
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
44
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_simple.f90
45
else
Andreas Marek's avatar
Andreas Marek committed
46 47
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_simple.f90
endif
48 49
endif

Andreas Marek's avatar
Andreas Marek committed
50
if WITH_COMPLEX_GENERIC_SIMPLE_KERNEL
51
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
52
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.f90
53
else
Andreas Marek's avatar
Andreas Marek committed
54
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.f90
55 56 57
endif
endif

Andreas Marek's avatar
Andreas Marek committed
58
if WITH_REAL_BGP_KERNEL
59
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
60
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90 
61
else
Andreas Marek's avatar
Andreas Marek committed
62 63
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90
endif 
64 65
endif

Andreas Marek's avatar
Andreas Marek committed
66
if WITH_REAL_BGQ_KERNEL
67
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
68
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90
69
else
Andreas Marek's avatar
Andreas Marek committed
70
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90
71 72 73
endif
endif

Andreas Marek's avatar
Andreas Marek committed
74
if WITH_REAL_SSE_KERNEL
75
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
76
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s
77
else
Andreas Marek's avatar
Andreas Marek committed
78 79 80 81 82 83 84 85 86
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s
endif
else
if WITH_COMPLEX_SSE_KERNEL
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_asm_x86_64.s
endif
87 88
endif
endif
Andreas Marek's avatar
Andreas Marek committed
89 90

if WITH_REAL_AVX_BLOCK2_KERNEL
91
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
92
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c
93
else
Andreas Marek's avatar
Andreas Marek committed
94
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c
95 96 97
endif
endif

Andreas Marek's avatar
Andreas Marek committed
98
if WITH_REAL_AVX_BLOCK4_KERNEL
99
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
100
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c
101
else
Andreas Marek's avatar
Andreas Marek committed
102
 libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c
103 104 105
endif
endif

Andreas Marek's avatar
Andreas Marek committed
106
if WITH_REAL_AVX_BLOCK6_KERNEL
107
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
108
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_6hv.c
109
else
Andreas Marek's avatar
Andreas Marek committed
110
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_6hv.c
111 112 113
endif
endif

Andreas Marek's avatar
Andreas Marek committed
114
if WITH_COMPLEX_AVX_BLOCK1_KERNEL
115
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
116
 libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
117
else
Andreas Marek's avatar
Andreas Marek committed
118
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
119 120 121
endif
endif

Andreas Marek's avatar
Andreas Marek committed
122
if WITH_COMPLEX_AVX_BLOCK2_KERNEL
123
if WITH_OPENMP
Andreas Marek's avatar
Andreas Marek committed
124
 libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.cpp
125
else
Andreas Marek's avatar
Andreas Marek committed
126
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.cpp
127 128 129
endif
endif

Andreas Marek's avatar
Andreas Marek committed
130 131 132 133 134 135 136 137 138 139
#if WITH_AVX_SANDYBRIDGE
#if WITH_OPENMP
#  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c \
                                           src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
#else
#  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c \
                                           src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
#endif
#endif

140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
if WITH_OPENMP
libelpa_mt_la_LDFLAGS = -version-info $(ELPA_SO_VERSION)
else
libelpa_la_LDFLAGS = -version-info $(ELPA_SO_VERSION)
endif

# install any .mod files in the include/ dir
elpa_includedir = $(includedir)/elpa
nobase_elpa_include_HEADERS = $(wildcard modules/*)

# other files to distribute
filesdir = $(datarootdir)
files_DATA = \
	test/read_real.F90 \
	test/read_real_gen.F90 \
	test/test_complex2.F90 \
Andreas Marek's avatar
Andreas Marek committed
156 157
	test/test_complex2_default_kernel.F90 \
	test/test_complex2_choose_kernel_with_api.F90 \
158 159 160
	test/test_complex.F90 \
	test/test_complex_gen.F90 \
	test/test_real2.F90 \
Andreas Marek's avatar
Andreas Marek committed
161 162 163
	test/test_real2_default_kernel.F90 \
	test/test_real2_choose_kernel_with_api.F90 \
	test/print_available_elpa2_kernels.F90 \
164 165 166
	test/test_real.F90 \
	test/test_real_gen.F90

Andreas Marek's avatar
Andreas Marek committed
167 168 169 170 171 172 173
# test programs
if WITH_OPENMP
build_lib = libelpa_mt.la 
else
build_lib = libelpa.la 
endif

174 175 176 177 178 179 180
# pkg-config stuff
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = elpa.pc

# test programs

#bindir = $(abs_top_builddir)
Andreas Marek's avatar
Andreas Marek committed
181 182
bin_PROGRAMS = test_real test_real2 test_real2_default_kernel test_complex test_complex2 test_complex2_default_kernel test_real2_choose_kernel_with_api test_complex2_choose_kernel_with_api print_available_elpa2_kernels

183 184 185 186 187 188 189

test_real_SOURCES = test/test_real.F90
test_real_LDADD = $(build_lib)

test_real2_SOURCES = test/test_real2.F90
test_real2_LDADD = $(build_lib)

Andreas Marek's avatar
Andreas Marek committed
190 191 192 193 194 195
test_real2_default_kernel_SOURCES = test/test_real2_default_kernel.F90
test_real2_default_kernel_LDADD = $(build_lib)

test_real2_choose_kernel_with_api_SOURCES = test/test_real2_choose_kernel_with_api.F90
test_real2_choose_kernel_with_api_LDADD = $(build_lib)

196 197 198 199 200 201
test_complex_SOURCES = test/test_complex.F90
test_complex_LDADD = $(build_lib)

test_complex2_SOURCES = test/test_complex2.F90
test_complex2_LDADD = $(build_lib)

Andreas Marek's avatar
Andreas Marek committed
202 203 204 205 206 207 208 209
test_complex2_default_kernel_SOURCES = test/test_complex2_default_kernel.F90
test_complex2_default_kernel_LDADD = $(build_lib) 

test_complex2_choose_kernel_with_api_SOURCES = test/test_complex2_choose_kernel_with_api.F90
test_complex2_choose_kernel_with_api_LDADD = $(build_lib)

print_available_elpa2_kernels_SOURCES = test/print_available_elpa2_kernels.F90
print_available_elpa2_kernels_LDADD = $(build_lib)
210

Andreas Marek's avatar
Andreas Marek committed
211
check_SCRIPTS = test_real.sh test_real2.sh test_real2_default_kernel.sh test_complex.sh test_complex2.sh test_complex2_default_kernel.sh test_real2_choose_kernel_with_api.sh test_complex2_choose_kernel_with_api.sh print_available_elpa2_kernels.sh 
212 213 214 215 216 217 218 219 220 221
TESTS = $(check_SCRIPTS)

test_real.sh:
	echo "mpiexec -n 2 ./test_real > /dev/null 2>&1" > test_real.sh
	chmod +x test_real.sh	

test_real2.sh:
	echo "mpiexec -n 2 ./test_real2 > /dev/null 2>&1" > test_real2.sh
	chmod +x test_real2.sh	

Andreas Marek's avatar
Andreas Marek committed
222 223 224 225 226 227 228 229
test_real2_default_kernel.sh:
	echo "mpiexec -n 2 ./test_real2_default_kernel > /dev/null 2>&1" > test_real2_default_kernel.sh
	chmod +x test_real2_default_kernel.sh	

test_real2_choose_kernel_with_api.sh:
	echo "mpiexec -n 2 ./test_real2_choose_kernel_with_api > /dev/null 2>&1" > test_real2_choose_kernel_with_api.sh
	chmod +x test_real2_choose_kernel_with_api.sh	

230 231 232 233 234 235 236
test_complex.sh:
	echo "mpiexec -n 2 ./test_complex > /dev/null 2>&1" > test_complex.sh
	chmod +x test_complex.sh	

test_complex2.sh:
	echo "mpiexec -n 2 ./test_complex2 > /dev/null 2>&1" > test_complex2.sh
	chmod +x test_complex2.sh	
Andreas Marek's avatar
Andreas Marek committed
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
test_complex2_default_kernel.sh:
	echo "mpiexec -n 2 ./test_complex2_default_kernel > /dev/null 2>&1" > test_complex2_default_kernel.sh
	chmod +x test_complex2_default_kernel.sh

test_complex2_choose_kernel_with_api.sh:
	echo "mpiexec -n 2 ./test_complex2_choose_kernel_with_api > /dev/null 2>&1" > test_complex2_choose_kernel_with_api.sh
	chmod +x test_complex2_choose_kernel_with_api.sh

print_available_elpa2_kernels.sh:
	echo "./print_available_elpa2_kernels" > print_available_elpa2_kernels.sh
	chmod +x print_available_elpa2_kernels.sh


elpa2.i: $(top_srcdir)/src/elpa2.F90
	$(CPP) $(CPPFLAGS) -I$(top_builddir)/ -c $(top_srcdir)/src/elpa2.F90 -o $@
252

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

Andreas Marek's avatar
Andreas Marek committed
256
CLEANFILES = test_real.sh test_real2.sh test_real2_default_kernel.sh test_complex.sh test_complex2.sh  test_complex2_default_kernel.sh test_real2_choose_kernel_with_api.sh test_complex2_choose_kernel_with_api.sh print_available_elpa2_kernels
257 258

@FORTRAN_MODULE_DEPS@