--- makefile 2016-02-23 16:57:00.000000000 +0100 +++ makefile.new 2016-07-15 08:40:50.162429077 +0200 @@ -77,8 +77,8 @@ # SHELL=/bin/sh -#export CC=gcc -#export FC=gfortran +export CC=gcc +export FC=gfortran # # netcdf3: write netcdf files with netcdf-3 library # netcdf4: write netcdf files with netcdf-4 library @@ -98,20 +98,20 @@ # # 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=0 -USE_UDF=0 +USE_MYSQL=1 +USE_IPOLATES=1 +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=0 -USE_G2CLIB=0 +USE_G2CLIB=1 USE_PNG=1 USE_JASPER=1 @@ -187,7 +187,7 @@ # wLDFLAGS has the directory/name of the library ifeq ($(findstring gcc,$(notdir $(CC))),gcc) - wCPPFLAGS+=-Wall -Wmissing-prototypes -Wold-style-definition -Werror=format-security -ffast-math -O3 + wCPPFLAGS+=$(CPPFLAGS) -DGFORTRAN netcdf3CPPFLAGS+=-Wall -Wmissing-prototypes -Wold-style-definition -Werror=format-security -O3 hdf5CFLAGS+=-Wall -Wmissing-prototypes -Wold-style-definition -O1 endif @@ -261,7 +261,7 @@ wLDFLAGS+=-L$(GFORTLIBDIR) wLDFLAGS+=-lgfortran wCPPFLAGS+=-DGFORTRAN - wFFLAGS+=-O2 + wFFLAGS+=$(CFLAGS) endif # for open64 fortran - personal system @@ -305,10 +305,9 @@ # ifeq ($(USE_G2CLIB),1) - g:=${cwd}/g2clib-1.4.0 - glib:=${lib}/libgrib2c.a - wLDFLAGS+=-lgrib2c - wCPPFLAGS+=-I$g + glib:=/usr/lib/libg2c.a + wLDFLAGS+=-L/usr/lib -lg2c + wCPPFLAGS+=-I/usr/include endif @@ -319,19 +318,17 @@ endif # gctpc library -gctpc:=${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 ifeq ($(USE_PROJ4),1) - proj4:=${cwd}/proj-4.8.0 - proj4src:=${cwd}/proj-4.8.0.tar.gz - proj4lib:=${lib}/libproj.a - wLDFLAGS+=-lproj -# wCPPFLAGS+=-I${proj4}/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}) @@ -340,12 +337,9 @@ # Jasper ifeq ($(USE_JASPER),1) - j=${cwd}/jasper-1.900.1 -# jsrc=jasper-fedora19.tgz - jsrc=jasper-1.900.1-14ubuntu3.2.debian.tgz - jlib=${lib}/libjasper.a - wLDFLAGS+=-ljasper -# wCPPFLAGS+=-I$j/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}) @@ -364,14 +358,11 @@ endif ifeq ($(USE_NETCDF4),1) - n4:=${cwd}/netcdf-4.3.3 - netcdf4src=netcdf-4.3.3.tar.gz - n4lib:=${lib}/libnetcdf.a - h5:=${cwd}/hdf5-1.8.16 - hdf5src:=hdf5-1.8.16.tar.gz - h5lib:=${lib}/libhdf5.a - wLDFLAGS+=-lnetcdf -lhdf5_hl -lhdf5 -ldl -# wCPPFLAGS+=-I${n4}/include -I${h5}/src -I${h5}/hl/src + n4lib:=/usr/lib/libnetcdf.so + h5:= + h5lib:= + wLDFLAGS+=`nc-config --libs` + wCPPFLAGS+=`nc-config --cflags` a:=$(shell echo "\#define USE_NETCDF4" >> ${CONFIG_H}) else a:=$(shell echo "//\#define USE_NETCDF4" >> ${CONFIG_H}) @@ -428,19 +419,14 @@ # png ifeq ($(USE_PNG),1) - p=${cwd}/libpng-1.2.54 - psrc=${cwd}/libpng-1.2.54.tar.gz - plib=${lib}/libpng.a - wLDFLAGS+=-lpng -# wCPPFLAGS+=-I$p - a:=$(shell echo "\#define USE_PNG" >> ${CONFIG_H}) - + plib=/usr/lib/libpng.so + wLDFLAGS+=-L/usr/lib -lpng + wCPPFLAGS+=-I/usr/include # z - - z=${cwd}/zlib-1.2.8 - zlib=${lib}/libz.a - wLDFLAGS+=-lz - # wCPPFLAGS+=-I$z + zlib=/usr/lib/libz.so + wLDFLAGS+=-L/usr/lib -lz + wCPPFLAGS+=-I/usr/include + a:=$(shell echo "\#define USE_PNG" >> ${CONFIG_H}) else a:=$(shell echo "//\#define USE_PNG" >> ${CONFIG_H}) endif @@ -494,81 +480,6 @@ cp wgrib2/wgrib2_api.h lib/ cd lib ; touch libwgrib2.a ; rm libwgrib2.a ; ar crsT libwgrib2.a *.a -${jlib}: - cp ${jsrc} tmpj.tar.gz - gunzip -n -f tmpj.tar.gz - tar -xvf tmpj.tar - rm tmpj.tar - cd "$j" && export CFLAGS="${wCPPFLAGS}" && ./configure --without-x --disable-libjpeg --disable-opengl --prefix=${cwd} && ${MAKE} check install - -${plib}: ${zlib} - cp ${psrc} tmpp.tar.gz - gunzip -n -f tmpp.tar.gz - tar -xvf tmpp.tar - rm tmpp.tar -# for OSX -# export LDFLAGS="-L$z" && cd "$p" && export CPPFLAGS="${wCPPFLAGS}" && make -f scripts/makefile.darwin -# for everybody else - export LDFLAGS="-L${lib}" && cd "$p" && export CPPFLAGS="${wCPPFLAGS}" && ./configure --disable-shared --prefix=${cwd} && ${MAKE} check install - -${zlib}: - cp $z.tar.gz tmpz.tar.gz - gunzip -f tmpz.tar.gz - tar -xvf tmpz.tar - rm tmpz.tar - cd "$z" && export CFLAGS="${wCPPFLAGS}" && ./configure --prefix=${cwd} && ${MAKE} check install - - -${glib}: ${jlib} ${plib} ${zlib} - touch ${glib} - rm ${glib} - cd "$g" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} && cp libgrib2c.a ${lib} - -${gctpclib}: - 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 ${gctpc}/source/ - cd "${gctpc}/source" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} -f makefile.gctpc - cp ${gctpc}/source/libgeo.a ${lib} - cp ${gctpc}/source/proj.h ${cwd}/include/ - -${proj4lib}: - cp ${proj4src} tmpproj4.tar.gz - gunzip -f tmpproj4.tar.gz - tar -xvf tmpproj4.tar - rm tmpproj4.tar - cd ${proj4} && ./configure --disable-shared --prefix=${cwd} && ${MAKE} check install - -${nlib}: - cp ${netcdfsrc} tmpn.tar.gz - gunzip -f tmpn.tar.gz - tar -xvf tmpn.tar - rm tmpn.tar - cd $n && export CPPFLAGS="${netcdf3CPPFLAGS}" && ./configure --enable-c-only --prefix=${cwd} && ${MAKE} check install - -${n4lib}: ${zlib} ${netcdf4src} ${h5lib} - cp ${netcdf4src} tmpn4.tar.gz - gunzip -n -f tmpn4.tar.gz - tar -xvf tmpn4.tar - rm tmpn4.tar - cd "${n4}" && export CPPFLAGS="${wCPPFLAGS}" && export LDFLAGS="-L${lib}" && export LIBS="-lhdf5 -ldl" && ./configure --disable-fortran --disable-cxx --disable-dap --enable-netcdf-4 --prefix=${cwd} --disable-shared && ${MAKE} install - -${netcdf4src}: - $(error ERROR, get netcdf4 source by "wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.3.tar.gz" ) - -${h5lib}: ${hdf5src} - cp ${hdf5src} tmph5.tar.gz - gunzip -n -f tmph5.tar.gz - tar -xvf tmph5.tar - rm tmph5.tar - cd "${h5}" && export CFLAGS="${hdf5CFLAGS}" && export LDFLAGS="${LDFLAGS}" && ./configure --disable-shared --with-zlib=$z --prefix=${cwd} && ${MAKE} all check install - - -${hdf5src}: - $(error ERROR, get hdf5 source by "wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.16/src/hdf5-1.8.16.tar.gz" ) - ${iplib}: cd "${ip}" && export FFLAGS="${wFFLAGS}" && ${MAKE} && cp libipolate.a ${iplib}