diff --git a/Makefile b/Makefile index 4f264a7b..1fd458eb 100644 --- a/Makefile +++ b/Makefile @@ -61,17 +61,16 @@ VELOOBJ = velo.o velosim.o velodorn.o velodornier.o #----- comment or uncomment the following according to operating system #------------- for Digital Unix -BINTARGET=bin -HDFROOT=/data/lnslib -CC=cc -EXTRA= -CFLAGS = -I$(HDFROOT)/include -Ihardsup -DHDF4 -DHDF5 -I. -std1 \ - -g -warnprotos -c +#HDFROOT=/data/koenneck +#CC=cc +#EXTRA= +#CFLAGS = -I$(HDFROOT)/include -Ihardsup -DHDF4 -DHDF5 -I. -std1 \ +# -g -warnprotos -c #CFLAGS = -I$(HDFROOT)/include -DFORTIFY -DHDF4 -DHDF5 -Ihardsup -g \ # -std1 -warnprotos -c -LIBS = -L$(HDFROOT)/lib -Lhardsup -lhlib -Lmatrix -lmatrix -Ltecs \ - -ltecsl -ltcl8.0 -lfor $(HDFROOT)/lib/libhdf5.a \ - -lmfhdf -ldf $(HDFROOT)/lib/libjpeg.a -lz -lm -ll -lc +#LIBS = -L$(HDFROOT)/lib -Lhardsup -lhlib -Lmatrix -lmatrix -Ltecs \ +# -ltecsl -ltcl8.0 -lfor $(HDFROOT)/lib/libhdf5.a \ +# -lmfhdf -ldf $(HDFROOT)/lib/libjpeg.a -lz -lm -ll -lc #------- for cygnus #HDFROOT=../HDF411 @@ -82,15 +81,17 @@ LIBS = -L$(HDFROOT)/lib -Lhardsup -lhlib -Lmatrix -lmatrix -Ltecs \ # -lmfhdf -ldf -ljpeg -lz -lm #---------- for linux -#BINTARGET=$(HOME)/bin/linux.i686 -#HDFROOT=/usr/local -#CC=gcc -#CFLAGS = -I$(HDFROOT)/include -Ihardsup -fwritable-strings \ -# -DCYGNUS -DNONINTF -g -c -#LIBS= -L$(HDFROOT)/lib -Lhardsup -Ltecs -ltecsl -Lmatrix -lmatrix -lhlib \ -# -ltcl8.0 -lmfhdf -ldf -ljpeg -lz -lm -lg2c -ldl -#EXTRA=nintf.o -#--------------------------------------------------------------------------- +BINTARGET=../bin +HDFROOT=/usr/local +CC=gcc +CFLAGS = -I$(HDFROOT)/include -DHDF4 -Ihardsup -fwritable-strings \ + -DCYGNUS -DNONINTF -g -c +#CFLAGS = -I$(HDFROOT)/include -Ihardsup -fwritable-strings -DFORTIFY \ +# -DCYGNUS -DNONINTF -g -c +LIBS= -L$(HDFROOT)/lib -Lhardsup -Ltecs -ltecsl -Lmatrix -lmatrix -lhlib \ + -ltcl8.0 -lmfhdf -ldf -ljpeg -lz -lm -lg2c -ldl +EXTRA=nintf.o +#--------------------------------- .c.o: $(CC) $(CFLAGS) $*.c diff --git a/countdriv.c b/countdriv.c index 40d1967b..4c8a9634 100644 --- a/countdriv.c +++ b/countdriv.c @@ -158,6 +158,9 @@ return HWPause; } } +#ifdef NONINTF + extern float nintf(float f); +#endif /*-------------------------------------------------------------------------*/ static int EL737Start(struct __COUNTER *self) { diff --git a/counter.c b/counter.c index 3d825b6e..6486551e 100644 --- a/counter.c +++ b/counter.c @@ -593,6 +593,9 @@ assert(self); return self->pDriv->iNoOfMonitors; } +#ifdef NONINTF + extern float nintf(float f); +#endif /*------------------------------------------------------------------------*/ int SetCounterPreset(pCounter self, float fVal) { diff --git a/hardsup/Makefile b/hardsup/Makefile index 13f19d5d..a93165ef 100644 --- a/hardsup/Makefile +++ b/hardsup/Makefile @@ -3,23 +3,19 @@ # # Mark Koennecke, November 1996 #-------------------------------------------------------------------------- +.SUFFIXES: +.SUFFIXES: .c .o OBJ= el734_utility.o asynsrv_utility.o stredit.o \ strjoin.o failinet.o geterrno.o el737_utility.o sinqhm.o serialsinq.o \ itc4util.o dillutil.o table.o el755_utility.o el755_errorlog.o \ makeprint.o StrMatch.o #---------- for Redhat linux -#CC= gcc -#CFLAGS= -I. -I../ -DLINUX -g -c -## CC= gcc -## CFLAGS= -I. -I../ -DLINUX -g -c - +CC= gcc +CFLAGS= -I/usr/local/include -I. -I../ -DLINUX -g -c #------------ for DigitalUnix -CC=cc -CFLAGS= -I. -I../ -std1 -g -c - CC=cc - CFLAGS= -I. -I../ -std1 -g -c - +#CC=cc +#CFLAGS= -I/data/koenneck/include -I. -I../ -std1 -g -c #------------ for DigitalUnix with Fortify ## CC=cc ## CFLAGS= -DFORTIFY -I. -I../ -std1 -g -c diff --git a/hardsup/el734_utility.c b/hardsup/el734_utility.c index 9fc0722f..f5924f48 100644 --- a/hardsup/el734_utility.c +++ b/hardsup/el734_utility.c @@ -2581,7 +2581,13 @@ #include struct timespec delay = {0, 250000000}; struct timespec delay_left; + +#ifdef LINUX +#define hibernate nanosleep(&delay, &delay_left) +#else #define hibernate nanosleep_d9 (&delay, &delay_left) +#endif + #endif int msr, ss; struct EL734info *info_ptr; diff --git a/hardsup/el737_utility.c b/hardsup/el737_utility.c index f3021a58..1a5bde8c 100644 --- a/hardsup/el737_utility.c +++ b/hardsup/el737_utility.c @@ -1711,7 +1711,12 @@ #include struct timespec delay = {0, 250000000}; struct timespec delay_left; +#ifdef LINUX +#define hibernate nanosleep(&delay, &delay_left) +#else #define hibernate nanosleep_d9 (&delay, &delay_left) +#endif + #endif int my_rs; struct EL737info *info_ptr; diff --git a/nextrics.c b/nextrics.c index 63143d29..1f8d225d 100644 --- a/nextrics.c +++ b/nextrics.c @@ -34,20 +34,20 @@ #include "nextrics.h" #define DET1X 256 /* x -length of detector 1 */ -#define DET1Y 256 /* y-length of detector 1 */ +#define DET1Y 128 /* y-length of detector 1 */ #define DET1XS 2 /* pixel size in x of detector 1 */ #define DET1YS 2 /* pixel size in y of detector 1 */ #define DET1DESC "EMBL PSD" #define DET2X 256 /* x -length of detector 1 */ -#define DET2Y 256 /* y-length of detector 1 */ +#define DET2Y 128 /* y-length of detector 1 */ #define DET2XS 2 /* pixel size in x of detector 1 */ #define DET2YS 2 /* pixel size in y of detector 1 */ -#define DET2DESC "Non existent second Detector" +#define DET2DESC "EMBL PSD" #define DET3X 256 /* x -length of detector 1 */ -#define DET3Y 256 /* y-length of detector 1 */ +#define DET3Y 128 /* y-length of detector 1 */ #define DET3XS 2 /* pixel size in x of detector 1 */ #define DET3YS 2 /* pixel size in y of detector 1 */ -#define DET3DESC "Non existent third Detector" +#define DET3DESC "EMBL PSD" #define DETAMAX 256 /* maximum length of pixelsize array */ /* histogram memory names */ @@ -444,7 +444,7 @@ name of hkl object holding crystallographic information NXDupdate(self->pDict,"dnumber",pBueffel); SNXSPutMotor(pServ->pSics,pCon,hfil,self->pDict, "frametilt","DG3"); - GetHistogram(self->pHistogram2,pCon,0,0,DET3X*DET3Y,lData, + GetHistogram(self->pHistogram3,pCon,0,0,DET3X*DET3Y,lData, DET3X*DET3Y*sizeof(HistInt)); NXDputalias(hfil,self->pDict,"framecounts",lData); @@ -1523,3 +1523,4 @@ name of hkl object holding crystallographic information return 0; } + diff --git a/nintf.c b/nintf.c index 6d829df9..42e554e0 100644 --- a/nintf.c +++ b/nintf.c @@ -8,10 +8,11 @@ #include float nintf(float f) { - double ip, rm; + double ip, rm, dVal; float fRes; - rm = modf(f,&ip); + dVal = (double)f; + rm = modf(dVal,&ip); if(rm < .0)rm = -rm; if(rm > .5) { diff --git a/nxdata.c b/nxdata.c index 6b028d04..1bd999cd 100644 --- a/nxdata.c +++ b/nxdata.c @@ -446,7 +446,9 @@ } return SNputdata1att(hfil,dataname, DFNT_FLOAT32,1,&fVal,"Units",units); } - +#ifdef NONINTF + extern float nintf(float f); +#endif /*--------------------------------------------------------------------------*/ int SNMakeDMC(SConnection *pCon, SicsInterp *pSics) { diff --git a/tecs/Makefile b/tecs/Makefile index bc275d1c..cd36a9ff 100644 --- a/tecs/Makefile +++ b/tecs/Makefile @@ -10,10 +10,17 @@ TCLI_OBJ= sys_aunix.o sys_aunix_c.o $(CLI_OBJ) TECLI_OBJ= tecs_client.o tecs_plot.o tecs_for.o sys_util.o str.o instr_hosts.o $(TCLI_OBJ) #------------ for DigitalUnix (add -DFORTIFY to CFLAGS for fortified version) -CC=cc - +#CC=cc #CFLAGS= -std1 -g -warnprotos -I../ -I. -I../hardsup -DFORTIFY -CFLAGS= -std1 -g -warnprotos -I../ -I. -I../hardsup +#CFLAGS= -std1 -g -warnprotos -I../ -I. -I../hardsup + +#---------- for Redhat linux +CC= gcc +CFLAGS= -I/usr/local/include -I. -I../ -I../hardsup -DLINUX -g +#------------ for Linux +##CC=gcc +##CFLAGS = -fwritable-strings -DCYGNUS -DNONINTF -g -I../ -I. -I../hardsup +#------------ .f.o: f77 -c -u -g $*.f @@ -31,10 +38,18 @@ all: libtecsl.a bin/TecsServer bin/TecsClient rstart bin/keep_running tecs_plot.o: tecs_plot.f90 f90 -c -u -g tecs_plot.f90 + +#------------ DigitalUnix4.0D +#bin/TecsServer: $(LIBR_OBJ) $(SERV_OBJ) +# - rm bin/TecsServer +# $(CC) $(CFLAGS) -g -o bin/TecsServer -g $(LIBR_OBJ) $(SERV_OBJ) fortify1.c \ +# -lm -L../hardsup -lhlib -lfor + +#---------- Linux bin/TecsServer: $(SERV_OBJ) - rm bin/TecsServer - $(CC) $(CFLAGS) -o bin/TecsServer -g $(SERV_OBJ) fortify1.c \ - -lm -L../hardsup -lhlib -lfor + $(CC) $(CFLAGS) -o bin/TecsServer $(SERV_OBJ) fortify1.c \ + -lm -L../hardsup -lhlib bin/TecsClient: $(TECLI_OBJ) f77 -o bin/TecsClient -g $(TECLI_OBJ) \ diff --git a/tecs/sys_util.h b/tecs/sys_util.h index f7a40085..4d6df66a 100644 --- a/tecs/sys_util.h +++ b/tecs/sys_util.h @@ -31,7 +31,7 @@ typedef size_t sys_adr_len; /* argument of accept and gethostbyadr */ void sys_ctrl_init(void); -#elif defined __alpha +#elif defined __unix #define F_CHAR(VAR) char *VAR #define STR_TO_C(DST,SRC) str_ntrim(DST, SRC, sizeof(DST), SRC##_len) @@ -39,7 +39,7 @@ void sys_ctrl_init(void); typedef int sys_adr_len; /* argument of accept and gethostbyadr */ -#define sys_ctrl_init(DUMMY) +#define sys_ctrl_init() {} #else diff --git a/tecs/tecs_dlog.f b/tecs/tecs_dlog.f index 65784ea8..814b4955 100644 --- a/tecs/tecs_dlog.f +++ b/tecs/tecs_dlog.f @@ -13,7 +13,6 @@ logical done integer i,iostat - data lunw/0/ if (lunw .ne. 0) then call err_msg('file already open for write') @@ -24,7 +23,7 @@ vers=0 - open(lunw, name=file, status='old', access='direct', shared + open(lunw, name=file, status='old', access='direct' 1 , recl=recl, iostat=iostat) if (iostat .eq. 0) then read(lunw, rec=1, iostat=iostat) vers, stim, etim, wrec, rrec, wdir @@ -45,7 +44,7 @@ etim=0 wrec=-1 rrec=0 - open(lunw, name=file, status='new', access='direct', shared + open(lunw, name=file, status='new', access='direct' 1 , recl=recl, err=93) else dlog_open_w=1 ! reopened @@ -78,7 +77,6 @@ include 'tecs_dlog.inc' integer p,r,i,j,btim - data update/.true./ logical done integer dlog_put_ @@ -220,7 +218,6 @@ logical done integer iostat - data lunr/0/ integer sys_gmt_off @@ -232,8 +229,8 @@ lunr=39 - open(lunr, name=file, status='old', access='direct', shared - 1 , recl=recl, err=99, readonly) + open(lunr, name=file, status='old', access='direct' + 1 , recl=recl, err=99) call dlog_read_block(1, done) if (.not. done) then close(lunr) diff --git a/utils/Makefile b/utils/Makefile index 5a0d0f8c..bbff3c84 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -7,15 +7,16 @@ #-------------------------------------------------------------------------- #------------ for DigitalUnix (add -DFORTIFY to CFLAGS for fortified version) -CC = cc -CFLAGS = -std -g -warnprotos -I. -I../hardsup -BIN = ../bin -LFLAGS = -L../hardsup +#CC = cc +#CFLAGS = -std -g -warnprotos -I. -I../hardsup +#BIN = ../bin +#LFLAGS = -L../hardsup + #------------ for Linux -#CC = gcc -#CFLAGS = -g -I. -I../hardsup -DLinux -#BIN = linux.i686 -#LFLAGS = -L../hardsup -L/usr/X11R6/lib +CC = gcc +CFLAGS = -g -I. -I../hardsup -DLinux +BIN = ../bin +LFLAGS = -L../hardsup -L/usr/X11R6/lib #------------ #---------------------------------------------------------- @@ -30,8 +31,9 @@ all: $(BIN)/asynsrv_test \ $(BIN)/SerPortServer: SerPortServer.c rm -f $(BIN)/SerPortServer - $(CC) $(CFLAGS) -o $(BIN)/SerPortServer \ - SerPortServer.c $(LFLAGS) -lhlib -lX11 + $(CC) $(CFLAGS) -o $(BIN)/SerPortServer \ + SerPortServer.c $(LFLAGS) -lhlib -lX11 + $(BIN)/asynsrv_test: asynsrv_test.c rm -f $(BIN)/asynsrv_test