IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12840


Ignore:
Timestamp:
Apr 17, 2007, 9:59:02 AM (19 years ago)
Author:
eugene
Message:

various fixes to support Mac OS X

Location:
trunk/Ohana
Files:
11 added
4 deleted
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/Configure.in

    r11888 r12840  
    1818CPPFLAGS = @CPPFLAGS@
    1919LDFLAGS  = @LDFLAGS@
     20DLLTYPE  = @DLLTYPE@
    2021
    2122# flags for external dependencies
  • trunk/Ohana/Makefile.Common

    r12160 r12840  
    6262        @echo ""
    6363
     64$(LIB)/%.$(ARCH).dylib:
     65        @if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
     66        rm -f $@
     67        gcc -dynamiclib -o $@ $^ -lc
     68        @echo "compiled shared library $*"
     69        @echo ""
     70
    6471# shared objects have a different compilation on solaris:
    6572# gcc -shared -o $@ $^ -lc
    6673
    6774$(DESTLIB)/%.so: $(LIB)/%.$(ARCH).so
     75        @if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi
     76        rm -f $@
     77        cp $< $@
     78        @echo "installed shared library $*"
     79        @echo ""
     80
     81$(DESTLIB)/%.dylib: $(LIB)/%.$(ARCH).dylib
    6882        @if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi
    6983        rm -f $@
  • trunk/Ohana/Makefile.in

    r11954 r12840  
    4646relphot     \
    4747shell       \
     48tools       \
    4849tcl         \
    4950uniphot
  • trunk/Ohana/configure

    r11968 r12840  
    3939done
    4040
     41echo ./configure.tcsh $args
    4142./configure.tcsh $args
  • trunk/Ohana/configure.tcsh

    r12332 r12840  
    55
    66# we need to be able to list the required libraries for a given distribution
    7 
    8 # libX11.a
    9 # libsocket.a
    10 # libnsl.a
    11 # libpng.a
    12 # libjpeg.a
    13 # libz.a
    14 # libreadline.a
    15 # libtermcap.a
    167
    178# evaluate command-line options
     
    2819set datadir  = ""
    2920set sysconfdir  = ""
     21set exec_prefix = ""
    3022
    3123set root    = ""
     
    6759     set prefix = `echo $1 | tr = ' ' | awk '{print $2}'`
    6860   endif
    69    set exec_prefix = $prefix
     61   breaksw;
     62  case --exec-prefix*
     63   if ("$1" == "--exec-prefix") then
     64     shift
     65     set exec_prefix = $1
     66   else
     67     set exec_prefix = `echo $1 | tr = ' ' | awk '{print $2}'`
     68   endif
    7069   breaksw;
    7170  case --bindir*
     
    8887   if ("$1" == "--includedir") then
    8988     shift
    90      set includedir = $1
    91    else
    92      set includedir = `echo $1 | tr = ' ' | awk '{print $2}'`
     89     set incdir = $1
     90   else
     91     set incdir = `echo $1 | tr = ' ' | awk '{print $2}'`
    9392   endif
    9493   breaksw;
     
    131130if ($#args != 1) goto usage
    132131
     132if ("$exec_prefix" == "") then
     133  set exec_prefix = $prefix
     134endif
     135
     136# replace $exec_prefix in variables
     137#echo "setting libdir ($libdir)"
     138#set libdir = `echo $libdir | sed 's|\$exec_prefix|$exec_prefix|'`
     139
    133140# set values for CC, CFLAGS, CPPFLAGS, LDFLAGS
    134141if (! $?CC) then
     
    152159endif 
    153160
    154 set syslibpath = "/lib /usr/lib /usr/X11R6/lib /usr/openwin/lib /usr/local/lib"
    155 set needlibs   = "png z jpeg readline X11 pthread m"
     161set syslibpath = "/lib /usr/lib /usr/X11R6/lib /usr/local/lib"
     162set needlibs   = ""
     163set needlibs   = "$needlibs png"
     164set needlibs   = "$needlibs z"
     165set needlibs   = "$needlibs jpeg"
     166set needlibs   = "$needlibs readline"
     167set needlibs   = "$needlibs X11"
     168set needlibs   = "$needlibs pthread"
     169set needlibs   = "$needlibs m"
    156170
    157171# /usr/local/include/libpng is really pretty lame...
    158 set sysincpath = "/usr/include /usr/local/include /usr/X11R6/include /usr/openwin/include /usr/local/include/libpng"
     172set sysincpath = "/usr/include /usr/local/include /usr/X11R6/include"
    159173
    160174set needincs = ""
     
    210224set sys=`uname -s`
    211225set ranlib = "ranlib"
     226set dlltype = "so"
    212227switch ($sys)
    213228 case IRIX64:
     
    222237   endif
    223238   # sun (at least) seems to need the socket library (linux does not)
     239   set syslibpath = "$syslibpath /usr/openwin/lib"
     240   set sysincpath = "$sysincpath /usr/openwin/include"
    224241   set needlibs = "$needlibs libsocket libnsl"
    225242   set ranlib = "touch"
     
    234251   endif
    235252   breaksw;
     253 case Darwin:
     254   set arch="darwin";
     255   set mach=`uname -m`
     256   if ("$mach" == "i386") then
     257    set arch="darwin_x86";
     258   endif
     259   set syslibpath = "$syslibpath /sw/lib /usr/local/lib/mysql"
     260   set sysincpath = "$sysincpath /sw/include /usr/include/sys"
     261   set dlltype = dylib
     262   breaksw;
    236263 case HP-UX:
    237264    set arch="hpux";
     
    247274set root = `pwd`
    248275if ($prefix == "") set prefix = $root
    249 if ($vararch) then
    250   set inc = $prefix/include/$arch
    251   set lib = $prefix/lib/$arch
    252 else
    253   set inc = $prefix/include
    254   set lib = $prefix/lib
    255 endif
     276
     277# set the install include directory
     278if ($incdir == "") then
     279  if ($vararch) then
     280    set incdir = $prefix/include/$arch
     281  else
     282    set incdir = $prefix/include
     283  endif
     284endif
     285
     286# set the install lib directory
     287if ($libdir == "") then
     288  if ($vararch) then
     289    set libdir = $prefix/lib/$arch
     290  else
     291    set libdir = $prefix/lib
     292  endif
     293endif
     294
    256295if ($?LD_LIBRARY_PATH) then
    257296  set libpath = `echo $LD_LIBRARY_PATH | tr ':' ' '`
     
    268307set nonomatch
    269308foreach f ( $needlibs )
    270     foreach g ( $syslibpath $lib $libpath )
    271         if (! -e $g) continue
    272         set name = $g/lib$f.a
    273         if (-e $name[1]) goto got_lib;
    274         set name = $g/lib$f.so*
    275         if (-e $name[1]) goto got_lib;
    276     end
    277     echo "missing lib$f"
    278     set faillibs = "$faillibs lib$f"
    279     continue
     309  foreach g ( $syslibpath $libdir $libpath )
     310    set name = $g/lib$f.a
     311    if (-e $name[1]) goto got_lib;
     312    set name = $g/lib$f.$dlltype
     313    if (-e $name[1]) goto got_lib;
     314  end
     315  echo "missing lib$f"
     316  set faillibs = "$faillibs lib$f"
     317  continue
    280318got_lib:
    281     echo "found lib$f ($name[$#name])"
    282     echo "$libdirs" | grep -- "-L$g " > /dev/null
    283     if ($status) then
    284       set libdirs  = "$libdirs-L$g "
    285     endif
    286     echo "$libflags" | grep -- "-l$f " > /dev/null
    287     if ($status) then
    288       set libflags = "$libflags-l$f "
    289     endif
     319  echo "found lib$f ($name[1])"
     320  set gotlibdir = `dirname $name[1]`
     321  echo "$libdirs" | grep -- "-L$gotlibdir " > /dev/null
     322  if ($status) then
     323    set libdirs  = "$libdirs-L$gotlibdir "
     324  endif
     325  echo "$libflags" | grep -- "-l$f " > /dev/null
     326  if ($status) then
     327    set libflags = "$libflags-l$f "
     328  endif
    290329end
    291330
     
    293332# check for termcap, curses, etc
    294333foreach f ( ncurses curses termcap )
    295     foreach g ( $syslibpath $lib $libpath )
    296         set name = $g/lib$f.a
    297         if (-e $name[1]) goto got_curses;
    298         set name = $g/lib$f.so*
    299         if (-e $name[1]) goto got_curses;
     334    foreach g ( $syslibpath $libdir $libpath )
     335        set name = $g/lib$f.a
     336        if (-e $name[1]) goto got_curses;
     337        set name = $g/lib$f.$dlltype
     338        if (-e $name[1]) goto got_curses;
    300339    end
    301340end
     
    324363endif   
    325364
    326 # check for headers
     365# add the CPATH
     366if ($?CPATH) then
     367  set incpath = `echo $CPATH | tr ':' ' '`
     368else
     369  set incpath = ""
     370endif
     371
     372# check for headers (including in subdirectories)
    327373echo ""
    328374echo "searching for needed external header files..."
     
    330376set incdirs = ""
    331377foreach f ( $needincs )
    332   foreach g ( $sysincpath $inc )
     378  foreach g ( $incdir $incpath $sysincpath )
    333379    set name = "$g/$f"
    334380    if (-e $name) goto got_inc;
     
    338384  continue
    339385got_inc:
    340   echo "found $f ($name)"
     386  echo "found $f ($name[1])"
    341387  echo "$incdirs" | grep -- "-I$g " > /dev/null
    342388  if ($status) then
     
    453499./config.tools fixconf @CPPFLAGS@ "$CPPFLAGS"
    454500./config.tools fixconf @LDFLAGS@ "$LDFLAGS"
     501./config.tools fixconf @DLLTYPE@  "$dlltype"
    455502
    456503# other architecture dependent options
  • trunk/Ohana/src/addstar/include/addstar.h

    r12749 r12840  
    8282int     ACCEPT_ASTROM;  // accept even bad astrometry solutions (NASTRO == 0)
    8383int     ACCEPT_MOTION;  // accept reference proper motion measurements
     84int     ACCEPT_TIME;    // accept time stamp (or 0)
     85int     NO_STARS;       // ignore the stars
    8486int     TEXTMODE;       // force input file to be loaded as RAW
    8587int     SUBPIX;         // apply a subpix correction
  • trunk/Ohana/src/addstar/src/ReadImageHeader.c

    r12732 r12840  
    2424  image[0].NY = Ny;
    2525
    26   if (!gfits_scan (header, "TZERO",   "%d",  1, &image[0].tzero)) {
     26  if (!gfits_scan (header, "TZERO",   "%d",  1, &image[0].tzero) && !ACCEPT_TIME) {
    2727    image[0].tzero = parse_time (header);
    2828  }
     
    155155
    156156  /* find expected number of stars */
    157   if (!gfits_scan (header, "NSTARS", "%d", 1, &image[0].nstar)) {
     157  if (!gfits_scan (header, "NSTARS", "%d", 1, &image[0].nstar) && !NO_STARS) {
    158158    fprintf (stderr, "can't get NSTARS from header\n");
    159159    return (FALSE);
  • trunk/Ohana/src/addstar/src/SetSignals.c

    r3376 r12840  
    3030  for (i = 0; i < 36; i++) {
    3131    switch (i) {
    32       /* can't redirect this signals */
    33     case SIGKILL:    /* kill -9: cannot be caught or ignored */
    34     case SIGSTOP:    /* SIGSTOP: cannot be caught or ignored */
     32      /* can't redirect these signals */
     33    case SIGKILL:    /* kill -9: cannot be caught or ignored (POSIX.1-1990) */
     34    case SIGSTOP:    /* SIGSTOP: cannot be caught or ignored (POSIX.1-1990) */
    3535      /* ignore these signals */
    36     case SIGCHLD:    /* child halted: ignore */
    37     case SIGPWR:     /* power failure - why ignore this? */
    38     case SIGWINCH:   /* window resized */
    39     case SIGCONT:    /* continue - maintain this action */
    40     case SIGTSTP:    /* stop signal sent from tty - why ignore? */
    41     case SIGURG:     /* socket signal, ignore this */
     36    case SIGCHLD:    /* child halted: ignore (POSIX.1-1990) */
     37    case SIGCONT:    /* continue - maintain this action (POSIX.1-1990) */
     38    case SIGTSTP:    /* stop signal sent from tty - why ignore? (POSIX.1-1990) */
     39    case SIGURG:     /* socket signal, ignore this (POSIX.1-2001) */
     40# ifdef (SIGPWR)
     41    case SIGPWR:     /* power failure - why ignore this? (Sys V) */
     42# endif
     43# ifdef (SIGWINCH)
     44    case SIGWINCH:   /* window resized (4.3BSD) */
     45# endif
    4246      break;
    4347     
  • trunk/Ohana/src/addstar/src/args.c

    r10937 r12840  
    242242  if ((N = get_argument (argc, argv, "-accept-motion"))) {
    243243    ACCEPT_MOTION = TRUE;
     244    remove_argument (N, &argc, argv);
     245  }
     246  /* accept bad header astrometry */
     247  ACCEPT_TIME = FALSE;
     248  if ((N = get_argument (argc, argv, "-accept-time"))) {
     249    ACCEPT_TIME = TRUE;
     250    remove_argument (N, &argc, argv);
     251  }
     252  /* skip the stars */
     253  NO_STARS = FALSE;
     254  if ((N = get_argument (argc, argv, "-no-stars"))) {
     255    NO_STARS = TRUE;
    244256    remove_argument (N, &argc, argv);
    245257  }
  • trunk/Ohana/src/delstar/src/SetSignals.c

    r4607 r12840  
    3030  for (i = 0; i < 36; i++) {
    3131    switch (i) {
    32       /* can't redirect this signals */
    33     case SIGKILL:    /* kill -9: cannot be caught or ignored */
    34     case SIGSTOP:    /* SIGSTOP: cannot be caught or ignored */
     32      /* can't redirect these signals */
     33    case SIGKILL:    /* kill -9: cannot be caught or ignored (POSIX.1-1990) */
     34    case SIGSTOP:    /* SIGSTOP: cannot be caught or ignored (POSIX.1-1990) */
    3535      /* ignore these signals */
    36     case SIGCHLD:    /* child halted: ignore */
    37     case SIGPWR:     /* power failure - why ignore this? */
    38     case SIGWINCH:   /* window resized */
    39     case SIGCONT:    /* continue - maintain this action */
    40     case SIGTSTP:    /* stop signal sent from tty - why ignore? */
    41     case SIGURG:     /* socket signal, ignore this */
     36    case SIGCHLD:    /* child halted: ignore (POSIX.1-1990) */
     37    case SIGCONT:    /* continue - maintain this action (POSIX.1-1990) */
     38    case SIGTSTP:    /* stop signal sent from tty - why ignore? (POSIX.1-1990) */
     39    case SIGURG:     /* socket signal, ignore this (POSIX.1-2001) */
     40# ifdef (SIGPWR)
     41    case SIGPWR:     /* power failure - why ignore this? (Sys V) */
     42# endif
     43# ifdef (SIGWINCH)
     44    case SIGWINCH:   /* window resized (4.3BSD) */
     45# endif
    4246      break;
    4347     
  • trunk/Ohana/src/getstar/Makefile

    r12774 r12840  
    2222dvoImageOverlaps: $(BIN)/dvoImageOverlaps.$(ARCH)
    2323dvoImageOverlaps.install: $(DESTBIN)/dvoImageOverlaps
     24
     25dvoImageExtract: $(BIN)/dvoImageExtract.$(ARCH)
     26dvoImageExtract.install: $(DESTBIN)/dvoImageExtract
    2427
    2528install: getstar.install dvoImageOverlaps.install
     
    5255$(OVERLAPS): $(INC)/dvoImageOverlaps.h
    5356$(BIN)/dvoImageOverlaps.$(ARCH): $(OVERLAPS)
     57
     58EXTRACT = \
     59$(SRC)/dvoImageExtract.$(ARCH).o         \
     60$(SRC)/ConfigInit_extract.$(ARCH).o      \
     61$(SRC)/args_extract.$(ARCH).o            \
     62$(SRC)/Shutdown.$(ARCH).o                \
     63$(SRC)/SetSignals.$(ARCH).o              \
     64$(SRC)/WriteImages.$(ARCH).o             \
     65$(SRC)/WriteImageFITS.$(ARCH).o          \
     66$(SRC)/SelectImages.$(ARCH).o       
     67
     68$(EXTRACT): $(INC)/dvoImageExtract.h
     69$(BIN)/dvoImageExtract.$(ARCH): $(EXTRACT)
  • trunk/Ohana/src/getstar/src/SetSignals.c

    r6968 r12840  
    3030  for (i = 0; i < 36; i++) {
    3131    switch (i) {
    32       /* can't redirect this signals */
    33     case SIGKILL:    /* kill -9: cannot be caught or ignored */
    34     case SIGSTOP:    /* SIGSTOP: cannot be caught or ignored */
     32      /* can't redirect these signals */
     33    case SIGKILL:    /* kill -9: cannot be caught or ignored (POSIX.1-1990) */
     34    case SIGSTOP:    /* SIGSTOP: cannot be caught or ignored (POSIX.1-1990) */
    3535      /* ignore these signals */
    36     case SIGCHLD:    /* child halted: ignore */
    37     case SIGPWR:     /* power failure - why ignore this? */
    38     case SIGWINCH:   /* window resized */
    39     case SIGCONT:    /* continue - maintain this action */
    40     case SIGTSTP:    /* stop signal sent from tty - why ignore? */
    41     case SIGURG:     /* socket signal, ignore this */
     36    case SIGCHLD:    /* child halted: ignore (POSIX.1-1990) */
     37    case SIGCONT:    /* continue - maintain this action (POSIX.1-1990) */
     38    case SIGTSTP:    /* stop signal sent from tty - why ignore? (POSIX.1-1990) */
     39    case SIGURG:     /* socket signal, ignore this (POSIX.1-2001) */
     40# ifdef (SIGPWR)
     41    case SIGPWR:     /* power failure - why ignore this? (Sys V) */
     42# endif
     43# ifdef (SIGWINCH)
     44    case SIGWINCH:   /* window resized (4.3BSD) */
     45# endif
    4246      break;
    4347     
  • trunk/Ohana/src/libdvo/include/dvo.h

    r12332 r12840  
    241241char *libdvo_version ();
    242242
     243int GetRegisteredMosaic ();
    243244int FindMosaicForImage (Image *images, int Nimages, int entry);
    244245int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry);
  • trunk/Ohana/src/libdvo/src/mosaic_astrom.c

    r5241 r12840  
    33/* chip-match table: j = ChipMatch[i], images[j] is DIS for images[i] WRP */
    44
     5static int    iDIS = -1;      // DIS entry in ChipMatch[]
    56static int    Ndis = 0;
    67static int    *DISentry = NULL;
    78static e_time *DIStzero = NULL;
    89static int    *ChipMatch = NULL;
     10
     11/* what is the currently registered mosaic image? */
     12int GetRegisteredMosaic () {
     13  return (iDIS);
     14}
    915
    1016/* given an image array and a current entry of type WRP, find matching DIS & Register it */
     
    4248    /* found a valid match */
    4349    RegisterMosaic (&images[i].coords);
     50    iDIS = i;
     51    return (TRUE);
    4452  }
    4553
     
    5058    /* found a valid match */
    5159    RegisterMosaic (&images[i].coords);
     60    iDIS = i;
    5261    return (TRUE);
    5362  }
     
    7281
    7382  RegisterMosaic (&images[N].coords);
     83  iDIS = N;
    7484  return (TRUE);
    7585}
  • trunk/Ohana/src/libohana/Makefile

    r11880 r12840  
    1919TFLAGS        = $(FULL_CFLAGS) $(FULL_LDFLAGS) -ltap_ohana
    2020
    21 install: $(DESTLIB)/libohana.a $(DESTLIB)/libohana.so
    22 libohana: $(LIB)/libohana.$(ARCH).a $(LIB)/libohana.$(ARCH).so
     21install: $(DESTLIB)/libohana.a $(DESTLIB)/libohana.$(DLLTYPE)
     22libohana: $(LIB)/libohana.$(ARCH).a $(LIB)/libohana.$(ARCH).$(DLLTYPE)
    2323testcode: install $(TEST)
    2424test:
     
    5050
    5151$(LIB)/libohana.$(ARCH).a: $(OBJS)
    52 $(LIB)/libohana.$(ARCH).so: $(OBJS)
     52$(LIB)/libohana.$(ARCH).$(DLLTYPE): $(OBJS)
    5353
    5454$(DESTLIB)/libohana.a:  $(LIB)/libohana.$(ARCH).a
    55 $(DESTLIB)/libohana.so: $(LIB)/libohana.$(ARCH).so
     55$(DESTLIB)/libohana.$(DLLTYPE): $(LIB)/libohana.$(ARCH).$(DLLTYPE)
    5656
    5757$(TESTDIR)/%.$(ARCH) : $(TESTDIR)/%.c
  • trunk/Ohana/src/opihi/cmd.astro/Makefile

    r11891 r12840  
    5050$(SRC)/imfit-fgauss.$(ARCH).o      \
    5151$(SRC)/imfit-pgauss.$(ARCH).o      \
    52 $(SRC)/imfit-Pgauss.$(ARCH).o      \
     52$(SRC)/imfit-pgauss-psf.$(ARCH).o          \
    5353$(SRC)/imfit-qgauss.$(ARCH).o      \
    54 $(SRC)/imfit-Qgauss.$(ARCH).o      \
     54$(SRC)/imfit-qgauss-psf.$(ARCH).o          \
    5555$(SRC)/imfit-sgauss.$(ARCH).o      \
    56 $(SRC)/imfit-Sgauss.$(ARCH).o      \
     56$(SRC)/imfit-sgauss-psf.$(ARCH).o          \
    5757$(SRC)/imfit-qfgauss.$(ARCH).o     \
    5858$(SRC)/imfit-qrgauss.$(ARCH).o     
  • trunk/Ohana/src/opihi/cmd.astro/imfit-test.c

    r3144 r12840  
    3131      par[3] = tp1;
    3232    }
    33     if (fitfunc == SgaussTD) {
     33    if (fitfunc == sgauss_psfTD) {
    3434      tp1 = par[0];
    3535      tp2 = par[3];
     
    4848      par[4] = tp2;
    4949    }
    50     if (fitfunc == PgaussTD) {
     50    if (fitfunc == pgauss_psfTD) {
    5151      tp1 = par[0];
    5252      par[0] = par[0]*1.05;
  • trunk/Ohana/src/opihi/cmd.astro/imfit.c

    r9275 r12840  
    5757    fgauss_setup (argv[N]);
    5858    pgauss_setup (argv[N]);
    59     Pgauss_setup (argv[N]);
     59    pgauss_psf_setup (argv[N]);
    6060    sgauss_setup (argv[N]);
    61     Sgauss_setup (argv[N]);
     61    sgauss_psf_setup (argv[N]);
    6262    qgauss_setup (argv[N]);
    63     Qgauss_setup (argv[N]);
     63    qgauss_psf_setup (argv[N]);
    6464    qfgauss_setup (argv[N]);
    6565    qrgauss_setup (argv[N]);
  • trunk/Ohana/src/opihi/cmd.astro/imsub.c

    r7917 r12840  
    2222    fgauss_setup (argv[N]);
    2323    pgauss_setup (argv[N]);
    24     Pgauss_setup (argv[N]);
     24    pgauss_psf_setup (argv[N]);
    2525    sgauss_setup (argv[N]);
    26     Sgauss_setup (argv[N]);
     26    sgauss_psf_setup (argv[N]);
    2727    qgauss_setup (argv[N]);
    28     Qgauss_setup (argv[N]);
     28    qgauss_psf_setup (argv[N]);
    2929    qfgauss_setup (argv[N]);
    3030    qrgauss_setup (argv[N]);
  • trunk/Ohana/src/opihi/dvo/Makefile

    r11891 r12840  
    2323$(SRC)/ImageSelection.$(ARCH).o \
    2424$(SRC)/LoadImages.$(ARCH).o             \
    25 $(SRC)/cmpRead.$(ARCH).o                \
     25$(SRC)/cmpReadFile.$(ARCH).o            \
    2626$(SRC)/compare.$(ARCH).o               \
    2727$(SRC)/match_image.$(ARCH).o            \
  • trunk/Ohana/src/opihi/include/pantasks.h

    r12404 r12840  
    138138  Task   *task;
    139139
    140   IOBuffer    stdout;                   /* stdout storage buffer */
    141   IOBuffer    stderr;                   /* stderr storage buffer */
     140  /* this cries out for another structure... */
     141  IOBuffer    stdout_buff;    /* stdout storage buffer */
     142  char       *stdout_dump;    // output target file for stdout
     143  int         stdout_size;    /* size of pending stdout buffer (controller) */
     144  int         stdout_fd;      /* stdout pipe (local only) */
     145
     146  IOBuffer    stderr_buff;    /* stderr storage buffer */
     147  char       *stderr_dump;    // output target file for stderr
     148  int         stderr_size;    /* size of pending stderr buffer (controller) */
     149  int         stderr_fd;      /* stderr pipe (local only) */
     150
    142151  JobMode     mode;                     /* local or controller? */
    143 
    144   char   *stdout_dump;
    145   char   *stderr_dump;
    146152  char   *realhost;
    147 
    148   int         stdout_size;              /* size of pending stdout buffer (controller) */
    149   int         stderr_size;              /* size of pending stderr buffer (controller) */
    150   int         stdout_fd;                /* stdout pipe (local only) */
    151   int         stderr_fd;                /* stderr pipe (local only) */
    152153
    153154  double dtime;
  • trunk/Ohana/src/opihi/include/pcontrol.h

    r12332 r12840  
    7575  JobStat      state;
    7676  JobStat      stack;
    77   IOBuffer     stdout;
    78   IOBuffer     stderr;
     77  IOBuffer     stdout_buff;
     78  IOBuffer     stderr_buff;
    7979  Ptime        start;
    8080  Ptime        stop;
     
    8888typedef struct {
    8989  char       *hostname;
    90   int         stdin;
    91   int         stdout;
    92   int         stderr;
     90  int         stdin_fd;
     91  int         stdout_fd;
     92  int         stderr_fd;
    9393  int         markoff;
    9494  int         pid;
  • trunk/Ohana/src/opihi/pantasks/CheckJobs.c

    r12404 r12840  
    4848        /* push output buffer data to the stdout and stderr queues */
    4949        /* XXX this will break on 0 values in output streams */
    50         PushNamedQueue ("stdout", job[0].stdout.buffer);
    51         PushNamedQueue ("stderr", job[0].stderr.buffer);
     50        PushNamedQueue ("stdout", job[0].stdout_buff.buffer);
     51        PushNamedQueue ("stderr", job[0].stderr_buff.buffer);
    5252
    5353        /* save the stdout and stderr if desired */
     
    5757            gprint (GP_ERR, "unable to open stdout dump file %s\n", job[0].stdout_dump);
    5858          } else {
    59             fwrite (job[0].stdout.buffer, 1, job[0].stdout.Nbuffer, f);
     59            fwrite (job[0].stdout_buff.buffer, 1, job[0].stdout_buff.Nbuffer, f);
    6060            fclose (f);
    6161          }
     
    6666            gprint (GP_ERR, "unable to open stderr dump file %s\n", job[0].stderr_dump);
    6767          } else {
    68             fwrite (job[0].stderr.buffer, 1, job[0].stderr.Nbuffer, f);
     68            fwrite (job[0].stderr_buff.buffer, 1, job[0].stderr_buff.Nbuffer, f);
    6969            fclose (f);
    7070          }
  • trunk/Ohana/src/opihi/pantasks/ControllerOps.c

    r11898 r12840  
    2929  if ((job[0].state == JOB_EXIT) || (job[0].state == JOB_CRASH)) {
    3030    gettimeofday (&start, (void *) NULL);
    31     GetJobOutput ("stdout", job[0].pid, &job[0].stdout, job[0].stdout_size);
     31    GetJobOutput ("stdout", job[0].pid, &job[0].stdout_buff, job[0].stdout_size);
    3232    gettimeofday (&stop, (void *) NULL);
    3333    dtime = DTIME (stop, start);
     
    3535
    3636    gettimeofday (&start, (void *) NULL);
    37     GetJobOutput ("stderr", job[0].pid, &job[0].stderr, job[0].stderr_size);
     37    GetJobOutput ("stderr", job[0].pid, &job[0].stderr_buff, job[0].stderr_size);
    3838    gettimeofday (&stop, (void *) NULL);
    3939    dtime = DTIME (stop, start);
  • trunk/Ohana/src/opihi/pantasks/JobOps.c

    r12466 r12840  
    143143     need to have matched entries to these quantites in the job structure */
    144144
    145   InitIOBuffer (&job[0].stdout, 0x100);
    146   InitIOBuffer (&job[0].stderr, 0x100);
     145  InitIOBuffer (&job[0].stdout_buff, 0x100);
     146  InitIOBuffer (&job[0].stderr_buff, 0x100);
    147147
    148148  job[0].stdout_dump = NULL;
     
    181181  if (job[0].stderr_dump != NULL) free (job[0].stderr_dump);
    182182
    183   FreeIOBuffer (&job[0].stdout);
    184   FreeIOBuffer (&job[0].stderr);
     183  FreeIOBuffer (&job[0].stdout_buff);
     184  FreeIOBuffer (&job[0].stderr_buff);
    185185  free (job);
    186186  return;
  • trunk/Ohana/src/opihi/pantasks/LocalJob.c

    r11898 r12840  
    1515
    1616  if ((job[0].state == JOB_EXIT) || (job[0].state == JOB_CRASH)) {
    17     EmptyIOBuffer (&job[0].stdout, 10, job[0].stdout_fd);
    18     EmptyIOBuffer (&job[0].stderr, 10, job[0].stderr_fd);
     17    EmptyIOBuffer (&job[0].stdout_buff, 10, job[0].stdout_fd);
     18    EmptyIOBuffer (&job[0].stderr_buff, 10, job[0].stderr_fd);
    1919    close (job[0].stdout_fd);
    2020    close (job[0].stderr_fd);
    2121  } else {
    2222    /* read stdout buffer */
    23     Nread = ReadtoIOBuffer (&job[0].stdout, job[0].stdout_fd);
     23    Nread = ReadtoIOBuffer (&job[0].stdout_buff, job[0].stdout_fd);
    2424    switch (Nread) {
    2525      case -2:  /* error in read (programming error?  system level error?) */
     
    3434 
    3535    /* read stderr buffer */
    36     Nread = ReadtoIOBuffer (&job[0].stderr, job[0].stderr_fd);
     36    Nread = ReadtoIOBuffer (&job[0].stderr_buff, job[0].stderr_fd);
    3737    switch (Nread) {
    3838      case -2:  /* error in read (programming error?  system level error?) */
  • trunk/Ohana/src/opihi/pclient/ChildOps.c

    r10639 r12840  
    33#include <sys/types.h>
    44#include <unistd.h>
    5 #include <stropts.h>
     5// #include <stropts.h>
    66
    77static int Nbad = 0;
  • trunk/Ohana/src/opihi/pcontrol/CheckDoneJob.c

    r10652 r12840  
    1212
    1313  success = TRUE;
    14   success &= GetJobOutput ("stdout", host, &job[0].stdout, job[0].stdout_size);
    15   success &= GetJobOutput ("stderr", host, &job[0].stderr, job[0].stderr_size);
     14  success &= GetJobOutput ("stdout", host, &job[0].stdout_buff, job[0].stdout_size);
     15  success &= GetJobOutput ("stderr", host, &job[0].stderr_buff, job[0].stderr_size);
    1616
    1717  if (!success) {
  • trunk/Ohana/src/opihi/pcontrol/GetJobOutput.c

    r10652 r12840  
    1414
    1515  /* flush any earlier messages */
    16   ReadtoIOBuffer (buffer, host[0].stdout);
     16  ReadtoIOBuffer (buffer, host[0].stdout_fd);
    1717  FlushIOBuffer (buffer);
    1818  Nstart = buffer[0].Nbuffer;
     
    2323
    2424  /* send cmd (stdout / stderr) */
    25   status = write_fmt (host[0].stdin, "%s\n", cmd);
     25  status = write_fmt (host[0].stdin_fd, "%s\n", cmd);
    2626
    2727  /* is pipe still open? */
     
    3232  status = -1;
    3333  for (i = 0; (i < PCLIENT_TIMEOUT) && (status != 0) && (line == NULL); i++) {
    34     status = ReadtoIOBuffer (buffer, host[0].stdout);
     34    status = ReadtoIOBuffer (buffer, host[0].stdout_fd);
    3535    if ((buffer[0].Nbuffer - Nstart) >= Nbytes) {
    3636      line = memstr (buffer[0].buffer, PCLIENT_PROMPT, buffer[0].Nbuffer);
  • trunk/Ohana/src/opihi/pcontrol/HostOps.c

    r10652 r12840  
    151151  ALLOCATE (host, Host, 1);
    152152
    153   host[0].hostname = strcreate (hostname);
    154   host[0].stdin    = 0;
    155   host[0].stdout  = 0;
    156   host[0].stderr  = 0;
    157   host[0].HostID   = NextHostID();
     153  host[0].hostname  = strcreate (hostname);
     154  host[0].stdin_fd  = 0;
     155  host[0].stdout_fd = 0;
     156  host[0].stderr_fd = 0;
     157  host[0].HostID    = NextHostID();
    158158
    159159  host[0].lasttry.tv_sec = 0;
  • trunk/Ohana/src/opihi/pcontrol/JobOps.c

    r11388 r12840  
    148148
    149149  /* do this step on start? */
    150   InitIOBuffer (&job[0].stdout, 0x1000);
    151   InitIOBuffer (&job[0].stderr, 0x1000);
     150  InitIOBuffer (&job[0].stdout_buff, 0x1000);
     151  InitIOBuffer (&job[0].stderr_buff, 0x1000);
    152152
    153153  JobID = job[0].JobID;
     
    167167  FREE (job[0].argv);
    168168
    169   FreeIOBuffer (&job[0].stdout);
    170   FreeIOBuffer (&job[0].stderr);
     169  FreeIOBuffer (&job[0].stdout_buff);
     170  FreeIOBuffer (&job[0].stderr_buff);
    171171
    172172  FREE (job);
  • trunk/Ohana/src/opihi/pcontrol/PclientCommand.c

    r10668 r12840  
    1919
    2020  // flush the stdout and stderr buffers here
    21   ReadtoIOBuffer (buffer, host[0].stdout);
     21  ReadtoIOBuffer (buffer, host[0].stdout_fd);
    2222  FlushIOBuffer (buffer);
    23   ReadtoIOBuffer (buffer, host[0].stderr);
     23  ReadtoIOBuffer (buffer, host[0].stderr_fd);
    2424  FlushIOBuffer (buffer);
    2525
    2626  /* send command to client (adding on \n) */
    27   status = write_fmt (host[0].stdin, "%s\n", command);
     27  status = write_fmt (host[0].stdin_fd, "%s\n", command);
    2828
    2929  /* is pipe still open? */
     
    3737  status = -1;
    3838  for (i = 0; (i < PCLIENT_TIMEOUT) && (status != 0) && (line == NULL); i++) {
    39     status = ReadtoIOBuffer (buffer, host[0].stdout);
     39    status = ReadtoIOBuffer (buffer, host[0].stdout_fd);
    4040    line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer);
    4141    if (status == -1) nanosleep (&request, &remain);
  • trunk/Ohana/src/opihi/pcontrol/StartHost.c

    r8546 r12840  
    3939  host[0].lasttry.tv_usec = 0;
    4040
    41   host[0].stdin  = stdio[0];
    42   host[0].stdout = stdio[1];
    43   host[0].stderr = stdio[2];
    44   host[0].pid    = pid;
     41  host[0].stdin_fd  = stdio[0];
     42  host[0].stdout_fd = stdio[1];
     43  host[0].stderr_fd = stdio[2];
     44  host[0].pid       = pid;
    4545  PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM);
    4646  return (TRUE);
  • trunk/Ohana/src/opihi/pcontrol/StopHosts.c

    r10666 r12840  
    22
    33void DownHost (Host *host) {
    4   CLOSE (host[0].stdin);
    5   CLOSE (host[0].stdout);
    6   CLOSE (host[0].stderr);
     4  CLOSE (host[0].stdin_fd);
     5  CLOSE (host[0].stdout_fd);
     6  CLOSE (host[0].stderr_fd);
    77  host[0].job = NULL;
    88  PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
     
    1010
    1111void OffHost (Host *host) {
    12   CLOSE (host[0].stdin);
    13   CLOSE (host[0].stdout);
    14   CLOSE (host[0].stderr);
     12  CLOSE (host[0].stdin_fd);
     13  CLOSE (host[0].stdout_fd);
     14  CLOSE (host[0].stderr_fd);
    1515  host[0].job = NULL;
    1616  PutHost (host, PCONTROL_HOST_OFF, STACK_BOTTOM);
  • trunk/Ohana/src/opihi/pcontrol/stdout.c

    r8296 r12840  
    2929
    3030found_stdout:
    31   buffer = &job[0].stdout;
     31  buffer = &job[0].stdout_buff;
    3232  fwrite (buffer[0].buffer, 1, buffer[0].Nbuffer, stdout);
    3333  gprint (GP_LOG, "STATUS %d\n", 0);
     
    6464
    6565found_stderr:
    66   buffer = &job[0].stderr;
     66  buffer = &job[0].stderr_buff;
    6767  fwrite (buffer[0].buffer, 1, buffer[0].Nbuffer, stdout);
    6868  gprint (GP_LOG, "STATUS %d\n", 0);
Note: See TracChangeset for help on using the changeset viewer.