Changeset 62


Ignore:
Timestamp:
Dec 7, 2009 12:49:24 PM (10 years ago)
Author:
awalther
Message:

merge stable version 2.1 with revision 61

Location:
stable/2.1
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • stable/2.1

  • stable/2.1/ADOL-C/src/Makefile.am

    r42 r62  
    4545lib_LTLIBRARIES      = libadolc.la
    4646
    47 libadolc_la_LDFLAGS  = -version-info 0:0:0
     47libadolc_la_LDFLAGS  = -version-info 2:1:1
    4848
    4949if SPARSE
  • stable/2.1/ADOL-C/src/Makefile.in

    r40 r62  
    186186lib_LTLIBRARIES = libadolc.la
    187187
    188 libadolc_la_LDFLAGS = -version-info 0:0:0
     188libadolc_la_LDFLAGS = -version-info 2:1:1
    189189
    190190@SPARSE_TRUE@libadolc_la_SOURCES = adalloc.c malloc.c adouble.cpp \
  • stable/2.1/ADOL-C/src/adouble.cpp

    r42 r62  
    2525#include <taping_p.h>
    2626
     27using namespace std;
     28
    2729/****************************************************************************/
    2830/*                                                        HELPFUL FUNCTIONS */
     
    15521554
    15531555    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    1554         ADOLC_MATH_NSP::asinh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
     1556        ADOLC_MATH_NSP_ERF::asinh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
    15551557    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    15561558    return locat;
     
    15781580
    15791581    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    1580         ADOLC_MATH_NSP::acosh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
     1582        ADOLC_MATH_NSP_ERF::acosh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
    15811583    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    15821584    return locat;
     
    16041606
    16051607    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    1606         ADOLC_MATH_NSP::atanh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
     1608        ADOLC_MATH_NSP_ERF::atanh(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
    16071609    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    16081610    return locat;
     
    16161618    locint locat = next_loc();
    16171619
    1618     adouble y = exp(-x*x);
     1620    adouble y = 2.0 /
     1621        ADOLC_MATH_NSP_ERF::sqrt(ADOLC_MATH_NSP::acos(-1.0))*exp(-x*x);
    16191622
    16201623    if (ADOLC_CURRENT_TAPE_INFOS.traceFlag) { // old: write_quad(erf_op,locat,x.location,y.location);
     
    16301633
    16311634    ADOLC_GLOBAL_TAPE_VARS.store[locat] =
    1632         ADOLC_MATH_NSP::erf(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
     1635        ADOLC_MATH_NSP_ERF::erf(ADOLC_GLOBAL_TAPE_VARS.store[x.location]);
    16331636    ADOLC_OPENMP_RESTORE_THREAD_NUMBER;
    16341637    return locat;
  • stable/2.1/ADOL-C/src/adouble.h

    r42 r62  
    3434using std::ostream;
    3535using std::istream;
     36#ifdef ATRIG_ERF
     37#if defined(AD_ERR_FUN)
     38#include <tr1/cmath>
     39#endif
     40#endif
    3641
    3742#include <common.h>
     
    10111016adouble asinh (const adouble &a) {
    10121017    adouble tmp;
    1013     tmp.val=ADOLC_MATH_NSP::asinh(a.val);
     1018    tmp.val=ADOLC_MATH_NSP_ERF::asinh(a.val);
    10141019    double tmp2=ADOLC_MATH_NSP::sqrt(a.val*a.val+1);
    10151020    FOR_I_EQ_0_LT_NUMDIR
     
    10201025adouble acosh (const adouble &a) {
    10211026    adouble tmp;
    1022     tmp.val=ADOLC_MATH_NSP::acosh(a.val);
     1027    tmp.val=ADOLC_MATH_NSP_ERF::acosh(a.val);
    10231028    double tmp2=ADOLC_MATH_NSP::sqrt(a.val*a.val-1);
    10241029    FOR_I_EQ_0_LT_NUMDIR
     
    10291034adouble atanh (const adouble &a) {
    10301035    adouble tmp;
    1031     tmp.val=ADOLC_MATH_NSP::atanh(a.val);
     1036    tmp.val=ADOLC_MATH_NSP_ERF::atanh(a.val);
    10321037    double tmp2=1-a.val*a.val;
    10331038    FOR_I_EQ_0_LT_NUMDIR
     
    12291234adouble erf (const adouble &a) {
    12301235    adouble tmp;
    1231     tmp.val=ADOLC_MATH_NSP::erf(a.val);
     1236    tmp.val=ADOLC_MATH_NSP_ERF::erf(a.val);
    12321237    double tmp2 = 2.0 /
    1233         ADOLC_MATH_NSP::sqrt(ADOLC_MATH_NSP::acos(-1.0)) *
    1234         ADOLC_MATH_NSP::exp(-a.val*a.val);
     1238        ADOLC_MATH_NSP_ERF::sqrt(ADOLC_MATH_NSP::acos(-1.0)) *
     1239        ADOLC_MATH_NSP_ERF::exp(-a.val*a.val);
    12351240    FOR_I_EQ_0_LT_NUMDIR
    12361241    tmp.ADVAL_I=tmp2*a.ADVAL_I;
  • stable/2.1/ADOL-C/src/drivers/drivers.c

    r42 r62  
    4545int gradient(short tag,
    4646             int n,
    47              double* argument,
     47             const double* argument,
    4848             double* result) {
    4949    int rc= -1;
  • stable/2.1/ADOL-C/src/drivers/drivers.h

    r42 r62  
    3434/*                                                                 gradient */
    3535/* gradient(tag, n, x[n], g[n])                                             */
    36 ADOLC_DLL_EXPORT int gradient(short,int,double*,double*);
     36ADOLC_DLL_EXPORT int gradient(short,int,const double*,double*);
    3737ADOLC_DLL_EXPORT fint gradient_(fint*,fint*,fdouble*,fdouble*);
    3838
  • stable/2.1/ADOL-C/src/drivers/taylor.c

    r42 r62  
    118118
    119119long binomi(int n, int k) {
     120    long double accum = 1;
     121    unsigned int i;
    120122
    121123    if (k > n)
     
    125127        k = n-k;
    126128
    127     long double accum = 1;
    128     unsigned int i;
    129129    for (i = 1; i <= k; i++)
    130130         accum = accum * (n-k+i) / i;
     
    564564    ii = bd;
    565565    for (i=0; i<n; i++)
     566      {
    566567        for (j=0; j<d; j++)
    567568        {
     
    570571            W[i][j] = 0;
    571572        }
     573        for (j=0; j<n; j++)
     574          for (l=0; l<=d; l++)
     575            A[i][j][l] = 0;
     576      }
    572577
    573578    while (--ii > 0) {
     
    582587                    bi = w[i]-Y[i][0];
    583588                else
    584                     bi = W[i][l-1]-Y[i][l];
     589                    bi = W[i][l-1]-Y[i][l];
    585590                for (j=0; j<n; j++)
    586591                    if (nonzero[i][j]>1) {
     592                        int indj = j;
     593                        int indX = l;
    587594                        Aij = A[i][j];
    588                         indexA = 1;
     595                        indexA = l-1;
    589596                        Xj = X[j]+l;
    590                         indexX = l-1;
     597                        indexX = 1;
    591598                        if (da == l-1)
    592599                          {
     
    599606                                bi += (*(++Aij))*(*(--Xj));
    600607                                bi += A[i][j][indexA]*X[j][indexX];
    601                                 indexA++;
    602                                 indexX--;
     608                                indexA--;
     609                                indexX++;
    603610                              }
    604611                          }
     
    607614            }
    608615            MINDEC(rc,jac_solv(tag,n,xold,b,2));
    609             if (rc == -3)
     616           if (rc == -3)
    610617                return -3;
    611618            for (i=0; i<n; i++) {
    612                 X[i][l] += b[i];
    613                 /* 981214 new nl */
    614                 Xhelp[i][l-1] += b[i];
     619              X[i][l] += b[i];
     620              Xhelp[i][l-1] += b[i];
    615621            }
    616622        }
     
    699705                do {
    700706                    for(j=0;j<n;j++)
     707                      {
    701708                        tensor[j][ptr->a] += X[j][ptr->b]*ptr->c;
     709                      }
    702710                    ptr = ptr->next;
    703711                } while (ptr != NULL);
  • stable/2.1/ADOL-C/src/dvlparms.h

    r42 r62  
    2929/* Tells ADOL-C which name space offers the mathematical functions          */
    3030#define ADOLC_MATH_NSP std
     31/* For error function with gcc compiler                                     */
     32#define ADOLC_MATH_NSP_ERF std::tr1
    3133
    3234/*--------------------------------------------------------------------------*/
  • stable/2.1/ADOL-C/src/fo_rev.c

    r42 r62  
    257257    /****************************************************************************/
    258258    /*                                                           ALL VARIABLES  */
    259     ADOLC_OPENMP_THREAD_NUMBER;
    260259    unsigned char operation;   /* operation code */
    261260    int ret_c = 3;             /* return value */
     
    349348
    350349
     350    ADOLC_OPENMP_THREAD_NUMBER;
    351351    ADOLC_OPENMP_GET_THREAD_NUMBER;
    352352
     
    17841784    free(dp_A);
    17851785#endif
    1786 #ifdef _HOV_
     1786#ifdef _FOV_
    17871787    myfree2(dpp_A);
    17881788#endif
  • stable/2.1/ADOL-C/src/ho_rev.c

    r42 r62  
    365365    /************************************************************************/
    366366    /*                                                       ALL VARIABLES  */
    367     ADOLC_OPENMP_THREAD_NUMBER;
    368367    unsigned char operation;   /* operation code */
    369368    int dc, ret_c=3;
     
    423422#endif
    424423
     424    ADOLC_OPENMP_THREAD_NUMBER;
    425425    ADOLC_OPENMP_GET_THREAD_NUMBER;
    426426
  • stable/2.1/ADOL-C/src/interfaces.h

    r42 r62  
    184184/* zos_forward(tag, m, n, keep, x[n], y[m])                                 */
    185185/* (defined in uni5_for.mc)                                                 */
    186 ADOLC_DLL_EXPORT int zos_forward(short,int,int,int,double*,double*);
     186ADOLC_DLL_EXPORT int zos_forward(short,int,int,int,const double*,double*);
    187187
    188188/* zos_forward_nk(tag, m, n, x[n], y[m])                                    */
     
    238238/* (defined in uni5_for.mc)                                                 */
    239239ADOLC_DLL_EXPORT int fov_forward(
    240     short, int,int,int,double*,double**,double*,double**);
     240    short, int,int,int,const double*,double**,double*,double**);
    241241ADOLC_DLL_EXPORT int fov_offset_forward(
    242242    short, int,int,int,int,double*,double**,double*,double**);
     
    294294
    295295ADOLC_DLL_EXPORT int int_forward_tight
    296 (short, int, int, int, double*, unsigned long int**, double*, unsigned long int**);
     296(short, int, int, int, const double*, unsigned long int**, double*, unsigned long int**);
    297297
    298298/****************************************************************************/
     
    303303
    304304ADOLC_DLL_EXPORT int indopro_forward_safe
    305 (short, int, int, double*, unsigned int**);
     305(short, int, int, const double*, unsigned int**);
    306306
    307307
     
    311311
    312312ADOLC_DLL_EXPORT int indopro_forward_tight
    313 (short, int, int, double*, unsigned int**);
     313(short, int, int, const double*, unsigned int**);
    314314
    315315/****************************************************************************/
     
    320320
    321321ADOLC_DLL_EXPORT int nonl_ind_forward_safe
    322 (short, int, double*, unsigned int**);
     322(short, int, int, const double*, unsigned int**);
    323323
    324324
     
    328328
    329329ADOLC_DLL_EXPORT int nonl_ind_forward_tight
    330 (short, int, double*, unsigned int**);
     330(short, int, int, const double*, unsigned int**);
    331331
    332332/****************************************************************************/
  • stable/2.1/ADOL-C/src/sparse/sparsedrivers.cpp

    r42 r62  
    3535/*                                                sparsity pattern Jacobian */
    3636/*--------------------------------------------------------------------------*/
    37 /*                                                                          */
     37/*                                                                         */
    3838
    3939int jac_pat(
    40     short        tag,        /* tape identification                        */
    41     int          depen,      /* number of dependent variables              */
    42     int          indep,      /* number of independent variables            */
    43     double       *basepoint, /* independant variable values                */
     40    short          tag,       /* tape identification                       */
     41    int            depen,     /* number of dependent variables             */
     42    int            indep,     /* number of independent variables           */
     43    const double  *basepoint, /* independant variable values               */
    4444    unsigned int **crs,
    4545    /* returned compressed row block-index storage                         */
     
    7272    if (( options[1] < 0 ) || (options[1] > 1 ))
    7373        options[1] = 0; /* default */
    74     if (( options[2] < 0 ) || (options[2] > 2 ))
     74    if (( options[2] < -1 ) || (options[2] > 2 ))
    7575        options[2] = 0; /* default */
    7676
     
    153153
    154154    if (option == 1)
    155       rc = nonl_ind_forward_tight(tag, indep, basepoint, crs);
     155      rc = nonl_ind_forward_tight(tag, 1, indep, basepoint, crs);
    156156    else
    157       rc = nonl_ind_forward_safe(tag, indep, basepoint, crs);
     157      rc = nonl_ind_forward_safe(tag, 1, indep, basepoint, crs);
    158158
    159159    return(rc);
     
    194194    int            indep,      /* number of independent variables         */
    195195    int            repeat,     /* indicated repeated call with same seed  */
    196     double        *basepoint,  /* independant variable values             */
     196    const double  *basepoint,  /* independant variable values             */
    197197    int           *nnz,        /* number of nonzeros                      */
    198198    unsigned int **rind,       /* row index                               */
     
    231231      if (( options[1] < 0 ) || (options[1] > 1 ))
    232232        options[1] = 0; /* default */
    233       if (( options[2] < 0 ) || (options[2] > 2 ))
     233      if (( options[2] < -1 ) || (options[2] > 2 ))
    234234        options[2] = 0; /* default */
    235235      if (( options[3] < 0 ) || (options[3] > 1 ))
     
    239239      ret_val = jac_pat(tag, depen, indep, basepoint, sJinfos.JP, options);
    240240     
     241
    241242      if (ret_val < 0) {
    242243        printf(" ADOL-C error in sparse_jac() \n");
     
    251252     
    252253      *nnz = sJinfos.nnz_in;
    253      
    254      
     254
     255      if (options[2] == -1)
     256        {
     257          (*rind) = new unsigned int[*nnz];
     258          (*cind) = new unsigned int[*nnz];
     259          unsigned int index = 0;
     260          for (i=0;i<depen;i++)
     261            for (j=1;j<=sJinfos.JP[i][0];j++)
     262              {
     263                (*rind)[index] = i;
     264                (*cind)[index++] = sJinfos.JP[i][j];
     265              }
     266        }
     267
    255268      FILE *fp_JP;
    256269                       
     
    296309    }
    297310
     311    if (options[2] == -1)
     312      return ret_val;
     313
    298314    /* compute jacobian times matrix product */
    299315
     
    308324      ret_val = fov_forward(tag, depen, indep, sJinfos.p, basepoint, sJinfos.Seed, sJinfos.y, sJinfos.B);
    309325   
     326
    310327    /* recover compressed Jacobian => ColPack library */
    311328
     
    357374
    358375    /* Generate sparsity pattern, determine nnz, allocate memory */
    359     if (repeat == 0) {
     376    if (repeat <= 0) {
    360377        if (( options[0] < 0 ) || (options[0] > 1 ))
    361378          options[0] = 0; /* default */
     
    363380          options[1] = 0; /* default */
    364381
    365         sHinfos.HP    = (unsigned int **) malloc(indep*sizeof(unsigned int *));
    366 
    367         /* generate sparsity pattern */
    368         ret_val = hess_pat(tag, indep, basepoint, sHinfos.HP, options[0]);
    369 
    370         if (ret_val < 0) {
    371             printf(" ADOL-C error in sparse_hess() \n");
    372             return ret_val;
    373         }
    374 
    375         sHinfos.nnz_in = 0;
     382        if (repeat == 0)
     383          {
     384            sHinfos.HP    = (unsigned int **) malloc(indep*sizeof(unsigned int *));
     385
     386            /* generate sparsity pattern */
     387            ret_val = hess_pat(tag, indep, basepoint, sHinfos.HP, options[0]);
     388
     389            if (ret_val < 0) {
     390              printf(" ADOL-C error in sparse_hess() \n");
     391              return ret_val;
     392            }
     393          }
     394        else
     395          {
     396            tapeInfos=getTapeInfos(tag);
     397            memcpy(&ADOLC_CURRENT_TAPE_INFOS, tapeInfos, sizeof(TapeInfos));
     398            sHinfos.HP     = ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.HP;
     399          }
     400
     401        sHinfos.nnz_in = 0;
     402
    376403        for (i=0;i<indep;i++) {
    377404            for (j=1;j<=sHinfos.HP[i][0];j++)
     
    447474    }
    448475
     476    if (repeat == -1)
     477      return ret_val;
     478
    449479//     this is the most efficient variant. However, there is somewhere a bug in hos_ov_reverse
    450480//     ret_val = hov_wk_forward(tag,1,indep,1,2,sHinfos.p,basepoint,sHinfos.Xppp,&y,sHinfos.Yppp);
     
    493523}
    494524
     525
     526/****************************************************************************/
     527/*******        sparse Hessians, complete driver              ***************/
     528/****************************************************************************/
     529
     530int set_HP(
     531    short          tag,        /* tape identification                     */
     532    int            indep,      /* number of independent variables         */
     533    unsigned int ** HP)
     534{
     535    SparseHessInfos sHinfos;
     536    TapeInfos *tapeInfos;
     537
     538    tapeInfos=getTapeInfos(tag);
     539    memcpy(&ADOLC_CURRENT_TAPE_INFOS, tapeInfos, sizeof(TapeInfos));
     540    sHinfos.nnz_in = ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.nnz_in;
     541    sHinfos.HP     = HP;
     542    sHinfos.Hcomp  = ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.Hcomp;
     543    sHinfos.Xppp   = ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.Xppp;
     544    sHinfos.Yppp   = ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.Yppp;
     545    sHinfos.Zppp   = ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.Zppp;
     546    sHinfos.Upp    = ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.Upp;
     547    sHinfos.p      = ADOLC_CURRENT_TAPE_INFOS.pTapeInfos.sHinfos.p;
     548    setTapeInfoHessSparse(tag, sHinfos);
     549}
     550
    495551/*****************************************************************************/
    496552/*                                                    JACOBIAN BLOCK PATTERN */
     
    498554/* ------------------------------------------------------------------------- */
    499555int bit_vector_propagation(
    500     short  tag,        /* tape identification                        */
    501     int    depen,      /* number of dependent variables              */
    502     int    indep,      /* number of independent variables            */
    503     double *basepoint, /* independant variable values                */
     556    short          tag,        /* tape identification                */
     557    int            depen,      /* number of dependent variables      */
     558    int            indep,      /* number of independent variables    */
     559    const double  *basepoint, /* independant variable values         */
    504560    unsigned int **crs,
    505561    /* compressed block row storage                                  */
  • stable/2.1/ADOL-C/src/sparse/sparsedrivers.h

    r42 r62  
    3434
    3535ADOLC_DLL_EXPORT int jac_pat
    36 (short,int,int,double*,unsigned int**,int*);
     36(short,int,int,const double*,unsigned int**,int*);
    3737
    3838/*--------------------------------------------------------------------------*/
     
    4949
    5050ADOLC_DLL_EXPORT int sparse_jac
    51 (short, int , int, int, double*, int *,
     51(short, int , int, int, const double*, int *,
    5252 unsigned int **, unsigned int **, double **,int*);
    5353
     
    7878 unsigned int **, unsigned int **, double **,int*);
    7979
     80int set_HP(
     81    short          tag,        /* tape identification                     */
     82    int            indep,      /* number of independent variables         */
     83    unsigned int ** HP);
     84
    8085/*--------------------------------------------------------------------------*/
    8186/*                                                   JACOBIAN BLOCK PATTERN */
     
    9095
    9196ADOLC_DLL_EXPORT int bit_vector_propagation
    92 (short, int, int, double*, unsigned int**, int*);
     97(short, int, int, const double*, unsigned int**, int*);
    9398
    9499
  • stable/2.1/ADOL-C/src/tape_handling.cpp

    r42 r62  
    55 Contents: management of tape infos
    66
    7  Copyright (c) Andreas Kowarz
     7 Copyright (c) Andreas Kowarz, Andrea Walther
    88 
    99 This file is part of ADOL-C. This software is provided as open source.
     
    1818#include <iostream>
    1919#include <string.h>
     20#ifdef HAVE_UNISTD_H
    2021#include <unistd.h>
     22#endif
    2123#include <vector>
    2224#include <stack>
     
    148150    newTapeInfos->pTapeInfos.inJacSparseUse=0;
    149151    newTapeInfos->pTapeInfos.inHessSparseUse=0;
     152    newTapeInfos->pTapeInfos.sJinfos.B=NULL;
     153    newTapeInfos->pTapeInfos.sJinfos.y=NULL;
     154    newTapeInfos->pTapeInfos.sHinfos.Zppp=NULL;
     155    newTapeInfos->pTapeInfos.sHinfos.Yppp=NULL;
     156    newTapeInfos->pTapeInfos.sHinfos.Xppp=NULL;
     157    newTapeInfos->pTapeInfos.sHinfos.Upp=NULL;
     158    newTapeInfos->pTapeInfos.sHinfos.Hcomp=NULL;
    150159    newTapeInfos->stats[OP_BUFFER_SIZE] =
    151160        ADOLC_GLOBAL_TAPE_VARS.operationBufferSize;
     
    461470                (*tiIter)->tayBuffer = NULL;
    462471            }
     472
     473
     474            if ((*tiIter)->pTapeInfos.sJinfos.B != NULL)
     475            {
     476                free((char*)  *(*tiIter)->pTapeInfos.sJinfos.B);
     477                free((char*)   (*tiIter)->pTapeInfos.sJinfos.B);
     478                (*tiIter)->pTapeInfos.sJinfos.B = NULL;
     479            }
     480            if ((*tiIter)->pTapeInfos.sJinfos.y != NULL)
     481            {
     482                free((*tiIter)->pTapeInfos.sJinfos.y);
     483                (*tiIter)->pTapeInfos.sJinfos.y = NULL;
     484            }
     485
     486            if ((*tiIter)->pTapeInfos.sHinfos.Zppp != NULL)
     487            {
     488                free((char*) **(*tiIter)->pTapeInfos.sHinfos.Zppp);
     489                free((char*)  *(*tiIter)->pTapeInfos.sHinfos.Zppp);
     490                free((char*)   (*tiIter)->pTapeInfos.sHinfos.Zppp);
     491                (*tiIter)->pTapeInfos.sHinfos.Zppp = NULL;
     492            }
     493            if ((*tiIter)->pTapeInfos.sHinfos.Yppp != NULL)
     494            {
     495                free((char*) **(*tiIter)->pTapeInfos.sHinfos.Yppp);
     496                free((char*)  *(*tiIter)->pTapeInfos.sHinfos.Yppp);
     497                free((char*)   (*tiIter)->pTapeInfos.sHinfos.Yppp);
     498                (*tiIter)->pTapeInfos.sHinfos.Yppp = NULL;
     499            }
     500            if ((*tiIter)->pTapeInfos.sHinfos.Xppp != NULL)
     501            {
     502                free((char*) **(*tiIter)->pTapeInfos.sHinfos.Xppp);
     503                free((char*)  *(*tiIter)->pTapeInfos.sHinfos.Xppp);
     504                free((char*)   (*tiIter)->pTapeInfos.sHinfos.Xppp);
     505                (*tiIter)->pTapeInfos.sHinfos.Yppp = NULL;
     506            }
     507            if ((*tiIter)->pTapeInfos.sHinfos.Upp != NULL)
     508            {
     509                free((char*)  *(*tiIter)->pTapeInfos.sHinfos.Upp);
     510                free((char*)   (*tiIter)->pTapeInfos.sHinfos.Upp);
     511                (*tiIter)->pTapeInfos.sHinfos.Upp = NULL;
     512            }
     513            if ((*tiIter)->pTapeInfos.sHinfos.Hcomp != NULL)
     514            {
     515                free((char*)  *(*tiIter)->pTapeInfos.sHinfos.Hcomp);
     516                free((char*)   (*tiIter)->pTapeInfos.sHinfos.Hcomp);
     517                (*tiIter)->pTapeInfos.sHinfos.Hcomp = NULL;
     518            }
     519
    463520            /* remove "main" tape files if not all three have been written */
    464521            int filesWritten = (*tiIter)->stats[OP_FILE_ACCESS] +
  • stable/2.1/ADOL-C/src/tapedoc/tapedoc.c

    r42 r62  
    256256    /****************************************************************************/
    257257    /*                                                            ALL VARIABLES */
    258     ADOLC_OPENMP_THREAD_NUMBER;
    259258    unsigned char operation;
    260259
     
    279278    double val_a[4], cst_d[2];
    280279
     280    ADOLC_OPENMP_THREAD_NUMBER;
    281281    ADOLC_OPENMP_GET_THREAD_NUMBER;
    282282
  • stable/2.1/ADOL-C/src/uni5_for.c

    r42 r62  
    461461int  zos_forward_nk(
    462462#endif
    463     short  tnum,        /* tape id */
    464     int    depcheck,    /* consistency chk on # of deps */
    465     int    indcheck,    /* consistency chk on # of indeps */
     463    short  tnum,              /* tape id */
     464    int    depcheck,          /* consistency chk on # of deps */
     465    int    indcheck,          /* consistency chk on # of indeps */
    466466#if defined(_KEEP_)
    467     int    keep,        /* flag for reverse sweep */
    468 #endif
    469     double *basepoint,  /* independant variable values */
    470     double *valuepoint) /* dependent variable values */
     467    int    keep,              /* flag for reverse sweep */
     468#endif
     469    const double *basepoint,  /* independant variable values */
     470    double       *valuepoint) /* dependent variable values */
    471471
    472472#else
     
    499499/****************************************************************************/
    500500int int_forward_tight(
    501     short             tnum,     /* tape id                              */
    502     int               depcheck, /* consistency chk on # of dependents   */
    503     int               indcheck, /* consistency chk on # of independents */
    504     int               p,        /* # of taylor series, bit pattern      */
    505     double            *basepoint,  /* independent variable values   (in)*/
     501    short               tnum,     /* tape id                              */
     502    int                 depcheck, /* consistency chk on # of dependents   */
     503    int                 indcheck, /* consistency chk on # of independents */
     504    int                 p,        /* # of taylor series, bit pattern      */
     505    const double       *basepoint,  /* independent variable values   (in)*/
    506506    unsigned long int **argument,  /* Taylor coeff.                 (in)*/
    507     double            *valuepoint, /* dependent variable values    (out)*/
     507    double             *valuepoint, /* dependent variable values    (out)*/
    508508    unsigned long int **taylors)   /* matrix of coefficient vectors(out)*/
    509509
     
    558558    int               depcheck,    /* consistency chk on # of dependents   */
    559559    int               indcheck,    /* consistency chk on # of independents */
    560     double            *basepoint,  /* independent variable values   (in)   */
    561     unsigned int     **crs)        /* returned row index storage (out)     */
     560    const double     *basepoint,  /* independent variable values   (in)   */
     561    unsigned int    **crs)        /* returned row index storage (out)     */
    562562
    563563/* indopro_forward_tight( tag, m, n, x[n], *crs[m]),
     
    575575    int               depcheck,    /* consistency chk on # of dependents   */
    576576    int               indcheck,    /* consistency chk on # of independents */
    577     double            *basepoint,  /* independent variable values   (in)   */
    578     unsigned int     **crs)        /* returned row index storage (out)     */
     577    const double     *basepoint,   /* independent variable values   (in)   */
     578    unsigned int    **crs)         /* returned row index storage (out)     */
    579579
    580580/* indopro_forward_safe( tag, m, n, x[n], *crs[m]),
     
    590590int nonl_ind_forward_tight(
    591591    short             tnum,        /* tape id                              */
     592    int               depcheck,    /* consistency chk on # of dependents   */
    592593    int               indcheck,    /* consistency chk on # of independents */
    593     double            *basepoint,  /* independent variable values   (in)   */
     594    const double     *basepoint,  /* independent variable values   (in)   */
    594595    unsigned int     **crs)        /* returned row index storage (out)     */
    595596
     
    597598   
    598599  */
    599 
    600 #define depcheck -1
    601600
    602601#endif
     
    607606int nonl_ind_forward_safe(
    608607    short             tnum,        /* tape id                              */
     608    int               depcheck,    /* consistency chk on # of dependents   */
    609609    int               indcheck,    /* consistency chk on # of independents */
    610     double            *basepoint,  /* independent variable values   (in)   */
    611     unsigned int     **crs)        /* returned row index storage (out)     */
     610    const double      *basepoint,  /* independent variable values   (in)   */
     611    unsigned int    **crs)        /* returned row index storage (out)     */
    612612
    613613/* indopro_forward_safe( tag, m, n, x[n], *crs[m]),
    614614   
    615615  */
    616 #define depcheck -1
    617616#endif
    618617#else
     
    639638/****************************************************************************/
    640639int  fov_forward(
    641     short  tnum,        /* tape id */
    642     int    depcheck,    /* consistency chk on # of deps */
    643     int    indcheck,    /* consistency chk on # of indeps */
    644     int    p,           /* # of taylor series */
    645     double *basepoint,  /* independent variable values */
    646     double **argument,  /* Taylor coefficients (input) */
    647     double *valuepoint, /* Taylor coefficients (output) */
    648     double **taylors)   /* matrix of coifficient vectors */
     640    short         tnum,        /* tape id */
     641    int           depcheck,    /* consistency chk on # of deps */
     642    int           indcheck,    /* consistency chk on # of indeps */
     643    int           p,           /* # of taylor series */
     644    const double *basepoint,   /* independent variable values */
     645    double      **argument,    /* Taylor coefficients (input) */
     646    double       *valuepoint, /* Taylor coefficients (output) */
     647    double      **taylors)     /* matrix of coifficient vectors */
    649648/* the order of the indices in argument and taylors is [var][taylor] */
    650649#endif
     
    706705    /****************************************************************************/
    707706    /*                                                            ALL VARIABLES */
    708     ADOLC_OPENMP_THREAD_NUMBER;
    709707    unsigned char operation;   /* operation code */
    710708    int ret_c =3;              /* return value */
     
    743741#if defined (_INDO_)
    744742    int l=0;
     743    int max_ind_dom;
    745744#if defined(_NONLIND_)
    746745    /* nonlinear interaction domains */
    747746    IndexElement** nonl_dom;
    748747    IndexElement*  temp;
     748    IndexElement*  temp1;
    749749#endif
    750750#endif
     
    874874#endif
    875875
     876    ADOLC_OPENMP_THREAD_NUMBER;
     877
    876878#if defined(ADOLC_DEBUG)
    877879    /****************************************************************************/
     
    908910                " to forward is\ninconsistent with number "
    909911                "recorded on tape (%d, %d) \n", tnum,
     912                depcheck, indcheck,
    910913                ADOLC_CURRENT_TAPE_INFOS.stats[NUM_DEPENDENTS],
    911                 ADOLC_CURRENT_TAPE_INFOS.stats[NUM_INDEPENDENTS],
    912                 depcheck, indcheck);
     914                ADOLC_CURRENT_TAPE_INFOS.stats[NUM_INDEPENDENTS]);
    913915        exit (-1);
    914916    }
     
    920922                " to forward is\ninconsistent with number "
    921923                "recorded on tape (%d, %d) \n", tnum,
     924                1, indcheck,
    922925                ADOLC_CURRENT_TAPE_INFOS.stats[NUM_DEPENDENTS],
    923                 ADOLC_CURRENT_TAPE_INFOS.stats[NUM_INDEPENDENTS],
    924                 1, indcheck);
     926                ADOLC_CURRENT_TAPE_INFOS.stats[NUM_INDEPENDENTS]);
    925927        exit (-1);
    926928    }
    927929#endif
     930
    928931
    929932    /****************************************************************************/
     
    990993    }
    991994
     995    max_ind_dom = ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES];
    992996#if defined(_NONLIND_)
    993997    nonl_dom = (struct IndexElement**) malloc(sizeof(struct IndexElement*) * indcheck);
     
    10591063     
    10601064      switch (operation) {
    1061 
     1065   
    10621066
    10631067                /****************************************************************************/
     
    37023706    end_sweep();
    37033707
    3704 #if defined(_INDO_)
    3705 
    3706     for(i=0;i<ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES];i++)
    3707       free(ind_dom[i]);
     3708
     3709#if defined(_INDO_)
     3710
     3711    for(i=0;i<max_ind_dom;i++)
     3712      {
     3713        free(ind_dom[i]);
     3714      }
    37083715    free(ind_dom);
    37093716
     
    37123719        if (nonl_dom[i] != NULL) {
    37133720            crs[i] = (unsigned int*) malloc(sizeof(unsigned int) * (nonl_dom[i]->entry+1));
     3721            temp1 = nonl_dom[i];
    37143722            temp = nonl_dom[i]->next;
    37153723            crs[i][0] = nonl_dom[i]->entry;
     3724            free(temp1);
    37163725            for(l=1;l<=crs[i][0];l++) {
    37173726                crs[i][l] = temp->entry;
     3727                temp1 = temp;
    37183728                temp = temp->next;
     3729                free(temp1);
    37193730            }
    37203731        } else {
     
    37233734        }
    37243735    }
     3736    free(nonl_dom);
    37253737
    37263738#endif
     
    37793791        {
    37803792          i = 2*(num1+num);
    3781             free(ind_dom[res]);
    3782             ind_dom[res] = (locint *)  malloc(sizeof(locint) * i);
    3783             ind_dom[res][1] = i;
     3793          free(ind_dom[res]);
     3794          ind_dom[res] = (locint *)  malloc(sizeof(locint) * i);
     3795          ind_dom[res][1] = i;
    37843796        }
    37853797        i = 0;
  • stable/2.1/configure

    r43 r62  
    11#! /bin/sh
    2 # From configure.ac Revision: 39 .
     2# From configure.ac Revision: 57 .
    33# Guess values for system-dependent variables and create Makefiles.
    4 # Generated by GNU Autoconf 2.61 for adolc 2.0.0-trunk.
     4# Generated by GNU Autoconf 2.61 for adolc 2.1.1-trunk.
    55#
    66# Report bugs to <adol-c@list.coin-or.org>.
     
    730730PACKAGE_NAME='adolc'
    731731PACKAGE_TARNAME='adolc'
    732 PACKAGE_VERSION='2.0.0-trunk'
    733 PACKAGE_STRING='adolc 2.0.0-trunk'
     732PACKAGE_VERSION='2.1.1-trunk'
     733PACKAGE_STRING='adolc 2.1.1-trunk'
    734734PACKAGE_BUGREPORT='adol-c@list.coin-or.org'
    735735
     
    14061406  # This message is too long to be a string in the A/UX 3.1 sh.
    14071407  cat <<_ACEOF
    1408 \`configure' configures adolc 2.0.0-trunk to adapt to many kinds of systems.
     1408\`configure' configures adolc 2.1.1-trunk to adapt to many kinds of systems.
    14091409
    14101410Usage: $0 [OPTION]... [VAR=VALUE]...
     
    14761476if test -n "$ac_init_help"; then
    14771477  case $ac_init_help in
    1478      short | recursive ) echo "Configuration of adolc 2.0.0-trunk:";;
     1478     short | recursive ) echo "Configuration of adolc 2.1.1-trunk:";;
    14791479   esac
    14801480  cat <<\_ACEOF
     
    16011601if $ac_init_version; then
    16021602  cat <<\_ACEOF
    1603 adolc configure 2.0.0-trunk
     1603adolc configure 2.1.1-trunk
    16041604generated by GNU Autoconf 2.61
    16051605
     
    16151615running configure, to aid debugging if configure makes a mistake.
    16161616
    1617 It was created by adolc $as_me 2.0.0-trunk, which was
     1617It was created by adolc $as_me 2.1.1-trunk, which was
    16181618generated by GNU Autoconf 2.61.  Invocation command line was
    16191619
     
    22582258# Define the identity of the package.
    22592259 PACKAGE='adolc'
    2260  VERSION='2.0.0-trunk'
     2260 VERSION='2.1.1-trunk'
    22612261
    22622262
     
    2023920239
    2024020240
    20241 # Checks for libraries
    20242 
    20243 { echo "$as_me:$LINENO: checking for pow in -lm" >&5
    20244 echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; }
    20245 if test "${ac_cv_lib_m_pow+set}" = set; then
    20246   echo $ECHO_N "(cached) $ECHO_C" >&6
    20247 else
    20248   ac_check_lib_save_LIBS=$LIBS
    20249 LIBS="-lm  $LIBS"
    20250 cat >conftest.$ac_ext <<_ACEOF
    20251 /* confdefs.h.  */
    20252 _ACEOF
    20253 cat confdefs.h >>conftest.$ac_ext
    20254 cat >>conftest.$ac_ext <<_ACEOF
    20255 /* end confdefs.h.  */
    20256 
    20257 /* Override any GCC internal prototype to avoid an error.
    20258    Use char because int might match the return type of a GCC
    20259    builtin and then its argument prototype would still apply.  */
    20260 #ifdef __cplusplus
    20261 extern "C"
    20262 #endif
    20263 char pow ();
    20264 int
    20265 main ()
    20266 {
    20267 return pow ();
    20268   ;
    20269   return 0;
    20270 }
    20271 _ACEOF
    20272 rm -f conftest.$ac_objext conftest$ac_exeext
    20273 if { (ac_try="$ac_link"
    20274 case "(($ac_try" in
    20275   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    20276   *) ac_try_echo=$ac_try;;
    20277 esac
    20278 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    20279   (eval "$ac_link") 2>conftest.er1
    20280   ac_status=$?
    20281   grep -v '^ *+' conftest.er1 >conftest.err
    20282   rm -f conftest.er1
    20283   cat conftest.err >&5
    20284   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    20285   (exit $ac_status); } && {
    20286          test -z "$ac_c_werror_flag" ||
    20287          test ! -s conftest.err
    20288        } && test -s conftest$ac_exeext &&
    20289        $as_test_x conftest$ac_exeext; then
    20290   ac_cv_lib_m_pow=yes
    20291 else
    20292   echo "$as_me: failed program was:" >&5
    20293 sed 's/^/| /' conftest.$ac_ext >&5
    20294 
    20295         ac_cv_lib_m_pow=no
    20296 fi
    20297 
    20298 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    20299       conftest$ac_exeext conftest.$ac_ext
    20300 LIBS=$ac_check_lib_save_LIBS
    20301 fi
    20302 { echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
    20303 echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; }
    20304 if test $ac_cv_lib_m_pow = yes; then
    20305   cat >>confdefs.h <<_ACEOF
    20306 #define HAVE_LIBM 1
    20307 _ACEOF
    20308 
    20309   LIBS="-lm $LIBS"
    20310 
    20311 fi
    20312 
    20313 
    2031420241# checks for header files
    2031520242{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
     
    2073920666
    2074020667
    20741 for ac_header in stddef.h stdlib.h stdio.h string.h sys/timeb.h
     20668
     20669for ac_header in stddef.h stdlib.h stdio.h string.h unistd.h sys/timeb.h
    2074220670do
    2074320671as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    2175921687
    2176021688
     21689# Checks for libraries
     21690
     21691{ echo "$as_me:$LINENO: checking for pow in -lm" >&5
     21692echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; }
     21693if test "${ac_cv_lib_m_pow+set}" = set; then
     21694  echo $ECHO_N "(cached) $ECHO_C" >&6
     21695else
     21696  ac_check_lib_save_LIBS=$LIBS
     21697LIBS="-lm  $LIBS"
     21698cat >conftest.$ac_ext <<_ACEOF
     21699/* confdefs.h.  */
     21700_ACEOF
     21701cat confdefs.h >>conftest.$ac_ext
     21702cat >>conftest.$ac_ext <<_ACEOF
     21703/* end confdefs.h.  */
     21704
     21705/* Override any GCC internal prototype to avoid an error.
     21706   Use char because int might match the return type of a GCC
     21707   builtin and then its argument prototype would still apply.  */
     21708#ifdef __cplusplus
     21709extern "C"
     21710#endif
     21711char pow ();
     21712int
     21713main ()
     21714{
     21715return pow ();
     21716  ;
     21717  return 0;
     21718}
     21719_ACEOF
     21720rm -f conftest.$ac_objext conftest$ac_exeext
     21721if { (ac_try="$ac_link"
     21722case "(($ac_try" in
     21723  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
     21724  *) ac_try_echo=$ac_try;;
     21725esac
     21726eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
     21727  (eval "$ac_link") 2>conftest.er1
     21728  ac_status=$?
     21729  grep -v '^ *+' conftest.er1 >conftest.err
     21730  rm -f conftest.er1
     21731  cat conftest.err >&5
     21732  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     21733  (exit $ac_status); } && {
     21734         test -z "$ac_c_werror_flag" ||
     21735         test ! -s conftest.err
     21736       } && test -s conftest$ac_exeext &&
     21737       $as_test_x conftest$ac_exeext; then
     21738  ac_cv_lib_m_pow=yes
     21739else
     21740  echo "$as_me: failed program was:" >&5
     21741sed 's/^/| /' conftest.$ac_ext >&5
     21742
     21743        ac_cv_lib_m_pow=no
     21744fi
     21745
     21746rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
     21747      conftest$ac_exeext conftest.$ac_ext
     21748LIBS=$ac_check_lib_save_LIBS
     21749fi
     21750{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
     21751echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; }
     21752if test $ac_cv_lib_m_pow = yes; then
     21753  cat >>confdefs.h <<_ACEOF
     21754#define HAVE_LIBM 1
     21755_ACEOF
     21756
     21757  LIBS="-lm $LIBS"
     21758
     21759fi
     21760
     21761
    2176121762# ADOL-C configuration
    2176221763
     
    2176721768
    2176821769cat >>confdefs.h <<\_ACEOF
    21769 #define ADOLC_SUBVERSION 0
     21770#define ADOLC_SUBVERSION 1
    2177021771_ACEOF
    2177121772
    2177221773
    2177321774cat >>confdefs.h <<\_ACEOF
    21774 #define ADOLC_PATCHLEVEL 0
     21775#define ADOLC_PATCHLEVEL 1
    2177521776_ACEOF
    2177621777
     
    2202122022             fi
    2202222023             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
     22024             if test "$GCC" = yes; then
     22025                ac_adolc_cflags="$ac_adolc_cflags -DAD_ERR_FUN=1"
     22026             fi
     22027
    2202322028
    2202422029             { echo "$as_me:$LINENO: result: $ac_adolc_cflags" >&5
     
    2205222057             fi
    2205322058             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
     22059             if test "$GCC" = yes; then
     22060                ac_adolc_cxxflags="$ac_adolc_cxxflags -DAD_ERR_FUN=1"
     22061             fi
    2205422062
    2205522063             { echo "$as_me:$LINENO: result: $ac_adolc_cxxflags" >&5
    2205622064echo "${ECHO_T}$ac_adolc_cxxflags" >&6; }
    2205722065fi
     22066
     22067
     22068###########################################################################
     22069#                      COIN_PATCH_LIBTOOL_CYGWIN                          #
     22070###########################################################################
     22071
     22072# Patches to libtool for cygwin. Lots for cl, a few for GCC.
     22073# For cl:
     22074# - cygpath is not correctly quoted in fix_srcfile_path
     22075# - paths generated for .lib files is not run through cygpath -w
     22076
     22077
     22078 # COIN_PATCH_LIBTOOL_CYGWIN
    2205822079
    2205922080
     
    2250722528# values after options handling.
    2250822529ac_log="
    22509 This file was extended by adolc $as_me 2.0.0-trunk, which was
     22530This file was extended by adolc $as_me 2.1.1-trunk, which was
    2251022531generated by GNU Autoconf 2.61.  Invocation command line was
    2251122532
     
    2256022581cat >>$CONFIG_STATUS <<_ACEOF
    2256122582ac_cs_version="\\
    22562 adolc config.status 2.0.0-trunk
     22583adolc config.status 2.1.1-trunk
    2256322584configured by $0, generated by GNU Autoconf 2.61,
    2256422585  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
     
    2352023541
    2352123542
     23543#call libtool for cygwin
     23544 case "$CXX" in
     23545    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
     23546      { echo "$as_me:$LINENO: Applying patches to libtool for cl compiler" >&5
     23547echo "$as_me: Applying patches to libtool for cl compiler" >&6;}
     23548      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     23549          -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     23550          -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
     23551          -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
     23552          -e 's%lib /OUT:%lib -OUT:%' \
     23553          -e "s%cygpath -w%$CYGPATH_W%" \
     23554          -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo '"$mydos2unix"'\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
     23555          -e 's/$AR t/lib -nologo -list/' \
     23556          -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
     23557          -e 's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
     23558          -e 's%old_archive_cmds="lib -OUT:\\$oldlib\\$oldobjs\\$old_deplibs"%old_archive_cmds="if test -r \\$oldlib; then bla=\\"\\$oldlib\\"; else bla=; fi; lib -OUT:\\$oldlib \\\\\\$bla\\$oldobjs\\$old_deplibs"%' \
     23559      libtool > conftest.bla
     23560
     23561      mv conftest.bla libtool
     23562      chmod 755 libtool
     23563      ;;
     23564    *)
     23565      { echo "$as_me:$LINENO: Applying patches to libtool for GNU compiler" >&5
     23566echo "$as_me: Applying patches to libtool for GNU compiler" >&6;}
     23567      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     23568          -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
     23569          -e 's|libext="lib"|libext="a"|' \
     23570      libtool > conftest.bla
     23571
     23572      mv conftest.bla libtool
     23573      chmod 755 libtool
     23574      ;;
     23575  esac
     23576
    2352223577# echo configuration
    2352323578echo \
  • stable/2.1/configure.ac

    r43 r62  
    44#
    55# Copyright (C) Andrea Walther, Andreas Kowarz
     6#               
     7# contains patches from the COIN OR libtool
    68#
    79##############################################################################
    810define([ADOLC_VER], [2])
    9 define([ADOLC_SUB], [0])
    10 define([ADOLC_LVL], [0])
     11define([ADOLC_SUB], [1])
     12define([ADOLC_LVL], [1])
    1113
    1214AC_PREREQ(2.57)
     
    4345AC_PROG_LIBTOOL
    4446
    45 # Checks for libraries
    46 AC_CHECK_LIB([m], [pow])
    47 
    4847# checks for header files
    4948AC_HEADER_STDC
    5049AC_HEADER_TIME
    5150AC_HEADER_STDBOOL
    52 AC_CHECK_HEADERS([stddef.h stdlib.h stdio.h string.h sys/timeb.h])
     51AC_CHECK_HEADERS([stddef.h stdlib.h stdio.h string.h unistd.h sys/timeb.h])
    5352
    5453# checks for types
     
    6564# substitutions
    6665AC_SUBST(ac_aux_dir)
     66
     67# Checks for libraries
     68AC_CHECK_LIB([m], [pow])
    6769
    6870# ADOL-C configuration
     
    200202             fi
    201203             ac_adolc_cflags="$ac_adolc_cflags $ac_adolc_openmpflag"
     204             if test "$GCC" = yes; then
     205                ac_adolc_cflags="$ac_adolc_cflags -DAD_ERR_FUN=1"
     206             fi
     207
    202208             AC_SUBST(ac_adolc_cflags)
    203209             AC_MSG_RESULT($ac_adolc_cflags)])
     
    225231             fi
    226232             ac_adolc_cxxflags="$ac_adolc_cxxflags $ac_adolc_openmpflag"
     233             if test "$GCC" = yes; then
     234                ac_adolc_cxxflags="$ac_adolc_cxxflags -DAD_ERR_FUN=1"
     235             fi
    227236             AC_SUBST(ac_adolc_cxxflags)
    228237             AC_MSG_RESULT($ac_adolc_cxxflags)])
     238
     239###########################################################################
     240#                      COIN_PATCH_LIBTOOL_CYGWIN                          #
     241###########################################################################
     242
     243# Patches to libtool for cygwin. Lots for cl, a few for GCC.
     244# For cl:
     245# - cygpath is not correctly quoted in fix_srcfile_path
     246# - paths generated for .lib files is not run through cygpath -w
     247
     248
     249AC_DEFUN([AC_COIN_PATCH_LIBTOOL_CYGWIN],
     250[ case "$CXX" in
     251    cl* | */cl* | CL* | */CL* | icl* | */icl* | ICL* | */ICL*)
     252      AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
     253      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     254          -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     255          -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
     256          -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
     257          -e 's%lib /OUT:%lib -OUT:%' \
     258          -e "s%cygpath -w%$CYGPATH_W%" \
     259          -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo '"$mydos2unix"'\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
     260          -e 's/$AR t/lib -nologo -list/' \
     261          -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
     262          -e 's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
     263          -e 's%old_archive_cmds="lib -OUT:\\$oldlib\\$oldobjs\\$old_deplibs"%old_archive_cmds="if test -r \\$oldlib; then bla=\\"\\$oldlib\\"; else bla=; fi; lib -OUT:\\$oldlib \\\\\\$bla\\$oldobjs\\$old_deplibs"%' \
     264      libtool > conftest.bla
     265
     266      mv conftest.bla libtool
     267      chmod 755 libtool
     268      ;;
     269    *)
     270      AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
     271      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     272          -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
     273          -e 's|libext="lib"|libext="a"|' \
     274      libtool > conftest.bla
     275
     276      mv conftest.bla libtool
     277      chmod 755 libtool
     278      ;;
     279  esac ]) # COIN_PATCH_LIBTOOL_CYGWIN
     280
    229281
    230282# output
     
    258310AC_OUTPUT
    259311
     312#call libtool for cygwin
     313AC_COIN_PATCH_LIBTOOL_CYGWIN
     314
    260315# echo configuration
    261316echo \
Note: See TracChangeset for help on using the changeset viewer.