summarylogtreecommitdiffstats
path: root/wgrib2.patch
blob: 675569fde316938d41b6c3057f5f99de23dfe787 (plain)
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
--- makefile.orig	2019-02-07 18:53:47.000000000 +0100
+++ makefile	2019-09-22 17:13:59.812083455 +0200
@@ -101,8 +101,8 @@
 # export COMP_SYS=intel_linux
 #
 # can uncomment following two lines to use gcc/gfortran
-#export CC=gcc
-#export FC=gfortran
+export CC=gcc
+export FC=gfortran
 #
 # for OS-X: uncomment line for makefile -f scripts/makefile.darwin
 #
@@ -115,22 +115,22 @@
 
 
 # Warning do not set both USE_NETCDF3 and USE_NETCDF4 to one
-USE_NETCDF3=1
-USE_NETCDF4=0
+USE_NETCDF3=0
+USE_NETCDF4=1
 USE_REGEX=1
 USE_TIGGE=1
-USE_MYSQL=0
-USE_IPOLATES=3
+USE_MYSQL=1
+USE_IPOLATES=1
 USE_SPECTRAL=0
-USE_UDF=0
+USE_UDF=1
 USE_OPENMP=1
-USE_PROJ4=0
-USE_WMO_VALIDATION=0
+USE_PROJ4=1
+USE_WMO_VALIDATION=1
 DISABLE_TIMEZONE=0
 MAKE_FTN_API=1
 DISABLE_ALARM=0
 
-USE_G2CLIB=0
+USE_G2CLIB=1
 USE_PNG=1
 USE_JASPER=1
 USE_AEC=1
@@ -222,9 +222,11 @@
 ifeq ($(USE_IPOLATES),1)
 #   for HWRF iplib:=${lib}/libipolate_hwrf.a
 #   for HWRF wLDFLAGS+=-lipolate_hwrf
-   ipdir:=${cwd}/iplib.v3.0.0
-   iplib:=${lib}/libipolate.a
-   wLDFLAGS+=-lipolate
+   iplib:=../iplib_hwrf/libipolate.a
+   wLDFLAGS+=-L../../iplib_hwrf -lipolate
+   #ipdir:=${cwd}/iplib.v3.0.0
+   #iplib:=${lib}/libipolate.a
+   #wLDFLAGS+=-lipolate
 else ifeq ($(USE_IPOLATES),3)
    ipdir:=${cwd}/ip2lib_d
    iplib=${lib}/libip2_d.a
@@ -302,9 +304,11 @@
       ifneq "$(GFORTLIBDIR)" './'
           wLDFLAGS+=-L$(GFORTLIBDIR)
       endif
+      wFFLAGS+=$(CFLAGS) -fPIC
+      wCPPFLAGS+=$(CPPFLAGS) -DGFORTRAN -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
       wLDFLAGS+=-lgfortran
-      wCPPFLAGS+=-DGFORTRAN
-      wFFLAGS+=-c -O2
+#      wCPPFLAGS+=-DGFORTRAN
+#      wFFLAGS+=-c -O2
       FTN_REAL8:="-fdefault-real-8 -fdefault-double-8"
    endif
    ifeq ($(USE_OPENMP),1)
@@ -435,28 +439,27 @@
 
 g2cdir:=${cwd}/g2clib-1.4.0
 ifeq ($(USE_G2CLIB),1)
-   g2clib:=${lib}/libgrib2c.a
-   wLDFLAGS+=-lgrib2c
-   wCPPFLAGS+=-I$g
+   glib:=/usr/lib/libg2c.a
+   wLDFLAGS+=-L/usr/lib -lg2c
+   wCPPFLAGS+=-I/usr/include
    a:=$(shell echo "\#define USE_G2CLIB" >> ${CONFIG_H})
 else
    a:=$(shell echo "//\#define USE_G2CLIB" >> ${CONFIG_H})
 endif
 
 # gctpc library
-gctpcdir:=${cwd}/gctpc
-gctpcsrc:=gctpc20a.tgz
-gctpclib:=${lib}/libgeo.a
+gctpc:=/usr/lib
+gctpclib:=/usr/lib/libgeo.a
 wLDFLAGS+=-lgeo
-# wCPPFLAGS+=-I${gctpc}/source
+wCPPFLAGS+=-I/usr/include/gctpc
 
 # proj4 library
    proj4dir:=${cwd}/proj-4.8.0
 ifeq ($(USE_PROJ4),1)
-   proj4src:=${cwd}/proj-4.8.0.tar.gz
-   proj4lib:=${lib}/libproj.a
-   wLDFLAGS+=-lproj
-#   wCPPFLAGS+=-I${proj4dir}/src
+   proj4:=
+   proj4lib:=/usr/lib/libproj.so
+   wLDFLAGS+=-L/usr/lib -lproj
+   wCPPFLAGS+=-I/usr/include
    a:=$(shell echo "\#define USE_PROJ4" >> ${CONFIG_H})
 else
    a:=$(shell echo "//\#define USE_PROJ4" >> ${CONFIG_H})
@@ -466,10 +469,9 @@
 
 jasperdir=${cwd}/jasper-1.900.1
 ifeq ($(USE_JASPER),1)
-   jsrc=jasper-1.900.1-14ubuntu3.2.debian.tgz
-   jlib=${lib}/libjasper.a
-   wLDFLAGS+=-ljasper
-   wCPPFLAGS+=-I${jasperdir}/src/libjasper/include
+   jlib=/usr/lib/libjasper.so
+   wLDFLAGS+=-L/usr/lib -ljasper
+   wCPPFLAGS+=-I/usr/include
    a:=$(shell echo "\#define USE_JASPER" >> ${CONFIG_H})
 else
    a:=$(shell echo "//\#define USE_JASPER" >> ${CONFIG_H})
@@ -480,8 +482,8 @@
 aecdir=${cwd}/libaec-1.0.2
 ifeq ($(USE_AEC),1)
    aecsrc=libaec-1.0.2.tar.gz
-   aeclib=${lib}/libaec.a
-   wLDFLAGS+=-laec
+   aeclib=/usr/lib/libaec.so
+   wLDFLAGS+=-L/usr/lib -laec
    a:=$(shell echo "\#define USE_AEC \"${aecsrc}\"" >> ${CONFIG_H})
 else
    a:=$(shell echo "//\#define USE_AEC" >> ${CONFIG_H})
@@ -509,11 +511,17 @@
 hdf5dir:=${cwd}/hdf5-1.10.4
 netcdf4dir:=${cwd}/netcdf-4.6.1
 ifeq ($(USE_NETCDF4),1)
-   netcdf4src=netcdf-4.6.1.tar.gz
-   netcdf4lib:=${lib}/libnetcdf.a
-   hdf5src:=hdf5-1.10.4.tar.gz
-   hdf5lib:=${lib}/libhdf5.a
-   wLDFLAGS+=-lnetcdf -lhdf5_hl -lhdf5 -ldl
+   netcdf4src=
+   n4lib:=/usr/lib/libnetcdf.so
+   h5:=
+   h5lib:=
+   wLDFLAGS+=`nc-config --libs`
+   wCPPFLAGS+=`nc-config --cflags`
+#   netcdf4src=netcdf-4.6.1.tar.gz
+#   netcdf4lib:=${lib}/libnetcdf.a
+#   hdf5src:=hdf5-1.10.4.tar.gz
+#   hdf5lib:=${lib}/libhdf5.a
+#   wLDFLAGS+=-lnetcdf -lhdf5_hl -lhdf5 -ldl
 #   wCPPFLAGS+=-I${netcdf4dir}/include -I${hdf5dir}/src -I${hdf5dir}/hl/src
    a:=$(shell echo "\#define USE_NETCDF4" >> ${CONFIG_H})
    a:=$(shell echo "\#define HDF5 \"${hdf5src}\"" >> ${CONFIG_H})
@@ -573,18 +581,16 @@
 
 pngdir=${cwd}/libpng-1.2.57
 ifeq ($(USE_PNG),1)
-   pngsrc=${cwd}/libpng-1.2.57.tar.gz
-   pnglib=${lib}/libpng.a
+   pnglib=/usr/lib/libpng.so
    wLDFLAGS+=-lpng
 # wCPPFLAGS+=-I$p
    a:=$(shell echo "\#define USE_PNG" >> ${CONFIG_H})
 
 zdir=${cwd}/zlib-1.2.11
 # z
-   zsrc=${cwd}/zlib-1.2.11.tar.gz
-   zlib=${lib}/libz.a
-   wLDFLAGS+=-lz
-   # wCPPFLAGS+=-I$z
+   zlib=/usr/lib/libz.so
+   wLDFLAGS+=-L/usr/lib -lz
+   wCPPFLAGS+=-I/usr/include
 else
    a:=$(shell echo "//\#define USE_PNG" >> ${CONFIG_H})
 endif
@@ -638,106 +644,6 @@
 	export CPPFLAGS="${wCPPFLAGS}" && export FFLAGS="${wFFLAGS}" && cd c_api && ${MAKE}
 	cd lib && ${MAKE}
 
-${jasperdir}:
-	cp ${jsrc}  tmpj.tar.gz
-	gunzip -n -f tmpj.tar.gz
-	tar -xvf tmpj.tar
-	rm tmpj.tar
-
-${jlib}:	${jasperdir}
-	cd ${jasperdir} && export CC=${CCjasper} && ./configure --without-x --disable-libjpeg --disable-opengl --prefix=${cwd} && ${MAKE} -j 1 check install
-
-${aecdir}:
-	cp ${aecsrc} tmpaec.tar.gz
-	gunzip -n -f tmpaec.tar.gz
-	tar -xvf tmpaec.tar
-	rm tmpaec.tar
-
-${aeclib}:	${aecdir}
-	cd "${aecdir}" && export CFLAGS="${wCPPFLAGS}" && ./configure --disable-shared --prefix=${cwd} && ${MAKE} check install
-
-${pngdir}:
-	cp ${pngsrc} tmpp.tar.gz
-	gunzip -n -f tmpp.tar.gz
-	tar -xvf tmpp.tar
-	rm tmpp.tar
-
-${pnglib}:	${zlib} ${pngdir}
-#       for OSX
-#	export LDFLAGS="-L${lib}" && cd "${pngdir}" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} -f scripts/makefile.darwin
-#	for everybody else
-	export LDFLAGS="-L${lib}" && cd "${pngdir}" && export CFLAGS="-DPNG_USER_WIDTH_MAX=200000000L -I${cwd}/include" && ./configure --disable-shared --prefix=${cwd} && ${MAKE} check install
-
-${zdir}:
-	cp ${zsrc} tmpz.tar.gz
-	gunzip -f tmpz.tar.gz
-	tar -xvf tmpz.tar
-	rm tmpz.tar
-
-${zlib}:	${zdir}
-	cd ${zdir} && export CFLAGS="${wCPPFLAGS}" && ./configure --prefix=${cwd} --static && ${MAKE} install
-
-${g2clib}:	${jlib} ${pnglib} ${zlib}
-	cd "$g2cdir" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} && cp libgrib2c.a ${lib}
-
-${gctpcdir}/source/makefile.gctpc:
-	cp ${gctpcsrc} tmpgctpc.tar.gz
-	gunzip -n -f tmpgctpc.tar.gz
-	tar -xvf tmpgctpc.tar
-	rm tmpgctpc.tar
-	cp makefile.gctpc proj.h sominv.c somfor.c ${gctpcdir}/source/
-
-${gctpclib}:	${gctpcdir}/source/makefile.gctpc
-	cd "${gctpcdir}/source" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} -f makefile.gctpc
-	cp ${gctpcdir}/source/libgeo.a ${lib}
-	cp ${gctpcdir}/source/proj.h ${cwd}/include/
-
-${proj4lib}:
-	cp ${proj4src}  tmpproj4.tar.gz
-	gunzip -f tmpproj4.tar.gz
-	tar -xvf tmpproj4.tar
-	rm tmpproj4.tar
-	cd ${proj4dir} && ./configure --disable-shared --prefix=${cwd} && ${MAKE} check install
-
-${netcdf3dir}:
-	cp ${netcdf3src} tmpn.tar.gz
-	gunzip -f tmpn.tar.gz
-	tar -xvf tmpn.tar
-	rm tmpn.tar
-
-${netcdf3lib}:	${netcdf3dir}
-	cd ${netcdf3dir} && export CPPFLAGS="${netcdf3CPPFLAGS}" && ./configure --enable-c-only --prefix=${cwd} && ${MAKE} check install
-
-${netcdf4src}:
-	$(error ERROR, get netcdf4 source by "wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.6.1.tar.gz" )
-
-${netcdf4dir}:	${netcdf4src}
-	cp ${netcdf4src} tmpn4.tar.gz
-	gunzip -n -f tmpn4.tar.gz
-	tar -xvf tmpn4.tar
-	rm tmpn4.tar
-
-${netcdf4lib}:	${zlib} ${netcdf4dir} ${hdf5lib}
-	cd "${netcdf4dir}" && export CPPFLAGS="${netcdf4CPPFLAGS}" && export LDFLAGS="-L${lib}" && export LIBS="-lhdf5 -ldl" && ./configure --disable-fortran --disable-cxx --disable-dap --enable-netcdf-4 --prefix=${cwd} --disable-shared && ${MAKE} install
-
-${hdf5src}:
-	$(error ERROR, get hdf5 source by "wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.4/src/hdf5-1.10.4.tar.gz" )
-
-${hdf5dir}:	${hdf5src}
-	cp ${hdf5src} tmph5.tar.gz
-	gunzip -n -f tmph5.tar.gz
-	tar -xvf tmph5.tar
-	rm tmph5.tar
-
-${hdf5lib}:	${hdf5dir}
-	cd "${hdf5dir}" && export CFLAGS="${hdf5CFLAGS}" && export LDFLAGS="${LDFLAGS}" && ./configure --disable-shared --with-zlib=$z --prefix=${cwd} && ${MAKE} all check install
-
-${iplib}:
-	cd "${ipdir}" && export FFLAGS="${wFFLAGS}" && export FTN_REAL8=${FTN_REAL8}  && ${MAKE} && cp $(notdir ${iplib}) ${iplib}
-
-${spectrallib}:
-	cd "${spectraldir}" && export FFLAGS="${wFFLAGS}" && export FTN_REAL8=${FTN_REAL8}  && ${MAKE} && cp $(notdir ${spectrallib}) ${spectrallib}
-
 aux_progs/gmerge:	aux_progs/gmerge.c		
 	cd aux_progs && ${MAKE} -f gmerge.make