-
Notifications
You must be signed in to change notification settings - Fork 41
/
adios_config.makesrc.in
executable file
·245 lines (221 loc) · 7.1 KB
/
adios_config.makesrc.in
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
#!/bin/bash
#
# Print compiler/linker flags to use ADIOS
#
# Configuration values from configure script
#
MYDIR=`dirname $0`
prefix="@prefix@"
FLAGSFILE="@sysconfdir@/adios_config.flags"
if [ ! -f ${FLAGSFILE} ]; then
FLAGSFILE2=${MYDIR}/adios_config.flags
if [ ! -f ${FLAGSFILE2} ]; then
echo "ERROR: settings file ${FLAGSFILE} not found."
exit 1
else
FLAGSFILE=${FLAGSFILE2}
fi
fi
. ${FLAGSFILE}
GITSTATFILE=@sysconfdir@/adios_git_status
if [ ! -f ${GITSTATFILE} ]; then
GITSTATFILE=${MYDIR}/adios_git_status
fi
if [ -f ${GITSTATFILE} ]; then
. ${GITSTATFILE}
fi
function Usage () {
echo "`basename $0` [-d | -c | -l] [-f] [-r] [-s] [-1] [-m] [-v] [-i]
Arguments
-d Base directory for ADIOS install
-c Compiler flags for C/C++, using ADIOS write/read methods
-l Linker flags for C/C++, using ADIOS write/read methods
-f Print above flags for Fortran90
-r Print above flags for using ADIOS read library only.
-s Print above flags for using ADIOS in a sequential code (no MPI).
-1 Print above flags for using old Read API of ADIOS.
-m Print available write/read methods and data transformation methods
-v Version of the installed package
-i More installation information about the package
Notes
- Multiple options of d,c,l are enabled. In such a case, the output is
a list of FLAG=flags, where FLAG is one of (DIR, CFLAGS, LDFLAGS)
- If none of d,c,l are given, all of them is printed
- If none of f,r,s are given, flags for C/C++, using ADIOS write/read
methods are printed
- -m can be combined with -r (readonly libraries) and -s (sequential libraries)
"
}
# default
PRINT_DIR=no
PRINT_CFLAGS=no
PRINT_LDFLAGS=no
OPT_FORTRAN=no
OPT_READ=no
OPT_SEQ=no
NFLAGS_ASKED=0
PRINT_METHODS=no
while getopts ":dclfrs1mvih" Option
do
case $Option in
d) PRINT_DIR=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";;
c) PRINT_CFLAGS=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";;
l) PRINT_LDFLAGS=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";;
f) OPT_FORTRAN=yes;;
r) OPT_READ=yes;;
s) OPT_SEQ=yes;;
1) OPT_V1=yes;;
m) PRINT_METHODS=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";;
v) echo "$VERSIONSTRING";
exit 0;;
i) echo "ADIOS $VERSIONSTRING";
echo "Installed from "
echo " source directory: $SRCDIR";
echo " build directory: $BUILDDIR";
if [ ! -z "$GITLOG" ]; then echo "$GITLOG"; fi
if [ ! -z "$GITSTAT" ]; then echo "Git status of source directory:"; echo "$GITSTAT"; fi
exit 0;;
h) Usage; exit 0;;
*) echo "Invalid option -$Option."; Usage; exit 255;; # DEFAULT
esac
done
shift $(($OPTIND - 1))
if [ $NFLAGS_ASKED == 0 ]; then
NFLAGS_ASKED=4;
PRINT_DIR=yes
PRINT_CFLAGS=yes
PRINT_LDFLAGS=yes
PRINT_METHODS=yes
fi
if [ -z "@HAVE_MPI_FALSE@" ]; then
OPT_SEQ=yes
fi
# Print requested values
if [ "$PRINT_DIR" == "yes" ]; then
if [ $NFLAGS_ASKED -gt 1 ]; then
echo -n "DIR="
fi
echo $ADIOS_DIR
fi
if [ "$PRINT_CFLAGS" == "yes" ]; then
if [ "$OPT_READ" == "yes" ]; then
if [ "$OPT_SEQ" == "yes" ]; then
if [ "$OPT_V1" == "yes" ]; then
CFLAGS="$ADIOSREAD_SEQ_V1_INC"
else
CFLAGS="$ADIOSREAD_SEQ_INC"
fi
else
if [ "$OPT_V1" == "yes" ]; then
CFLAGS="$ADIOSREAD_V1_INC"
else
CFLAGS="$ADIOSREAD_INC"
fi
fi
else
if [ "$OPT_SEQ" == "yes" ]; then
CFLAGS="$ADIOS_SEQ_INC"
else
CFLAGS="$ADIOS_INC"
fi
fi
if [ $NFLAGS_ASKED -gt 1 ]; then
echo -n "CFLAGS="
fi
echo $CFLAGS
fi
if [ "$PRINT_LDFLAGS" == "yes" ]; then
if [ "$OPT_SEQ" == "yes" ]; then
if [ "$OPT_READ" == "yes" ]; then
# ADIOSREAD + SEQ
if [ "$OPT_FORTRAN" == "yes" ]; then
if [ "$OPT_V1" == "yes" ]; then
LDFLAGS="$ADIOSREAD_SEQ_V1_FLIB"
else
LDFLAGS="$ADIOSREAD_SEQ_FLIB"
fi
else
LDFLAGS="$ADIOSREAD_SEQ_CLIB"
fi
else # ADIOS + SEQ
if [ "$OPT_FORTRAN" == "yes" ]; then
if [ "$OPT_V1" == "yes" ]; then
LDFLAGS="$ADIOS_SEQ_V1_FLIB"
else
LDFLAGS="$ADIOS_SEQ_FLIB"
fi
else
LDFLAGS="$ADIOS_SEQ_CLIB"
fi
fi
elif [ "$OPT_READ" == "yes" ]; then
# ADIOSREAD + parallel code
if [ "$OPT_FORTRAN" == "yes" ]; then
if [ "$OPT_V1" == "yes" ]; then
LDFLAGS="$ADIOSREAD_V1_FLIB"
else
LDFLAGS="$ADIOSREAD_FLIB"
fi
else
LDFLAGS="$ADIOSREAD_CLIB"
fi
else
# ADIOS + parallel code
if [ "$OPT_FORTRAN" == "yes" ]; then
if [ "$OPT_V1" == "yes" ]; then
LDFLAGS="$ADIOS_V1_FLIB"
else
LDFLAGS="$ADIOS_FLIB"
fi
else
LDFLAGS="$ADIOS_CLIB"
fi
fi
if [ $NFLAGS_ASKED -gt 1 ]; then
echo -n "LDFLAGS="
fi
echo $LDFLAGS
fi
if [ "$PRINT_METHODS" == "yes" ]; then
if [ "$OPT_SEQ" == "yes" ]; then
if [ "$OPT_READ" == "yes" ]; then
# ADIOSREAD + SEQ
if [ -x ${MYDIR}/adios_list_methods_readonly_nompi ]; then
${MYDIR}/adios_list_methods_readonly_nompi
elif [ -x ./utils/adios_list_methods/adios_list_methods_readonly_nompi ]; then
./utils/adios_list_methods/adios_list_methods_readonly_nompi
else
echo "ERROR: cannot find executable adios_list_methods_readonly_nompi"
fi
else
# ADIOS + SEQ
if [ -x ${MYDIR}/adios_list_methods_nompi ]; then
${MYDIR}/adios_list_methods_nompi
elif [ -x ./utils/adios_list_methods/adios_list_methods_nompi ]; then
./utils/adios_list_methods/adios_list_methods_nompi
else
echo "ERROR: cannot find executable adios_list_methods_nompi"
fi
fi
else
if [ "$OPT_READ" == "yes" ]; then
# ADIOSREAD
if [ -x ${MYDIR}/adios_list_methods_readonly ]; then
${MYDIR}/adios_list_methods_readonly
elif [ -x ./utils/adios_list_methods/adios_list_methods_readonly ]; then
./utils/adios_list_methods/adios_list_methods_readonly
else
echo "ERROR: cannot find executable adios_list_methods_readonly"
fi
else
# ADIOS
if [ -x ${MYDIR}/adios_list_methods ]; then
${MYDIR}/adios_list_methods
elif [ -x ./utils/adios_list_methods/adios_list_methods ]; then
./utils/adios_list_methods/adios_list_methods
else
echo "ERROR: cannot find executable adios_list_methods"
fi
fi
fi
fi