--- 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