Commit af97ef5688793c11a1e4a0600276bf0edc7105c9

Authored by Elena.Budnik
1 parent 2de6f07c

make C executables in php/src

@@ -9,4 +9,5 @@ generic_data/ParamTemplate/ @@ -9,4 +9,5 @@ generic_data/ParamTemplate/
9 generic_data/ParamInfo/*.xml 9 generic_data/ParamInfo/*.xml
10 js/lib/ext/ 10 js/lib/ext/
11 help/ 11 help/
  12 +php/bin
12 *~ 13 *~
install-scripts.sh 0 → 100755
@@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
  1 +#!/bin/bash
  2 +
  3 +# script to compile/install php/src C executables
  4 +
  5 +# AMDA_IHM installation root
  6 +export IHM_DIR=/home/budnik/AMDA/AMDA_IHM
  7 +
  8 +export CDF_DIR=/usr/local/cdf
  9 +export CEF_DIR=/usr/local/cef
  10 +export DD_LIB=/usr/local/DDClient/lib
  11 +export DD_INCLUDE=/usr/local/DDClient/include/DDClientLibC
  12 +
  13 +cd $IHM_DIR/php/src && make clean && make && make install && make clean
  14 +cd $IHM_DIR
  15 +
php/src/Makefile
1 -INC = -I/usr/include -I/usr/local/include -I/usr/local/cdf/include -I/usr/local/cef/include -I/home/budnik/AMDANEW/DDLIB/include  
2 -LIB = -L/usr/lib -L/usr/local/lib -L/usr/local/cdf/lib -L/usr/local/cef/lib -L/home/budnik/AMDANEW/DDLIB/lib  
3 -CFLAGS = -ggdb -DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double 1 +INC = -I/usr/include -I/usr/local/include -I${CDF_DIR}/include -I${CEF_DIR}/include -I${DD_INCLUDE}
  2 +LIB = -L/usr/lib64 -L/usr/local/lib64 -L${CDF_DIR}/lib -L${CEF_DIR}/lib -L${DD_LIB}
  3 +CFLAGS = -ggdb -DLINUX -m64 -march=core2 -fPIC -Dlinux -D_REENTRANT -malign-double
4 CC = gcc 4 CC = gcc
5 5
6 EXE = nctimestring2double nctimeinfo getncvars ncvarinfo \ 6 EXE = nctimestring2double nctimeinfo getncvars ncvarinfo \
7 cefstartstop cefvarinfo cefinfo cefsampling ceftimeinfo \ 7 cefstartstop cefvarinfo cefinfo cefsampling ceftimeinfo \
8 cdfinfo cdfvarinfo cdfstartstopfromdata cdfsamplingfromdata 8 cdfinfo cdfvarinfo cdfstartstopfromdata cdfsamplingfromdata
9 9
10 -lib: $(EXE) 10 +lib: ${EXE}
11 11
12 nctimestring2double: nctimestring2double.o 12 nctimestring2double: nctimestring2double.o
13 - ${CC} -o nctimestring2double nctimestring2double.o ${LIB} -lDD -lnetcdf 13 + ${CC} -o nctimestring2double nctimestring2double.o ${LIB} -lDDClientLibC -lnetcdf
14 14
15 nctimestring2double.o: nctimestring2double.c 15 nctimestring2double.o: nctimestring2double.c
16 ${CC} ${CFLAGS} -c nctimestring2double.c ${INC} 16 ${CC} ${CFLAGS} -c nctimestring2double.c ${INC}
@@ -88,11 +88,12 @@ cdfsamplingfromdata.o: cdfsamplingfromdata.c @@ -88,11 +88,12 @@ cdfsamplingfromdata.o: cdfsamplingfromdata.c
88 ${CC} ${CFLAGS} -c cdfsamplingfromdata.c ${INC} 88 ${CC} ${CFLAGS} -c cdfsamplingfromdata.c ${INC}
89 89
90 install: 90 install:
91 - cp $(EXE) ../bin 91 + install -d -m a+rx,ug+w ${IHM_DIR}/php/bin
  92 + cp ${EXE} ${IHM_DIR}/php/bin
92 93
93 clean: 94 clean:
94 tag="*.o ${EXE}";\ 95 tag="*.o ${EXE}";\
95 - for file in $$tag; do \ 96 + for file in $$tag; do \
96 echo $$file; rm -f $$file;\ 97 echo $$file; rm -f $$file;\
97 done 98 done
98 - find -name \*~ -delete  
99 \ No newline at end of file 99 \ No newline at end of file
  100 + find -name \*~ -delete
php/src/nctimeinfo.c
@@ -55,7 +55,7 @@ main(int argc, char **argv) @@ -55,7 +55,7 @@ main(int argc, char **argv)
55 55
56 for (i = 0; i < 2; i++) { 56 for (i = 0; i < 2; i++) {
57 sampling = time_double[i+1] - time_double[i]; 57 sampling = time_double[i+1] - time_double[i];
58 - if (sampling < sampling_min) sampling_min = sampling; 58 + if (sampling < sampling_min && sampling > 0.0) sampling_min = sampling;
59 } 59 }
60 60
61 printf("%lf:", time_double[0]); 61 printf("%lf:", time_double[0]);
@@ -69,7 +69,7 @@ main(int argc, char **argv) @@ -69,7 +69,7 @@ main(int argc, char **argv)
69 69
70 for (i = 0; i < 2; i++) { 70 for (i = 0; i < 2; i++) {
71 sampling = time_double[i+1] - time_double[i]; 71 sampling = time_double[i+1] - time_double[i];
72 - if (sampling < sampling_min) sampling_min = sampling; 72 + if (sampling < sampling_min && sampling > 0.0) sampling_min = sampling;
73 } 73 }
74 74
75 printf("%lf", sampling_min); 75 printf("%lf", sampling_min);