diff --git a/.gitignore b/.gitignore index 112b9f6..4104245 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ generic_data/ParamTemplate/ generic_data/ParamInfo/*.xml js/lib/ext/ help/ +php/bin *~ diff --git a/install-scripts.sh b/install-scripts.sh new file mode 100755 index 0000000..32d4b4b --- /dev/null +++ b/install-scripts.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# script to compile/install php/src C executables + +# AMDA_IHM installation root +export IHM_DIR=/home/budnik/AMDA/AMDA_IHM + +export CDF_DIR=/usr/local/cdf +export CEF_DIR=/usr/local/cef +export DD_LIB=/usr/local/DDClient/lib +export DD_INCLUDE=/usr/local/DDClient/include/DDClientLibC + +cd $IHM_DIR/php/src && make clean && make && make install && make clean +cd $IHM_DIR + diff --git a/php/src/Makefile b/php/src/Makefile index 2c5890c..608bcc0 100644 --- a/php/src/Makefile +++ b/php/src/Makefile @@ -1,16 +1,16 @@ -INC = -I/usr/include -I/usr/local/include -I/usr/local/cdf/include -I/usr/local/cef/include -I/home/budnik/AMDANEW/DDLIB/include -LIB = -L/usr/lib -L/usr/local/lib -L/usr/local/cdf/lib -L/usr/local/cef/lib -L/home/budnik/AMDANEW/DDLIB/lib -CFLAGS = -ggdb -DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double +INC = -I/usr/include -I/usr/local/include -I${CDF_DIR}/include -I${CEF_DIR}/include -I${DD_INCLUDE} +LIB = -L/usr/lib64 -L/usr/local/lib64 -L${CDF_DIR}/lib -L${CEF_DIR}/lib -L${DD_LIB} +CFLAGS = -ggdb -DLINUX -m64 -march=core2 -fPIC -Dlinux -D_REENTRANT -malign-double CC = gcc EXE = nctimestring2double nctimeinfo getncvars ncvarinfo \ cefstartstop cefvarinfo cefinfo cefsampling ceftimeinfo \ cdfinfo cdfvarinfo cdfstartstopfromdata cdfsamplingfromdata -lib: $(EXE) +lib: ${EXE} nctimestring2double: nctimestring2double.o - ${CC} -o nctimestring2double nctimestring2double.o ${LIB} -lDD -lnetcdf + ${CC} -o nctimestring2double nctimestring2double.o ${LIB} -lDDClientLibC -lnetcdf nctimestring2double.o: nctimestring2double.c ${CC} ${CFLAGS} -c nctimestring2double.c ${INC} @@ -88,11 +88,12 @@ cdfsamplingfromdata.o: cdfsamplingfromdata.c ${CC} ${CFLAGS} -c cdfsamplingfromdata.c ${INC} install: - cp $(EXE) ../bin + install -d -m a+rx,ug+w ${IHM_DIR}/php/bin + cp ${EXE} ${IHM_DIR}/php/bin clean: tag="*.o ${EXE}";\ - for file in $$tag; do \ + for file in $$tag; do \ echo $$file; rm -f $$file;\ done - find -name \*~ -delete \ No newline at end of file + find -name \*~ -delete diff --git a/php/src/nctimeinfo.c b/php/src/nctimeinfo.c index bc93039..0bc95d8 100644 --- a/php/src/nctimeinfo.c +++ b/php/src/nctimeinfo.c @@ -55,7 +55,7 @@ main(int argc, char **argv) for (i = 0; i < 2; i++) { sampling = time_double[i+1] - time_double[i]; - if (sampling < sampling_min) sampling_min = sampling; + if (sampling < sampling_min && sampling > 0.0) sampling_min = sampling; } printf("%lf:", time_double[0]); @@ -69,7 +69,7 @@ main(int argc, char **argv) for (i = 0; i < 2; i++) { sampling = time_double[i+1] - time_double[i]; - if (sampling < sampling_min) sampling_min = sampling; + if (sampling < sampling_min && sampling > 0.0) sampling_min = sampling; } printf("%lf", sampling_min); -- libgit2 0.21.2