- Added new napi files

- Port to Linux
This commit is contained in:
cvs
2001-11-14 07:14:04 +00:00
parent 6c5db4ffd0
commit 3712dca74e
13 changed files with 93 additions and 61 deletions

View File

@ -61,17 +61,16 @@ VELOOBJ = velo.o velosim.o velodorn.o velodornier.o
#----- comment or uncomment the following according to operating system #----- comment or uncomment the following according to operating system
#------------- for Digital Unix #------------- for Digital Unix
BINTARGET=bin #HDFROOT=/data/koenneck
HDFROOT=/data/lnslib #CC=cc
CC=cc #EXTRA=
EXTRA= #CFLAGS = -I$(HDFROOT)/include -Ihardsup -DHDF4 -DHDF5 -I. -std1 \
CFLAGS = -I$(HDFROOT)/include -Ihardsup -DHDF4 -DHDF5 -I. -std1 \ # -g -warnprotos -c
-g -warnprotos -c
#CFLAGS = -I$(HDFROOT)/include -DFORTIFY -DHDF4 -DHDF5 -Ihardsup -g \ #CFLAGS = -I$(HDFROOT)/include -DFORTIFY -DHDF4 -DHDF5 -Ihardsup -g \
# -std1 -warnprotos -c # -std1 -warnprotos -c
LIBS = -L$(HDFROOT)/lib -Lhardsup -lhlib -Lmatrix -lmatrix -Ltecs \ #LIBS = -L$(HDFROOT)/lib -Lhardsup -lhlib -Lmatrix -lmatrix -Ltecs \
-ltecsl -ltcl8.0 -lfor $(HDFROOT)/lib/libhdf5.a \ # -ltecsl -ltcl8.0 -lfor $(HDFROOT)/lib/libhdf5.a \
-lmfhdf -ldf $(HDFROOT)/lib/libjpeg.a -lz -lm -ll -lc # -lmfhdf -ldf $(HDFROOT)/lib/libjpeg.a -lz -lm -ll -lc
#------- for cygnus #------- for cygnus
#HDFROOT=../HDF411 #HDFROOT=../HDF411
@ -82,15 +81,17 @@ LIBS = -L$(HDFROOT)/lib -Lhardsup -lhlib -Lmatrix -lmatrix -Ltecs \
# -lmfhdf -ldf -ljpeg -lz -lm # -lmfhdf -ldf -ljpeg -lz -lm
#---------- for linux #---------- for linux
#BINTARGET=$(HOME)/bin/linux.i686 BINTARGET=../bin
#HDFROOT=/usr/local HDFROOT=/usr/local
#CC=gcc CC=gcc
#CFLAGS = -I$(HDFROOT)/include -Ihardsup -fwritable-strings \ CFLAGS = -I$(HDFROOT)/include -DHDF4 -Ihardsup -fwritable-strings \
# -DCYGNUS -DNONINTF -g -c -DCYGNUS -DNONINTF -g -c
#LIBS= -L$(HDFROOT)/lib -Lhardsup -Ltecs -ltecsl -Lmatrix -lmatrix -lhlib \ #CFLAGS = -I$(HDFROOT)/include -Ihardsup -fwritable-strings -DFORTIFY \
# -ltcl8.0 -lmfhdf -ldf -ljpeg -lz -lm -lg2c -ldl # -DCYGNUS -DNONINTF -g -c
#EXTRA=nintf.o LIBS= -L$(HDFROOT)/lib -Lhardsup -Ltecs -ltecsl -Lmatrix -lmatrix -lhlib \
#--------------------------------------------------------------------------- -ltcl8.0 -lmfhdf -ldf -ljpeg -lz -lm -lg2c -ldl
EXTRA=nintf.o
#---------------------------------
.c.o: .c.o:
$(CC) $(CFLAGS) $*.c $(CC) $(CFLAGS) $*.c

View File

@ -158,6 +158,9 @@
return HWPause; return HWPause;
} }
} }
#ifdef NONINTF
extern float nintf(float f);
#endif
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int EL737Start(struct __COUNTER *self) static int EL737Start(struct __COUNTER *self)
{ {

View File

@ -593,6 +593,9 @@
assert(self); assert(self);
return self->pDriv->iNoOfMonitors; return self->pDriv->iNoOfMonitors;
} }
#ifdef NONINTF
extern float nintf(float f);
#endif
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
int SetCounterPreset(pCounter self, float fVal) int SetCounterPreset(pCounter self, float fVal)
{ {

View File

@ -3,23 +3,19 @@
# #
# Mark Koennecke, November 1996 # Mark Koennecke, November 1996
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
.SUFFIXES:
.SUFFIXES: .c .o
OBJ= el734_utility.o asynsrv_utility.o stredit.o \ OBJ= el734_utility.o asynsrv_utility.o stredit.o \
strjoin.o failinet.o geterrno.o el737_utility.o sinqhm.o serialsinq.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 \ itc4util.o dillutil.o table.o el755_utility.o el755_errorlog.o \
makeprint.o StrMatch.o makeprint.o StrMatch.o
#---------- for Redhat linux #---------- for Redhat linux
#CC= gcc CC= gcc
#CFLAGS= -I. -I../ -DLINUX -g -c CFLAGS= -I/usr/local/include -I. -I../ -DLINUX -g -c
## CC= gcc
## CFLAGS= -I. -I../ -DLINUX -g -c
#------------ for DigitalUnix #------------ for DigitalUnix
CC=cc #CC=cc
CFLAGS= -I. -I../ -std1 -g -c #CFLAGS= -I/data/koenneck/include -I. -I../ -std1 -g -c
CC=cc
CFLAGS= -I. -I../ -std1 -g -c
#------------ for DigitalUnix with Fortify #------------ for DigitalUnix with Fortify
## CC=cc ## CC=cc
## CFLAGS= -DFORTIFY -I. -I../ -std1 -g -c ## CFLAGS= -DFORTIFY -I. -I../ -std1 -g -c

View File

@ -2581,7 +2581,13 @@
#include <time.h> #include <time.h>
struct timespec delay = {0, 250000000}; struct timespec delay = {0, 250000000};
struct timespec delay_left; struct timespec delay_left;
#ifdef LINUX
#define hibernate nanosleep(&delay, &delay_left)
#else
#define hibernate nanosleep_d9 (&delay, &delay_left) #define hibernate nanosleep_d9 (&delay, &delay_left)
#endif
#endif #endif
int msr, ss; int msr, ss;
struct EL734info *info_ptr; struct EL734info *info_ptr;

View File

@ -1711,7 +1711,12 @@
#include <time.h> #include <time.h>
struct timespec delay = {0, 250000000}; struct timespec delay = {0, 250000000};
struct timespec delay_left; struct timespec delay_left;
#ifdef LINUX
#define hibernate nanosleep(&delay, &delay_left)
#else
#define hibernate nanosleep_d9 (&delay, &delay_left) #define hibernate nanosleep_d9 (&delay, &delay_left)
#endif
#endif #endif
int my_rs; int my_rs;
struct EL737info *info_ptr; struct EL737info *info_ptr;

View File

@ -34,20 +34,20 @@
#include "nextrics.h" #include "nextrics.h"
#define DET1X 256 /* x -length of detector 1 */ #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 DET1XS 2 /* pixel size in x of detector 1 */
#define DET1YS 2 /* pixel size in y of detector 1 */ #define DET1YS 2 /* pixel size in y of detector 1 */
#define DET1DESC "EMBL PSD" #define DET1DESC "EMBL PSD"
#define DET2X 256 /* x -length of detector 1 */ #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 DET2XS 2 /* pixel size in x of detector 1 */
#define DET2YS 2 /* pixel size in y 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 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 DET3XS 2 /* pixel size in x of detector 1 */
#define DET3YS 2 /* pixel size in y 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 */ #define DETAMAX 256 /* maximum length of pixelsize array */
/* histogram memory names */ /* histogram memory names */
@ -444,7 +444,7 @@ name of hkl object holding crystallographic information
NXDupdate(self->pDict,"dnumber",pBueffel); NXDupdate(self->pDict,"dnumber",pBueffel);
SNXSPutMotor(pServ->pSics,pCon,hfil,self->pDict, SNXSPutMotor(pServ->pSics,pCon,hfil,self->pDict,
"frametilt","DG3"); "frametilt","DG3");
GetHistogram(self->pHistogram2,pCon,0,0,DET3X*DET3Y,lData, GetHistogram(self->pHistogram3,pCon,0,0,DET3X*DET3Y,lData,
DET3X*DET3Y*sizeof(HistInt)); DET3X*DET3Y*sizeof(HistInt));
NXDputalias(hfil,self->pDict,"framecounts",lData); NXDputalias(hfil,self->pDict,"framecounts",lData);
@ -1523,3 +1523,4 @@ name of hkl object holding crystallographic information
return 0; return 0;
} }

View File

@ -8,10 +8,11 @@
#include <math.h> #include <math.h>
float nintf(float f) float nintf(float f)
{ {
double ip, rm; double ip, rm, dVal;
float fRes; float fRes;
rm = modf(f,&ip); dVal = (double)f;
rm = modf(dVal,&ip);
if(rm < .0)rm = -rm; if(rm < .0)rm = -rm;
if(rm > .5) if(rm > .5)
{ {

View File

@ -446,7 +446,9 @@
} }
return SNputdata1att(hfil,dataname, DFNT_FLOAT32,1,&fVal,"Units",units); return SNputdata1att(hfil,dataname, DFNT_FLOAT32,1,&fVal,"Units",units);
} }
#ifdef NONINTF
extern float nintf(float f);
#endif
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
int SNMakeDMC(SConnection *pCon, SicsInterp *pSics) int SNMakeDMC(SConnection *pCon, SicsInterp *pSics)
{ {

View File

@ -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) 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) #------------ 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 -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: .f.o:
f77 -c -u -g $*.f 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 tecs_plot.o: tecs_plot.f90
f90 -c -u -g 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) bin/TecsServer: $(SERV_OBJ)
- rm bin/TecsServer - rm bin/TecsServer
$(CC) $(CFLAGS) -o bin/TecsServer -g $(SERV_OBJ) fortify1.c \ $(CC) $(CFLAGS) -o bin/TecsServer $(SERV_OBJ) fortify1.c \
-lm -L../hardsup -lhlib -lfor -lm -L../hardsup -lhlib
bin/TecsClient: $(TECLI_OBJ) bin/TecsClient: $(TECLI_OBJ)
f77 -o bin/TecsClient -g $(TECLI_OBJ) \ f77 -o bin/TecsClient -g $(TECLI_OBJ) \

View File

@ -31,7 +31,7 @@ typedef size_t sys_adr_len; /* argument of accept and gethostbyadr */
void sys_ctrl_init(void); void sys_ctrl_init(void);
#elif defined __alpha #elif defined __unix
#define F_CHAR(VAR) char *VAR #define F_CHAR(VAR) char *VAR
#define STR_TO_C(DST,SRC) str_ntrim(DST, SRC, sizeof(DST), SRC##_len) #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 */ typedef int sys_adr_len; /* argument of accept and gethostbyadr */
#define sys_ctrl_init(DUMMY) #define sys_ctrl_init() {}
#else #else

View File

@ -13,7 +13,6 @@
logical done logical done
integer i,iostat integer i,iostat
data lunw/0/
if (lunw .ne. 0) then if (lunw .ne. 0) then
call err_msg('file already open for write') call err_msg('file already open for write')
@ -24,7 +23,7 @@
vers=0 vers=0
open(lunw, name=file, status='old', access='direct', shared open(lunw, name=file, status='old', access='direct'
1 , recl=recl, iostat=iostat) 1 , recl=recl, iostat=iostat)
if (iostat .eq. 0) then if (iostat .eq. 0) then
read(lunw, rec=1, iostat=iostat) vers, stim, etim, wrec, rrec, wdir read(lunw, rec=1, iostat=iostat) vers, stim, etim, wrec, rrec, wdir
@ -45,7 +44,7 @@
etim=0 etim=0
wrec=-1 wrec=-1
rrec=0 rrec=0
open(lunw, name=file, status='new', access='direct', shared open(lunw, name=file, status='new', access='direct'
1 , recl=recl, err=93) 1 , recl=recl, err=93)
else else
dlog_open_w=1 ! reopened dlog_open_w=1 ! reopened
@ -78,7 +77,6 @@
include 'tecs_dlog.inc' include 'tecs_dlog.inc'
integer p,r,i,j,btim integer p,r,i,j,btim
data update/.true./
logical done logical done
integer dlog_put_ integer dlog_put_
@ -220,7 +218,6 @@
logical done logical done
integer iostat integer iostat
data lunr/0/
integer sys_gmt_off integer sys_gmt_off
@ -232,8 +229,8 @@
lunr=39 lunr=39
open(lunr, name=file, status='old', access='direct', shared open(lunr, name=file, status='old', access='direct'
1 , recl=recl, err=99, readonly) 1 , recl=recl, err=99)
call dlog_read_block(1, done) call dlog_read_block(1, done)
if (.not. done) then if (.not. done) then
close(lunr) close(lunr)

View File

@ -7,15 +7,16 @@
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
#------------ for DigitalUnix (add -DFORTIFY to CFLAGS for fortified version) #------------ for DigitalUnix (add -DFORTIFY to CFLAGS for fortified version)
CC = cc #CC = cc
CFLAGS = -std -g -warnprotos -I. -I../hardsup #CFLAGS = -std -g -warnprotos -I. -I../hardsup
BIN = ../bin #BIN = ../bin
LFLAGS = -L../hardsup #LFLAGS = -L../hardsup
#------------ for Linux #------------ for Linux
#CC = gcc CC = gcc
#CFLAGS = -g -I. -I../hardsup -DLinux CFLAGS = -g -I. -I../hardsup -DLinux
#BIN = linux.i686 BIN = ../bin
#LFLAGS = -L../hardsup -L/usr/X11R6/lib LFLAGS = -L../hardsup -L/usr/X11R6/lib
#------------ #------------
#---------------------------------------------------------- #----------------------------------------------------------
@ -30,8 +31,9 @@ all: $(BIN)/asynsrv_test \
$(BIN)/SerPortServer: SerPortServer.c $(BIN)/SerPortServer: SerPortServer.c
rm -f $(BIN)/SerPortServer rm -f $(BIN)/SerPortServer
$(CC) $(CFLAGS) -o $(BIN)/SerPortServer \ $(CC) $(CFLAGS) -o $(BIN)/SerPortServer \
SerPortServer.c $(LFLAGS) -lhlib -lX11 SerPortServer.c $(LFLAGS) -lhlib -lX11
$(BIN)/asynsrv_test: asynsrv_test.c $(BIN)/asynsrv_test: asynsrv_test.c
rm -f $(BIN)/asynsrv_test rm -f $(BIN)/asynsrv_test