Changeset 1692 in Sophya for trunk


Ignore:
Timestamp:
Oct 14, 2001, 11:15:01 PM (24 years ago)
Author:
aubourg
Message:

thread debugging

Location:
trunk/ArchTOIPipe
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/Makefile.in

    r1689 r1692  
    100100
    101101%.d: $(srcdir)/%.cc
    102         $(SHELL) -ec 'gcc -MM $(CPPFLAGS) -I.  $< \
     102        $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I.  $< \
    103103                | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
    104104                [ -s $@ ] || rm -f $@'
    105105
    106106%.d: $(srcdir)/%.c
    107         $(SHELL) -ec 'gcc -MM $(CPPFLAGS) -I. $< \
     107        $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
    108108                | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
    109109                [ -s $@ ] || rm -f $@'
  • trunk/ArchTOIPipe/Kernel/asciitoiwtr.cc

    r1532 r1692  
    1919  declareInput(name);
    2020  fwinputs.push_back(toi);
     21  toi->addConsumer(this);
    2122}
    2223
  • trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc

    r1629 r1692  
    3333  nCols++;
    3434  if (withFlag) nCols++;
     35  toi->addConsumer(this);
    3536}
    3637
     
    129130        }
    130131      }
     132      wontNeedBefore(sn);
    131133      fits_lock();
    132134      //      if ((sn%2000 == 0) || (sn<snb+5))
  • trunk/ArchTOIPipe/Kernel/toi.h

    r1689 r1692  
    9898
    9999  virtual void          setProducer(TOIProcessor* prod);
     100public: // for toiprocessors redefining addInput. Change ?
    100101  virtual void          addConsumer(TOIProcessor* prod);
     102protected:
    101103  friend class          TOIProcessor;
    102104     
  • trunk/ArchTOIPipe/Kernel/toisegment.cc

    r1690 r1692  
    55#endif
    66
     7static pthread_mutex_t cout_mutex = PTHREAD_MUTEX_INITIALIZER;
     8static void cout_lock() {pthread_mutex_lock(&cout_mutex);}
     9static void cout_unlock() {pthread_mutex_unlock(&cout_mutex);}
     10#define LOG(_xxx_) \
     11cout_lock(); \
     12_xxx_; \
     13cout_unlock();
     14
     15
    716/******************************/
    817/******* TOISegmented *********/
     
    2130TOISegmented::~TOISegmented() {
    2231  delete master;
     32}
     33
     34
     35void TOISegmented::addConsumer(TOIProcessor* p) {
     36  TOI::addConsumer(p);
     37  master->nConsumers = consumers.size();
    2338}
    2439
     
    8297}
    8398
    84 void TOISegmented::doPutData(int i, double value, uint_8 flag=0) {
     99void TOISegmented::doPutData(int i, double value, uint_8 flag) {
    85100  cout << "TOISegmented::doPutData unimplemented" << endl;
    86101  throw PError("TOISegmented::doPutData unimplemented");
     
    164179  segmentSize = m->segmentSize;
    165180  firstNeeded = -1;
    166   pthread_mutex_init(&mutex, NULL);
    167   pthread_cond_init(&condv, NULL);
     181  waiting = false;
    168182}
    169183
    170184TOISegmented::BufferView::~BufferView() {
    171   pthread_mutex_destroy(&mutex);
    172   pthread_cond_destroy(&condv);
    173 }
    174 
    175 double TOISegmented::BufferView::getData(int sn) { /* Single-thread */
     185}
     186
     187double TOISegmented::BufferView::getData(int sn) { /* Single-thread, reader thread*/
    176188  ensure(sn);
    177189  int seg = (sn-sn0)/segmentSize;
     
    179191}
    180192
    181 uint_8 TOISegmented::BufferView::getFlag(int sn) { /* Single-thread */
     193uint_8 TOISegmented::BufferView::getFlag(int sn) { /* Single-thread, reader thread */
    182194  ensure(sn);
    183195  int seg = (sn-sn0)/segmentSize;
     
    185197}
    186198
    187 void  TOISegmented::BufferView::ensure(int sn) { /* Single-thread */
     199void  TOISegmented::BufferView::ensure(int sn) { /* Single-thread, reader thread */
    188200  if (sn < sn0) {
    189     throw RangeCheckError("requested sample before first");
    190   }
    191 
    192   if (sn >= sn0 + segmentSize*segments.size()) {
    193     cout << "BufferView : read fault for " << sn << endl;
     201    LOG(cout << "TOISegmented::BufferView::ensure requested sample before first" << endl);
     202    LOG(cout << "sn " << sn << " sn0 " << sn0 << endl);
     203    abort();
     204  }
     205
     206  if (sn0 < 0 ||
     207      sn >= sn0 + segmentSize*segments.size()) {
     208    LOG(cout << "BufferView " << hex << this << dec << ": read fault for " << sn << endl)
    194209    sync();
    195     while (sn >= sn0 + segmentSize*segments.size()) {
     210    while (sn0<0 || sn >= sn0 + segmentSize*segments.size()) {
    196211      wait();
    197       cout << "BufferView : waiting for " << sn << endl;
     212      LOG(cout << "BufferView " << hex << this << dec << ": waiting for " << sn << endl)
    198213      sync();
    199214    }
    200     cout << "BufferView : resuming for " << sn << endl;   
    201   }
    202 }
    203 
    204 void TOISegmented::BufferView::sync() { /* Single-thread */
     215    LOG(cout << "BufferView " << hex << this << dec << ": resuming for " << sn
     216        << " now data for " << sn0 << " - " << sn0 + segmentSize*segments.size()
     217        << " in " << segments.size() << " segments " << endl)
     218  }
     219}
     220
     221void TOISegmented::BufferView::sync() { /* Single-thread, reader thread */
    205222  master->updateView(this); // update me !
    206223}
    207224
    208 void TOISegmented::BufferView::wait() { /* From reader thread */
    209   pthread_mutex_lock(&mutex);
    210   master->addToWaitList(this); // needing wake-up call
    211   pthread_cond_wait(&condv, &mutex);
    212   pthread_mutex_unlock(&mutex);
    213 }
    214 
    215 void TOISegmented::BufferView::signal() { /* From masterview, writer thread */
    216   pthread_mutex_lock(&mutex);
    217   pthread_cond_signal(&condv); // only one thread can be sleeping
    218   master->removeFromWaitList(this);
    219   pthread_mutex_unlock(&mutex); 
    220 }
     225void TOISegmented::BufferView::wait() { /* reader thread */
     226  pthread_mutex_lock(&(master->read_wait_mutex));
     227  waiting = true;
     228  pthread_cond_wait(&(master->read_wait_condv), &(master->read_wait_mutex));
     229  waiting = false;
     230  pthread_mutex_unlock(&(master->read_wait_mutex));
     231}
     232
    221233
    222234void TOISegmented::BufferView::wontNeedBefore(int sn) { /* reader thread */
     
    236248  segmentSize    = bufsz;
    237249  sn0            = -1;
     250  nConsumers = 0;
    238251 
    239252  pthread_mutex_init(&views_mutex, NULL);
    240   pthread_mutex_init(&write_mutex, NULL);
    241   pthread_cond_init(&condv, NULL);
     253  pthread_mutex_init(&read_wait_mutex, NULL);
     254  pthread_cond_init(&write_wait_condv, NULL);
     255  pthread_cond_init(&read_wait_condv, NULL);
    242256  pthread_key_create(&buffer_key, BufferDestroy);
    243257
     
    247261TOISegmented::MasterView::~MasterView() {
    248262  pthread_mutex_destroy(&views_mutex);
    249   pthread_mutex_destroy(&write_mutex);
    250   pthread_cond_destroy(&condv);
     263  pthread_mutex_destroy(&read_wait_mutex);
     264  pthread_cond_destroy(&write_wait_condv);
     265  pthread_cond_destroy(&read_wait_condv);
    251266  pthread_key_delete(buffer_key);
    252267
     
    256271}
    257272
    258 void TOISegmented::MasterView::putData(int sn, double data, uint_8 flags) {
    259   if (sn0<0) sn0=sn;
     273void TOISegmented::MasterView::putData(int sn, double data, uint_8 flags) { /* writer thread */
     274  if (sn0<0) {
     275    LOG(cout << "***MasterView::putData sn0<0" << endl)
     276    sn0=sn;
     277  }
    260278  // can fit in current segment ?
    261279  if (!(currentSegment != NULL &&
    262280        sn >= currentSegment->sn0 &&
    263281        sn < currentSegment->sn0 + currentSegment->bufferSize)) {
    264     cout << "MasterView::putData, need extend for " << sn << endl;
     282    LOG(cout << "MasterView::putData, need extend for " << sn << endl)
    265283    nextSegment();
    266284  }
     
    268286}
    269287
    270 double TOISegmented::MasterView::getData(int sn) {
    271   return getView()->getData(sn);
    272 }
    273 
    274 uint_8 TOISegmented::MasterView::getFlag(int sn) {
     288double TOISegmented::MasterView::getData(int sn) { /* reader thread */
     289  return getView()->getData(sn); /* thread-specific */
     290}
     291
     292uint_8 TOISegmented::MasterView::getFlag(int sn) { /* reader thread */
    275293  return getView()->getFlag(sn);
    276 }
    277 
    278 void TOISegmented::MasterView::addToWaitList(BufferView* bv) { /* reader thread */
    279   // A view needs to wait for new data.
    280 
    281 
    282   pthread_mutex_lock(&views_mutex);
    283   waitingBuffers.insert(bv);
    284   pthread_mutex_unlock(&views_mutex);
    285   checkDeadLock();
    286 }
    287 
    288 void TOISegmented::MasterView::removeFromWaitList(BufferView* bv) { /* reader thread */
    289   pthread_mutex_lock(&views_mutex);
    290   waitingBuffers.erase(bv);
    291   pthread_mutex_unlock(&views_mutex); 
    292294}
    293295
     
    295297  BufferView* bv = (BufferView*) pthread_getspecific(buffer_key);
    296298  if (bv == NULL) {
    297     cout << "creating new view" << endl;
    298299    bv = createView();
     300    LOG(cout << "creating new view " << hex << bv << dec << endl)
    299301    pthread_setspecific(buffer_key, bv);
    300302  }
     
    302304}
    303305
    304 void TOISegmented::MasterView::signalWaitingViews() { /* any thread */
    305   pthread_mutex_lock(&views_mutex);
    306   set<BufferView*> copyset = waitingBuffers;
    307   pthread_mutex_unlock(&views_mutex);
    308 
    309   for (set<BufferView*>::iterator i=copyset.begin();
    310        i != copyset.end(); i++) {
    311     (*i)->signal();
    312   }
    313 }
    314 
    315 void TOISegmented::MasterView::signal() { /* reader thread */
    316   pthread_mutex_lock(&write_mutex);
    317   pthread_cond_signal(&condv); // only one thread can be sleeping
    318   pthread_mutex_unlock(&write_mutex); 
     306void TOISegmented::MasterView::signalWaitingViews() { /* any thread */ /* views locked */
     307  pthread_mutex_lock(&read_wait_mutex);
     308  pthread_cond_broadcast(&read_wait_condv);
     309  pthread_mutex_unlock(&read_wait_mutex);
     310}
     311
     312void TOISegmented::MasterView::signalWrite() { /* reader thread */ /* views locked */
     313  if (waitingOnWrite) {
     314    LOG(cout << "MasterView : signal for wait on write" << endl)
     315    pthread_cond_signal(&write_wait_condv); // only one thread can be sleeping
     316  }
    319317}
    320318
     
    326324  // The current segment, if any, is now committed. A new
    327325  // blank buffer is allocated, if any.
    328 
    329   cout << "MasterView::nextSegment "
    330        << segments.size()+1 << "/" << maxSegments << endl;
     326  pthread_mutex_lock(&views_mutex);
     327
     328  LOG(cout << "MasterView::nextSegment "
     329      << segments.size()+1 << "/" << maxSegments << endl)
    331330
    332331  if (currentSegment != NULL) {
    333332    currentSegment->status = BufferSegment::COMMITTED;
    334     pthread_mutex_lock(&views_mutex);
    335333    segments.push_back(currentSegment);
    336     pthread_mutex_unlock(&views_mutex);
    337334  }
    338335
     
    344341  currentSegment = new BufferSegment(segmentSize);
    345342  signalWaitingViews(); // they can ask to be updated !!
    346 }
    347 
    348 void TOISegmented::MasterView::waitForCleaning() { /* writer thread */
    349   cout << "MasterView : write wait for clean for " << sn0 << endl;
    350   pthread_mutex_lock(&write_mutex);
     343  pthread_mutex_unlock(&views_mutex);
     344}
     345
     346void TOISegmented::MasterView::waitForCleaning() { /* writer thread */ /* views locked */
     347  LOG(cout << "MasterView : write wait for clean for " << sn0 << endl)
    351348  waitingOnWrite = true;
    352349  checkDeadLock();
    353   pthread_cond_wait(&condv, &write_mutex);
    354   pthread_mutex_unlock(&write_mutex);
    355   cout << "MasterView : wait done" << endl;
     350  pthread_cond_wait(&write_wait_condv, &views_mutex);
     351  LOG(cout << "MasterView : wait done" << endl)
    356352}
    357353
    358354TOISegmented::BufferView* TOISegmented::MasterView::createView() { /* reader thread */
    359355  BufferView* bv =  new BufferView(this);
     356  pthread_mutex_lock(&views_mutex);
    360357  allViews.insert(bv);
     358  pthread_mutex_unlock(&views_mutex);
    361359  updateView(bv);
    362360  return bv;
     
    379377  // nous.
    380378 
    381   int firstNeeded = MAXINT;
    382   for (set<BufferView*>::iterator i = allViews.begin();
    383        i != allViews.end(); i++) {
    384     if ((*i)->firstNeeded < firstNeeded) firstNeeded = (*i)->firstNeeded;
    385   }
    386 
    387   cout << "firstNeeded = " << firstNeeded << endl;
    388 
    389   vector<BufferSegment*>::iterator j = segments.begin();
    390   bool clean = false;
    391   for (vector<BufferSegment*>::iterator i = segments.begin();
    392        i != segments.end(); i++) {
    393     if (((*i)->sn0+(*i)->bufferSize <= firstNeeded) && ((*i)->getRefCount() == 0)) {
    394       clean = true;
    395       j = i;
    396     } else {}
     379  // A condition que tous les consumers se soient fait connaitre...
     380
     381  if (nConsumers == allViews.size()) {
     382    int firstNeeded = MAXINT;
     383    for (set<BufferView*>::iterator i = allViews.begin();
     384         i != allViews.end(); i++) {
     385      if ((*i)->firstNeeded < firstNeeded) firstNeeded = (*i)->firstNeeded;
     386    }
     387   
     388    LOG(cout << "MasterView : firstNeeded = " << firstNeeded << endl);
     389     
     390    vector<BufferSegment*>::iterator j = segments.begin();
     391    bool clean = false;
     392    for (vector<BufferSegment*>::iterator i = segments.begin();
     393         i != segments.end(); i++) {
     394      if (((*i)->sn0+(*i)->bufferSize <= firstNeeded) && ((*i)->getRefCount() == 0)) {
     395        clean = true;
     396        j = i;
     397      }
     398    }
    397399    if (clean) {
    398400      segments.erase(segments.begin(),j);
    399401      sn0 = (*segments.begin())->sn0;
    400     }
    401   }
     402      LOG(cout << "MasterView : purged until " << sn0 << endl);
     403    }
     404  } else {
     405    LOG(cout << "MasterView : not yet all consumer thread known "<< allViews.size()
     406        << "/" << nConsumers  << endl);
     407  }
    402408
    403409  for (vector<BufferSegment*>::iterator i = segments.begin();
     
    416422  }
    417423
    418   if (bv->sn0 > oldBegin && waitingOnWrite) {
    419     signal();
    420   }
    421 
    422   cout << "sync " << sn0 << " - " << newEnd << endl;
    423 
     424  if (bv->sn0 > oldBegin) { // nettoyage de fait, reveiller le writer thread si besoin
     425    signalWrite();
     426  }
     427
     428  LOG(cout << "sync for " << hex << bv << dec << " : "
     429      << oldBegin << " - " << oldEnd << "  -->  "
     430      << bv->sn0 << " - " << newEnd << endl);
     431 
     432  if (newEnd > oldEnd) { // Nouveautes, reveiller les reader threads si besoin
     433    signalWaitingViews();
     434  }
    424435  pthread_mutex_unlock(&views_mutex);
    425 
    426   if (newEnd > oldEnd) {
    427     signalWaitingViews();
    428   }
    429 }
    430 
    431 void TOISegmented::MasterView::checkDeadLock() {
     436}
     437
     438void TOISegmented::MasterView::checkDeadLock() { /* views locked */
    432439   // There is a possible deadlock if no view can free old segments
    433440  // and we are waiting for write.
     
    437444  // while we are asleep
    438445
    439   if (!waitingOnWrite) return; // no problem, there is an active writer
     446  pthread_mutex_lock(&read_wait_mutex);
     447  if (!waitingOnWrite) {
     448    pthread_mutex_unlock(&read_wait_mutex);
     449    return; // no problem, there is an active writer
     450  }
    440451
    441452  // Is any sleeping view needing our first segment ?
    442453
    443   pthread_mutex_lock(&views_mutex);
    444   for (set<BufferView*>::iterator i=waitingBuffers.begin();
    445        i != waitingBuffers.end(); i++) {
    446     if ((*i)->firstNeeded < sn0+segmentSize) {
     454  for (set<BufferView*>::iterator i=allViews.begin();
     455       i != allViews.end(); i++) {
     456    if ((*i)->waiting && (*i)->firstNeeded < sn0+segmentSize) {
    447457      cout << "**** DEADLOCK detected ****" << endl;
    448458      cout << "We are waiting on write (buffer is full)"<< endl;
     
    452462    }
    453463  }
    454   pthread_mutex_unlock(&views_mutex);
     464  pthread_mutex_unlock(&read_wait_mutex);
    455465}
    456466
  • trunk/ArchTOIPipe/Kernel/toisegment.h

    r1690 r1692  
    2727  virtual void          wontNeedBefore(int i);
    2828  virtual void          putDone();
     29  virtual void          addConsumer(TOIProcessor*);
    2930
    3031  // Methodes ignorees car on reimplemente les methodes de base
     
    109110
    110111  protected:
    111     void addToWaitList(BufferView* bv);
    112     void removeFromWaitList(BufferView* bv);
    113 
    114112
    115113    friend class BufferView;
     114    friend class TOISegmented;
    116115    void signalWaitingViews(); // views are waiting on read
    117     void signal(); // we are waiting on write
     116    void signalWrite();        // we are waiting on write
    118117    void nextSegment();
    119118    void waitForCleaning();
     
    127126    int sn0;                         // First sn in first segment
    128127    vector<BufferSegment*> segments; // Committed segments
     128    int nConsumers;
    129129   
    130130    pthread_mutex_t  views_mutex; // lock for master buffer list access
    131     pthread_mutex_t  write_mutex; // for write waiting
    132     pthread_cond_t   condv; // waiting for cleaning (on writer thread)
     131    pthread_cond_t   write_wait_condv; // waiting for cleaning (on writer thread)
    133132    pthread_key_t    buffer_key; // thread-specific buffer view
    134133    static void BufferDestroy(void *);
    135134
     135    pthread_mutex_t  read_wait_mutex;
     136    pthread_cond_t   read_wait_condv;
     137
    136138    bool   waitingOnWrite; // wait on writer thread
    137139
    138     set<BufferView*>  waitingBuffers;
    139140    set<BufferView*>  allViews;
    140141
     
    158159    void sync();  // recupere les nouveaux segments, resync avec master
    159160    void ensure(int sn);
    160     void signal();
     161
     162    bool waiting;
    161163
    162164    friend class MasterView;
     
    166168    int segmentSize;
    167169    int firstNeeded;
    168     pthread_mutex_t  mutex; // lock pour attente de segments
    169     pthread_cond_t   condv; // attente de segments (en lecture)
    170170  }; 
    171171
  • trunk/ArchTOIPipe/ProcWSophya/Makefile.in

    r1685 r1692  
    9999
    100100%.d: $(srcdir)/%.cc
    101         $(SHELL) -ec 'gcc -MM $(CPPFLAGS) -I. $< \
     101        $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
    102102                | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
    103103                [ -s $@ ] || rm -f $@'
    104104
    105105%.d: $(srcdir)/%.c
    106         $(SHELL) -ec 'gcc -MM $(CPPFLAGS) -I. $< \
     106        $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
    107107                | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
    108108                [ -s $@ ] || rm -f $@'
  • trunk/ArchTOIPipe/Processors/Makefile.in

    r1685 r1692  
    9999
    100100%.d: $(srcdir)/%.cc
    101         $(SHELL) -ec 'gcc -MM $(CPPFLAGS) -I. $< \
     101        $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
    102102                | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
    103103                [ -s $@ ] || rm -f $@'
    104104
    105105%.d: $(srcdir)/%.c
    106         $(SHELL) -ec 'gcc -MM $(CPPFLAGS) -I. $< \
     106        $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
    107107                | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
    108108                [ -s $@ ] || rm -f $@'
  • trunk/ArchTOIPipe/TestPipes/Makefile.in

    r1685 r1692  
    9696
    9797%.d: $(srcdir)/%.cc
    98         $(SHELL) -ec 'gcc -MM $(CPPFLAGS) -I. $< \
     98        $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
    9999                | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
    100100                [ -s $@ ] || rm -f $@'
    101101
    102102%.d: $(srcdir)/%.c
    103         $(SHELL) -ec 'gcc -MM $(CPPFLAGS) -I. $< \
     103        $(SHELL) -ec '@gcc@ -MM $(CPPFLAGS) -I. $< \
    104104                | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
    105105                [ -s $@ ] || rm -f $@'
  • trunk/ArchTOIPipe/configure

    r1685 r1692  
    911911
    912912
     913if test $GCC = "yes"; then
     914  gcc=$CC
     915else
     916  gcc=gcc
     917fi
     918
     919
    913920echo $ac_n "checking size of short""... $ac_c" 1>&6
    914 echo "configure:915: checking size of short" >&5
     921echo "configure:922: checking size of short" >&5
    915922if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
    916923  echo $ac_n "(cached) $ac_c" 1>&6
     
    920927else
    921928  cat > conftest.$ac_ext <<EOF
    922 #line 923 "configure"
     929#line 930 "configure"
    923930#include "confdefs.h"
    924931#include <stdio.h>
     
    931938}
    932939EOF
    933 if { (eval echo configure:934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     940if { (eval echo configure:941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    934941then
    935942  ac_cv_sizeof_short=`cat conftestval`
     
    951958
    952959echo $ac_n "checking size of int""... $ac_c" 1>&6
    953 echo "configure:954: checking size of int" >&5
     960echo "configure:961: checking size of int" >&5
    954961if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
    955962  echo $ac_n "(cached) $ac_c" 1>&6
     
    959966else
    960967  cat > conftest.$ac_ext <<EOF
    961 #line 962 "configure"
     968#line 969 "configure"
    962969#include "confdefs.h"
    963970#include <stdio.h>
     
    970977}
    971978EOF
    972 if { (eval echo configure:973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     979if { (eval echo configure:980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    973980then
    974981  ac_cv_sizeof_int=`cat conftestval`
     
    990997
    991998echo $ac_n "checking size of long""... $ac_c" 1>&6
    992 echo "configure:993: checking size of long" >&5
     999echo "configure:1000: checking size of long" >&5
    9931000if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
    9941001  echo $ac_n "(cached) $ac_c" 1>&6
     
    9981005else
    9991006  cat > conftest.$ac_ext <<EOF
    1000 #line 1001 "configure"
     1007#line 1008 "configure"
    10011008#include "confdefs.h"
    10021009#include <stdio.h>
     
    10091016}
    10101017EOF
    1011 if { (eval echo configure:1012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     1018if { (eval echo configure:1019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    10121019then
    10131020  ac_cv_sizeof_long=`cat conftestval`
     
    10291036
    10301037echo $ac_n "checking size of long long""... $ac_c" 1>&6
    1031 echo "configure:1032: checking size of long long" >&5
     1038echo "configure:1039: checking size of long long" >&5
    10321039if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
    10331040  echo $ac_n "(cached) $ac_c" 1>&6
     
    10371044else
    10381045  cat > conftest.$ac_ext <<EOF
    1039 #line 1040 "configure"
     1046#line 1047 "configure"
    10401047#include "confdefs.h"
    10411048#include <stdio.h>
     
    10481055}
    10491056EOF
    1050 if { (eval echo configure:1051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     1057if { (eval echo configure:1058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    10511058then
    10521059  ac_cv_sizeof_long_long=`cat conftestval`
     
    10681075
    10691076echo $ac_n "checking size of float""... $ac_c" 1>&6
    1070 echo "configure:1071: checking size of float" >&5
     1077echo "configure:1078: checking size of float" >&5
    10711078if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
    10721079  echo $ac_n "(cached) $ac_c" 1>&6
     
    10761083else
    10771084  cat > conftest.$ac_ext <<EOF
    1078 #line 1079 "configure"
     1085#line 1086 "configure"
    10791086#include "confdefs.h"
    10801087#include <stdio.h>
     
    10871094}
    10881095EOF
    1089 if { (eval echo configure:1090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     1096if { (eval echo configure:1097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    10901097then
    10911098  ac_cv_sizeof_float=`cat conftestval`
     
    11071114
    11081115echo $ac_n "checking size of double""... $ac_c" 1>&6
    1109 echo "configure:1110: checking size of double" >&5
     1116echo "configure:1117: checking size of double" >&5
    11101117if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
    11111118  echo $ac_n "(cached) $ac_c" 1>&6
     
    11151122else
    11161123  cat > conftest.$ac_ext <<EOF
    1117 #line 1118 "configure"
     1124#line 1125 "configure"
    11181125#include "confdefs.h"
    11191126#include <stdio.h>
     
    11261133}
    11271134EOF
    1128 if { (eval echo configure:1129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     1135if { (eval echo configure:1136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    11291136then
    11301137  ac_cv_sizeof_double=`cat conftestval`
     
    11461153
    11471154echo $ac_n "checking size of long double""... $ac_c" 1>&6
    1148 echo "configure:1149: checking size of long double" >&5
     1155echo "configure:1156: checking size of long double" >&5
    11491156if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
    11501157  echo $ac_n "(cached) $ac_c" 1>&6
     
    11541161else
    11551162  cat > conftest.$ac_ext <<EOF
    1156 #line 1157 "configure"
     1163#line 1164 "configure"
    11571164#include "confdefs.h"
    11581165#include <stdio.h>
     
    11651172}
    11661173EOF
    1167 if { (eval echo configure:1168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     1174if { (eval echo configure:1175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    11681175then
    11691176  ac_cv_sizeof_long_double=`cat conftestval`
     
    11871194
    11881195echo $ac_n "checking "for cfitsio lib"""... $ac_c" 1>&6
    1189 echo "configure:1190: checking "for cfitsio lib"" >&5
     1196echo "configure:1197: checking "for cfitsio lib"" >&5
    11901197MACHDIR=`uname`-$CXX
    11911198if test -f $ARCHBASEREP/$MACHDIR/Libs/libcfitsio.a; then
     
    12121219
    12131220echo $ac_n "checking "for cfitsio includes"""... $ac_c" 1>&6
    1214 echo "configure:1215: checking "for cfitsio includes"" >&5
     1221echo "configure:1222: checking "for cfitsio includes"" >&5
    12151222if test -f $CFITSIODIR/fitsio.h; then
    12161223  cfitsincdir='-I$(CFITSIODIR)'
     
    12241231
    12251232echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
    1226 echo "configure:1227: checking for sin in -lm" >&5
     1233echo "configure:1234: checking for sin in -lm" >&5
    12271234ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
    12281235if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12321239LIBS="-lm  $LIBS"
    12331240cat > conftest.$ac_ext <<EOF
    1234 #line 1235 "configure"
     1241#line 1242 "configure"
    12351242#include "confdefs.h"
    12361243/* Override any gcc2 internal prototype to avoid an error.  */
     
    12431250; return 0; }
    12441251EOF
    1245 if { (eval echo configure:1246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1252if { (eval echo configure:1253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    12461253  rm -rf conftest*
    12471254  eval "ac_cv_lib_$ac_lib_var=yes"
     
    12721279
    12731280echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
    1274 echo "configure:1275: checking how to run the C preprocessor" >&5
     1281echo "configure:1282: checking how to run the C preprocessor" >&5
    12751282# On Suns, sometimes $CPP names a directory.
    12761283if test -n "$CPP" && test -d "$CPP"; then
     
    12871294  # not just through cpp.
    12881295  cat > conftest.$ac_ext <<EOF
    1289 #line 1290 "configure"
     1296#line 1297 "configure"
    12901297#include "confdefs.h"
    12911298#include <assert.h>
     
    12931300EOF
    12941301ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1295 { (eval echo configure:1296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1302{ (eval echo configure:1303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    12961303ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    12971304if test -z "$ac_err"; then
     
    13041311  CPP="${CC-cc} -E -traditional-cpp"
    13051312  cat > conftest.$ac_ext <<EOF
    1306 #line 1307 "configure"
     1313#line 1314 "configure"
    13071314#include "confdefs.h"
    13081315#include <assert.h>
     
    13101317EOF
    13111318ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1312 { (eval echo configure:1313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1319{ (eval echo configure:1320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    13131320ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    13141321if test -z "$ac_err"; then
     
    13211328  CPP="${CC-cc} -nologo -E"
    13221329  cat > conftest.$ac_ext <<EOF
    1323 #line 1324 "configure"
     1330#line 1331 "configure"
    13241331#include "confdefs.h"
    13251332#include <assert.h>
     
    13271334EOF
    13281335ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1329 { (eval echo configure:1330: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1336{ (eval echo configure:1337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    13301337ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    13311338if test -z "$ac_err"; then
     
    13521359
    13531360echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
    1354 echo "configure:1355: checking for ANSI C header files" >&5
     1361echo "configure:1362: checking for ANSI C header files" >&5
    13551362if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    13561363  echo $ac_n "(cached) $ac_c" 1>&6
    13571364else
    13581365  cat > conftest.$ac_ext <<EOF
    1359 #line 1360 "configure"
     1366#line 1367 "configure"
    13601367#include "confdefs.h"
    13611368#include <stdlib.h>
     
    13651372EOF
    13661373ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1367 { (eval echo configure:1368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1374{ (eval echo configure:1375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    13681375ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    13691376if test -z "$ac_err"; then
     
    13821389  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
    13831390cat > conftest.$ac_ext <<EOF
    1384 #line 1385 "configure"
     1391#line 1392 "configure"
    13851392#include "confdefs.h"
    13861393#include <string.h>
     
    14001407  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
    14011408cat > conftest.$ac_ext <<EOF
    1402 #line 1403 "configure"
     1409#line 1410 "configure"
    14031410#include "confdefs.h"
    14041411#include <stdlib.h>
     
    14211428else
    14221429  cat > conftest.$ac_ext <<EOF
    1423 #line 1424 "configure"
     1430#line 1431 "configure"
    14241431#include "confdefs.h"
    14251432#include <ctype.h>
     
    14321439
    14331440EOF
    1434 if { (eval echo configure:1435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     1441if { (eval echo configure:1442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    14351442then
    14361443  :
     
    14591466ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    14601467echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    1461 echo "configure:1462: checking for $ac_hdr" >&5
     1468echo "configure:1469: checking for $ac_hdr" >&5
    14621469if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    14631470  echo $ac_n "(cached) $ac_c" 1>&6
    14641471else
    14651472  cat > conftest.$ac_ext <<EOF
    1466 #line 1467 "configure"
     1473#line 1474 "configure"
    14671474#include "confdefs.h"
    14681475#include <$ac_hdr>
    14691476EOF
    14701477ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1471 { (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1478{ (eval echo configure:1479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    14721479ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    14731480if test -z "$ac_err"; then
     
    16361643s%@CC@%$CC%g
    16371644s%@CXX@%$CXX%g
     1645s%@gcc@%$gcc%g
    16381646s%@cfitslibdir@%$cfitslibdir%g
    16391647s%@cfitsincdir@%$cfitsincdir%g
  • trunk/ArchTOIPipe/configure.in

    r1663 r1692  
    1818AC_PROG_CC
    1919AC_PROG_CXX
     20
     21if test $GCC = "yes"; then
     22  gcc=$CC
     23else
     24  gcc=gcc
     25fi
     26AC_SUBST(gcc)
    2027
    2128AC_CHECK_SIZEOF(short)
  • trunk/ArchTOIPipe/fan_copy

    r1691 r1692  
    88   cp -p $f $d/$f
    99  end
     10  cp -p Makefile.in_$d $d/Makefile.in
    1011end
Note: See TracChangeset for help on using the changeset viewer.