Makefile.am 6.08 KB
Newer Older
Andreas Marek's avatar
Andreas Marek committed
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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

if WITH_GENERIC_SIMPLE
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.f90 \
                                           src/elpa2_kernels/elpa2_kernels_real_simple.f90
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_simple.f90 \
                                           src/elpa2_kernels/elpa2_kernels_real_simple.f90
endif
endif

if WITH_GENERIC
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex.f90 \
                                           src/elpa2_kernels/elpa2_kernels_real.f90
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex.f90 \
                                           src/elpa2_kernels/elpa2_kernels_real.f90
endif
endif

if WITH_BGP
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90 \
                                           src/elpa2_kernels/elpa2_kernels_complex.f90
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgp.f90 \
                                           src/elpa2_kernels/elpa2_kernels_complex.f90
endif 
endif

if WITH_BGQ
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90 \
                                           src/elpa2_kernels/elpa2_kernels_complex.f90 
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_bgq.f90 \
                                           src/elpa2_kernels/elpa2_kernels_complex.f90 
endif
endif

if WITH_SSE_AS
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
endif

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

if WITH_AMD_BULLDOZER
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c \
                                           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_4hv.c \
                                           src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c \
                                           src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
endif
endif
if WITH_AVX_COMPLEX_BLOCK1
if WITH_OPENMP
 libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
endif
endif

if WITH_AVX_COMPLEX_BLOCK2
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.cpp \
                                           src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_complex_sse-avx_2hv.cpp \
                                           src/elpa2_kernels/elpa2_kernels_complex_sse-avx_1hv.cpp
endif
endif

if WITH_AVX_REAL_BLOCK2
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_2hv.c
endif
endif

if WITH_AVX_REAL_BLOCK4
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_4hv.c
endif
endif

if WITH_AVX_REAL_BLOCK6
if WITH_OPENMP
  libelpa_mt_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_6hv.c
else
  libelpa_la_SOURCES += src/elpa2_kernels/elpa2_kernels_real_sse-avx_6hv.c
endif
endif

if WITH_OPENMP
libelpa_la_LDFLAGS = -version-info $(ELPA_SO_VERSION)
else
libelpa_mt_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 \
	test/test_complex.F90 \
	test/test_complex_gen.f90 \
	test/test_real2.F90 \
	test/test_real.F90 \
	test/test_real_gen.f90

# pkg-config stuff
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = elpa.pc

# test programs
if WITH_OPENMP
build_lib = libelpa_mt.la 
else
build_lib = libelpa.la 
endif
noinst_bindir = $(abs_top_builddir)
noinst_bin_PROGRAMS = test_real test_real2 test_complex test_complex2

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

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

test_complex_SOURCES = test/test_complex.F90
test_complex_LDADD = $(build_lib)

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


check_SCRIPTS = test_real.sh test_real2.sh test_complex.sh test_complex2.sh   
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	

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	


CLEANFILES = test_real.sh test_real2.sh test_complex.sh test_complex2.sh