forked from Unidata/netcdf-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cf
216 lines (185 loc) · 4.35 KB
/
cf
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
#!/bin/bash
#NB=1
#DB=1
#X=-x
#FAST=1
HDF5=1
DAP=1
#PNETCDF=1
#PAR4=1
if test $# != 0 ; then
cmds=$@
fi
if test "x$PNETCDF" = x1 -o "x$PAR4" = x1 ; then
MPIO=1
fi
#RPC=1
#M32=1
#M64=1
CFLAGS=""
#CFLAGS="-Wall -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-parameter -Wconversion ${CFLAGS}"
CFLAGS="-Wall -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-parameter -Wno-char-subscripts -Wno-pointer-sign -Wno-format ${CFLAGS}"
#CFLAGS="-Wall ${CFLAGS}"
#CFLAGS="-Wconversion"
stddir="/usr/local"
PREFIX=/usr/local
if test "x${cmds}" = x ; then
cmds=""
else
for f in $cmds ; do
if test "x$f" = "xdistcheck" ; then
PREFIX=/tmp/$HOST
fi
done
fi
# HDF4=>HDF5
if test "x$HDF4" = x1 ; then
HDF5=1
fi
CC=gcc
MALLOC_CHECK=""
CPPFLAGS=""
LDFLAGS=""
CFLAGS="-g -O0 $CFLAGS"
case "$HOST" in
mort)
CFLAGS="-std=c99 $CFLAGS"
;;
yakov)
CFLAGS="-std=c99 $CFLAGS"
;;
spock)
CFLAGS="-Wdeclaration-after-statement -Wall $CFLAGS"
;;
spike)
CFLAGS="-Wall $CFLAGS"
;;
*)
;;
esac
MAKE=make
IGNORE="test 0 = 1"
if test "x$HDF5" = "x1" ; then
CPPFLAGS="-I${stddir}/include $CPPFLAGS"
LDFLAGS="-L${stddir}/lib -lhdf5_hl -lhdf5 -lz $LDFLAGS"
LD_LIBRARY_PATH="${stddir}/lib:$LD_LIBRARY_PATH"
fi
if test "x$HDF4" = "x1" ; then
LDFLAGS="$LDFLAGS -ljpeg"
fi
if test "x$DAP" = "x1" -o "x$CDMR" = "x1" -o "x$RPC" = "x1" ; then
if curl-config --version >/dev/null ; then
TMP=`curl-config --cflags`
CPPFLAGS="$TMP $CPPFLAGS"
TMP=`curl-config --libs`
LDFLAGS="$TMP $LDFLAGS"
TMP=`curl-config --prefix`
LD_LIBRARY_PATH="$TMP/lib:$LD_LIBRARY_PATH"
else
echo "Cannot find curl-config"
exit 1
fi
fi
CXXFLAGS="$CPPFLAGS $CXXFLAGS"
FLAGS="--prefix ${PREFIX}"
#FLAGS="$FLAGS --disable-f77 --disable-f90"
#FLAGS="$FLAGS --disable-cxx"
FLAGS="$FLAGS --disable-examples"
#FLAGS="$FLAGS --disable-utilities"
#FLAGS="$FLAGS --enable-cxx-4"
#FLAGS="$FLAGS --enable-dap-long-tests"
#FLAGS="$FLAGS --enable-ffio"
#FLAGS="$FLAGS --enable-benchmarks"
#FLAGS="$FLAGS --enable-extra-tests"
#FLAGS="$FLAGS --enable-large-file-tests"
#FLAGS="$FLAGS --disable-testsets"
#FLAGS="$FLAGS --disable-dap-remote-tests"
FLAGS="$FLAGS --enable-dap-auth-tests"
#FLAGS="$FLAGS --enable-doxygen"
#FLAGS="$FLAGS --enable-logging"
#FLAGS="$FLAGS --disable-diskless"
#FLAGS="$FLAGS --enable-mmap"
#FLAGS="$FLAGS --with-udunits"
#FLAGS="$FLAGS --with-libcf"
#valgrind => not shared
#FLAGS="$FLAGS --enable-valgrind-tests"
#FLAGS="$FLAGS --enable-jna"
#FLAGS="$FLAGS --disable-properties-attribute"
#FLAGS="$FLAGS --disable-silent-rules"
if test "x$PAR4" != x1 ; then
FLAGS="$FLAGS --disable-parallel4"
fi
if test "x${DB}" = x1 ; then
FLAGS="$FLAGS --disable-shared --enable-static"
else
FLAGS="$FLAGS --enable-shared"
fi
#TMP=
#rm -f ./test_mpi.tmp
#if test -f $stddir/lib/libhdf5.a ; then
# nm $stddir/lib/libhdf5.a | grep mpich_mpi_float$ >./test_mpi.tmp
#else
# if test -f $stddir/lib/libhdf5.so ; then
# nm $stddir/lib/libhdf5.so | grep mpich_mpi_float$ >./test_mpi.tmp
# fi
#fi
#if test -s ./test_mpi.tmp ; then
# PAR=1
#fi
#rm -f ./test_mpi.tmp
if test "x${PAR}" != x ; then
FLAGS="$FLAGS --enable-parallel"
fi
if test "x$HDF5" = "x" ; then
FLAGS="$FLAGS --disable-netcdf-4"
fi
if test "x$HDF4" = x1 ; then
FLAGS="$FLAGS --enable-hdf4 --enable-hdf4-file-tests"
fi
if test "x$DAP" = "x" ; then
FLAGS="$FLAGS --disable-dap"
fi
if test "x$MPIO" = x1 ; then
if test -f /machine/local_mpich2 ; then
MPI1=/machine/local_mpich2
MPI2=/machine/local_par7
MPI3=/machine/local_par
else
MPI1=/usr/local
MPI2=${MPI1}
MPI3=${MPI1}
fi
PATH=${PATH}:${MPI1}/bin
CC="${MPI1}/bin/mpicc"
CPPFLAGS="-I${MPI2}/include -I${MPI1}/include -I${MPI3}/include"
LDFLAGS="-L${MPI2}/lib -L${MPI1}/lib -L${MPI3}/lib"
LDLIBS="-lmpich"
FLAGS="$FLAGS --enable-pnetcdf"
FLAGS="$FLAGS --enable-parallel-tests"
fi
#FLAGS="${FLAGS} --enable-stdio"
export PATH
export CC
export CPPFLAGS
export CFLAGS
export LDFLAGS
export LD_LIBRARY_PATH
export MALLOC_CHECK
export CXXFLAGS
DISTCHECK_CONFIGURE_FLAGS="$FLAGS"
export DISTCHECK_CONFIGURE_FLAGS
if test "x$NB" != x -o "x$FAST" = x ; then
${MAKE} maintainer-clean >/dev/null 2>&1
fi
if test -z "$NB" ; then
if autoreconf -i --force ; then ok=1; else exit ; fi
fi
if test -z "$FAST" ; then
if test -f Makefile ; then ${MAKE} distclean >/dev/null 2>&1 ; fi
fi
sh $X ./configure ${FLAGS}
for c in $cmds; do
printenv LD_LIBRARY_PATH
${MAKE} ${FORCE} $c
done
exit 0