Changeset 441


Ignore:
Timestamp:
Aug 16, 2005 12:13:04 AM (14 years ago)
Author:
andreasw
Message:
  • configure: automatically detect compilers and their options
  • added SolveStatistics?
  • ran astyle in Interfaces (was not enabled in root Makefile)
Location:
branches/dev
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/Algorithm/Makefile.am

    r430 r441  
    1 # Copyright (C) 2004, International Business Machines and others.
     1# Copyright (C) 2004, 2005 International Business Machines and others.
    22# All Rights Reserved.
    33# This file is distributed under the Common Public License.
     
    1010
    1111SUBDIRS = LinearSolvers
    12 
    13 includeipoptdir = $(includedir)/ipopt
    14 includeipopt_HEADERS = \
    15         IpIpoptCalculatedQuantities.hpp \
    16         IpIpoptData.hpp \
    17         IpIpoptNLP.hpp \
    18         IpIteratesVector.hpp \
    19         IpNLPScaling.hpp
    2012
    2113noinst_LIBRARIES = libipoptalg.a
  • branches/dev/Algorithm/Makefile.in

    r438 r441  
    1515@SET_MAKE@
    1616
    17 # Copyright (C) 2004, International Business Machines and others.
     17# Copyright (C) 2004, 2005 International Business Machines and others.
    1818# All Rights Reserved.
    1919# This file is distributed under the Common Public License.
    2020
    2121# Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
    22 
    2322
    2423SOURCES = $(libipoptalg_a_SOURCES)
     
    4645build_triplet = @build@
    4746subdir = Algorithm
    48 DIST_COMMON = $(includeipopt_HEADERS) $(srcdir)/Makefile.am \
    49         $(srcdir)/Makefile.in
     47DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    5048ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    5149am__aclocal_m4_deps = $(top_srcdir)/configure.ac
     
    9795        pdf-recursive ps-recursive uninstall-info-recursive \
    9896        uninstall-recursive
    99 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    100 am__vpath_adj = case $$p in \
    101     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    102     *) f=$$p;; \
    103   esac;
    104 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
    105 am__installdirs = "$(DESTDIR)$(includeipoptdir)"
    106 includeipoptHEADERS_INSTALL = $(INSTALL_HEADER)
    107 HEADERS = $(includeipopt_HEADERS)
    10897ETAGS = etags
    10998CTAGS = ctags
     
    239228AUTOMAKE_OPTIONS = foreign
    240229SUBDIRS = LinearSolvers
    241 includeipoptdir = $(includedir)/ipopt
    242 includeipopt_HEADERS = \
    243         IpIpoptCalculatedQuantities.hpp \
    244         IpIpoptData.hpp \
    245         IpIpoptNLP.hpp \
    246         IpIteratesVector.hpp \
    247         IpNLPScaling.hpp
    248 
    249230noinst_LIBRARIES = libipoptalg.a
    250231libipoptalg_a_SOURCES = \
     
    435416@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
    436417uninstall-info-am:
    437 install-includeipoptHEADERS: $(includeipopt_HEADERS)
    438         @$(NORMAL_INSTALL)
    439         test -z "$(includeipoptdir)" || $(mkdir_p) "$(DESTDIR)$(includeipoptdir)"
    440         @list='$(includeipopt_HEADERS)'; for p in $$list; do \
    441           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
    442           f=$(am__strip_dir) \
    443           echo " $(includeipoptHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includeipoptdir)/$$f'"; \
    444           $(includeipoptHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includeipoptdir)/$$f"; \
    445         done
    446 
    447 uninstall-includeipoptHEADERS:
    448         @$(NORMAL_UNINSTALL)
    449         @list='$(includeipopt_HEADERS)'; for p in $$list; do \
    450           f=$(am__strip_dir) \
    451           echo " rm -f '$(DESTDIR)$(includeipoptdir)/$$f'"; \
    452           rm -f "$(DESTDIR)$(includeipoptdir)/$$f"; \
    453         done
    454418
    455419# This directory's subdirectories are mostly independent; you can cd
     
    629593check-am: all-am
    630594check: check-recursive
    631 all-am: Makefile $(LIBRARIES) $(HEADERS)
     595all-am: Makefile $(LIBRARIES)
    632596installdirs: installdirs-recursive
    633597installdirs-am:
    634         for dir in "$(DESTDIR)$(includeipoptdir)"; do \
    635           test -z "$$dir" || $(mkdir_p) "$$dir"; \
    636         done
    637598install: install-recursive
    638599install-exec: install-exec-recursive
     
    680641info-am:
    681642
    682 install-data-am: install-includeipoptHEADERS
     643install-data-am:
    683644
    684645install-exec-am:
     
    707668ps-am:
    708669
    709 uninstall-am: uninstall-includeipoptHEADERS uninstall-info-am
     670uninstall-am: uninstall-info-am
    710671
    711672uninstall-info: uninstall-info-recursive
     
    717678        dvi dvi-am html html-am info info-am install install-am \
    718679        install-data install-data-am install-exec install-exec-am \
    719         install-includeipoptHEADERS install-info install-info-am \
    720         install-man install-strip installcheck installcheck-am \
    721         installdirs installdirs-am maintainer-clean \
    722         maintainer-clean-generic maintainer-clean-recursive \
    723         mostlyclean mostlyclean-compile mostlyclean-generic \
    724         mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
    725         uninstall uninstall-am uninstall-includeipoptHEADERS \
    726         uninstall-info-am
     680        install-info install-info-am install-man install-strip \
     681        installcheck installcheck-am installdirs installdirs-am \
     682        maintainer-clean maintainer-clean-generic \
     683        maintainer-clean-recursive mostlyclean mostlyclean-compile \
     684        mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
     685        tags tags-recursive uninstall uninstall-am uninstall-info-am
    727686
    728687
  • branches/dev/Examples/Cpp_example/cpp_example.cpp

    r419 r441  
    1 // Copyright (C) 2004, International Business Machines and others.
     1// Copyright (C) 2004 2005 International Business Machines and others.
    22// All Rights Reserved.
    33// This code is published under the Common Public License.
     
    99#include "IpIpoptApplication.hpp"
    1010#include "MyNLP.hpp"
    11 #include "IpIpoptData.hpp"
    12 #include "IpIpoptCalculatedQuantities.hpp"
    1311
    1412using namespace Ipopt;
     
    2220  SmartPtr<IpoptApplication> app = new IpoptApplication();
    2321
    24   // To illustrate the use of ip_data and ip_cq, we will use the
    25   //  version of OptimzeTNLP that returns pointers to these objects
    26   // Usually, the standard IpoptApplication output is sufficient
    27   //  and you would only need to call OptimizeTNLP(mynlp);
    28   SmartPtr<IpoptData> ip_data = NULL;
    29   SmartPtr<IpoptCalculatedQuantities> ip_cq = NULL;
    30   ApplicationReturnStatus status = app->OptimizeTNLP(mynlp, ip_data, ip_cq);
     22  ApplicationReturnStatus status = app->OptimizeTNLP(mynlp);
    3123
    3224  if (status == Solve_Succeeded) {
    33     // Retrieve some information from ip_data
    34     printf("\n\n*** The problem solved in %d iterations!\n", ip_data->iter_count());
    35     // Retrieve some information from ip_cq
    36     printf("\n\n*** The current value of the objective function is %g.\n", ip_cq->curr_f());
     25    // Retrieve some statistics about the solve
     26    Index iter_count = app->Statistics()->IterationCount();
     27    printf("\n\n*** The problem solved in %d iterations!\n", iter_count);
     28
     29    Number final_obj = app->Statistics()->FinalObjective();
     30    printf("\n\n*** The final value of the objective function is %e.\n", final_obj);
    3731  }
    3832
  • branches/dev/Interfaces/IpAlgTypes.hpp

    r425 r441  
    2626    STOP_AT_ACCEPTABLE_POINT,
    2727    LOCAL_INFEASIBILITY,
    28     RESTORATION_FAILURE
     28    RESTORATION_FAILURE,
     29    INTERNAL_ERROR
    2930  };
    3031  //@}
  • branches/dev/Interfaces/IpIpoptApplication.cpp

    r433 r441  
    2323  DefineOptionsRegistrar(IpoptApplication);
    2424
    25   IpoptApplication::IpoptApplication(bool read_params_dat, bool create_console_out)
     25  IpoptApplication::IpoptApplication(bool read_params_dat,
     26                                     bool create_console_out)
    2627      :
    2728      jnlst_(new Journalist()),
    28       options_(new OptionsList())
     29      options_(new OptionsList()),
     30      statistics_(NULL)
    2931  {
    3032# ifdef IP_DEBUG
     
    6466
    6567    Index ivalue;
    66     EJournalLevel print_level;
     68    options_->GetIntegerValue("print_level", ivalue, "");
     69    EJournalLevel print_level = (EJournalLevel)ivalue;
    6770    if (create_console_out) {
    6871      // Set printlevel for stdout
    69       options_->GetIntegerValue("print_level", ivalue, "");
    70       print_level = (EJournalLevel)ivalue;
    7172      stdout_jrnl->SetAllPrintLevels(print_level);
    7273      stdout_jrnl->SetPrintLevel(J_DBG, J_NONE);
     
    187188
    188189  ApplicationReturnStatus
    189   IpoptApplication::OptimizeTNLP(const SmartPtr<TNLP>& nlp,
    190                                  SmartPtr<IpoptData>& ip_data,
    191                                  SmartPtr<IpoptCalculatedQuantities>& ip_cq)
    192   {
    193     SmartPtr<NLP> nlp_adapter =
    194       new TNLPAdapter(GetRawPtr(nlp));
    195 
    196     return OptimizeNLP(nlp_adapter, ip_data, ip_cq);
    197   }
    198 
    199   ApplicationReturnStatus IpoptApplication::OptimizeNLP(const SmartPtr<NLP>& nlp)
    200   {
    201     SmartPtr<IpoptData> ip_data = NULL;
    202     SmartPtr<IpoptCalculatedQuantities> ip_cq = NULL;
    203 
    204     return OptimizeNLP(nlp, ip_data, ip_cq);
    205 
    206   }
    207 
    208   ApplicationReturnStatus
    209   IpoptApplication::OptimizeNLP(const SmartPtr<NLP>& nlp,
    210                                 SmartPtr<IpoptData>& ip_data,
    211                                 SmartPtr<IpoptCalculatedQuantities>& ip_cq)
    212   {
     190  IpoptApplication::OptimizeNLP(const SmartPtr<NLP>& nlp)
     191  {
     192    statistics_ = NULL; /* delete old statistics */
    213193    ApplicationReturnStatus retValue = Internal_Error;
     194    SmartPtr<IpoptData> ip_data;
     195    SmartPtr<IpoptCalculatedQuantities> ip_cq;
    214196    SmartPtr<IpoptNLP> ip_nlp;
    215197    try {
     
    286268                     ip_nlp->f_evals());
    287269      jnlst_->Printf(J_SUMMARY, J_STATISTICS,
     270                     "Number of objective gradient evaluations             = %d\n",
     271                     ip_nlp->grad_f_evals());
     272      jnlst_->Printf(J_SUMMARY, J_STATISTICS,
    288273                     "Number of equality constraint evaluations            = %d\n",
    289274                     ip_nlp->c_evals());
     
    329314        retValue = Internal_Error;
    330315        jnlst_->Printf(J_SUMMARY, J_MAIN, "\nEXIT: INTERNAL ERROR: Unknown SolverReturn value - Notify IPOPT Authors.\n");
    331         return retValue;
     316        return retValue;
    332317      }
    333318      ip_nlp->FinalizeSolution(status,
     
    335320                               *ip_cq->curr_c(), *ip_cq->curr_d(), *ip_data->curr()->y_c(), *ip_data->curr()->y_d(),
    336321                               ip_cq->curr_f());
     322      // Create a SolveStatistics object
     323      statistics_ = new SolveStatistics(ip_nlp, ip_data, ip_cq);
    337324    }
    338325    catch(TOO_FEW_DOF& exc) {
     
    365352
    366353  bool IpoptApplication::OpenOutputFile(std::string file_name,
    367                                         EJournalLevel print_level)
     354                                        EJournalLevel print_level)
    368355  {
    369356    SmartPtr<Journal> file_jrnl = jnlst_->AddFileJournal("OutputFile:"+file_name,
    370                                                         file_name.c_str(),
    371                                                         print_level);
     357                                  file_name.c_str(),
     358                                  print_level);
    372359    file_jrnl->SetPrintLevel(J_DBG, J_NONE);
    373360
  • branches/dev/Interfaces/IpIpoptApplication.hpp

    r436 r441  
    1 // Copyright (C) 2004, International Business Machines and others.
     1// Copyright (C) 2004, 2005 International Business Machines and others.
    22// All Rights Reserved.
    33// This code is published under the Common Public License.
     
    1414#include "IpRegOptions.hpp"
    1515#include "IpOptionsList.hpp"
     16#include "IpSolveStatistics.hpp"
    1617
    1718namespace Ipopt
    1819{
     20  /* Forward declaration */
     21  class NLP;
     22
    1923  /* Return codes for the Optimize call for an application */
    2024#include "IpReturnCodes_inc.h"
     
    2226  DeclareOptionsRegistrar(IpoptApplication);
    2327
    24   /* forward declarations */
    25   class IpoptData;
    26   class IpoptCalculatedQuantities;
    27   class NLP;
    28 
    29   /** This is the main application class for making calls
    30   *     to Ipopt. */
     28  /** This is the main application class for making calls to Ipopt. */
    3129  class IpoptApplication : public ReferencedObject
    3230  {
     
    4139    ApplicationReturnStatus OptimizeTNLP(const SmartPtr<TNLP>& nlp);
    4240
    43     /** Solve a problem that inherits from TNLP
    44      *   use this method when you want access to ip_data and ip_cq after the solve
    45      */
    46     ApplicationReturnStatus OptimizeTNLP(const SmartPtr<TNLP>& nlp,
    47                                          SmartPtr<IpoptData>& ip_data,
    48                                          SmartPtr<IpoptCalculatedQuantities>& ip_cq);
    49 
    5041    /** Solve a problem that inherits from NLP */
    5142    ApplicationReturnStatus OptimizeNLP(const SmartPtr<NLP>& nlp);
    52 
    53     /** Solve a problem that inherits from NLP
    54      *   use this method when you want access to ip_data and ip_cq after the solve
    55      */
    56     ApplicationReturnStatus OptimizeNLP(const SmartPtr<NLP>& nlp,
    57                                         SmartPtr<IpoptData>& ip_data,
    58                                         SmartPtr<IpoptCalculatedQuantities>& ip_cq);
    5943    //@}
    6044
     
    7559    {
    7660      return options_;
     61    }
     62
     63    /** Get the object with the statistics about the most recent
     64     *  optimization run. */
     65    SmartPtr<SolveStatistics> Statistics()
     66    {
     67      return statistics_;
    7768    }
    7869    //@}
     
    113104    /** OptionsList used for the application */
    114105    SmartPtr<OptionsList> options_;
     106
     107    /** Object for storing statistics about the most recent
     108     *  optimization run. */
     109    SmartPtr<SolveStatistics> statistics_;
    115110  };
    116111
  • branches/dev/Interfaces/IpStdCInterface.cpp

    r438 r441  
    2222#endif
    2323
    24 struct IpoptProblemInfo {
     24struct IpoptProblemInfo
     25{
    2526  Index n;
    2627  Number* x_L;
     
    4041
    4142IpoptProblem CreateIpoptProblem(
    42     Index n,
    43     Number* x_L,
    44     Number* x_U,
    45     Index m,
    46     Number* g_L,
    47     Number* g_U,
    48     Index nele_jac,
    49     Index nele_hess,
    50     Eval_F_CB eval_f,
    51     Eval_G_CB eval_g,
    52     Eval_Grad_F_CB eval_grad_f,
    53     Eval_Jac_G_CB eval_jac_g,
    54     Eval_H_CB eval_h)
     43  Index n,
     44  Number* x_L,
     45  Number* x_U,
     46  Index m,
     47  Number* g_L,
     48  Number* g_U,
     49  Index nele_jac,
     50  Index nele_hess,
     51  Eval_F_CB eval_f,
     52  Eval_G_CB eval_g,
     53  Eval_Grad_F_CB eval_grad_f,
     54  Eval_Jac_G_CB eval_jac_g,
     55  Eval_H_CB eval_h)
    5556{
    5657  // make sure input is Ok
     
    139140
    140141Bool OpenIpoptOutputFile(IpoptProblem ipopt_problem, char* file_name,
    141                         Int print_level)
     142                        Int print_level)
    142143{
    143144  std::string name(file_name);
     
    147148
    148149enum ApplicationReturnStatus IpoptSolve(
    149     IpoptProblem ipopt_problem,
    150     Number* x,
    151     Number* g,
    152     Number* obj_val,
    153     Number* mult_g,
    154     Number* mult_x_L,
    155     Number* mult_x_U,
    156     UserDataPtr user_data)
     150  IpoptProblem ipopt_problem,
     151  Number* x,
     152  Number* g,
     153  Number* obj_val,
     154  Number* mult_g,
     155  Number* mult_x_L,
     156  Number* mult_x_U,
     157  UserDataPtr user_data)
    157158{
    158159  using namespace Ipopt;
     
    171172  try {
    172173    tnlp = new StdInterfaceTNLP(ipopt_problem->n, ipopt_problem->x_L,
    173                                 ipopt_problem->x_U, ipopt_problem->m,
    174                                 ipopt_problem->g_L, ipopt_problem->g_U,
    175                                 ipopt_problem->nele_jac,
    176                                 ipopt_problem->nele_hess,
    177                                 start_x, NULL, NULL, NULL,
    178                                 ipopt_problem->eval_f, ipopt_problem->eval_g,
    179                                 ipopt_problem->eval_grad_f,
    180                                 ipopt_problem->eval_jac_g,
    181                                 ipopt_problem->eval_h,
    182                                 x, mult_x_L, mult_x_U, g, mult_g,
    183                                 obj_val, user_data);
     174                                ipopt_problem->x_U, ipopt_problem->m,
     175                                ipopt_problem->g_L, ipopt_problem->g_U,
     176                                ipopt_problem->nele_jac,
     177                                ipopt_problem->nele_hess,
     178                                start_x, NULL, NULL, NULL,
     179                                ipopt_problem->eval_f, ipopt_problem->eval_g,
     180                                ipopt_problem->eval_grad_f,
     181                                ipopt_problem->eval_jac_g,
     182                                ipopt_problem->eval_h,
     183                                x, mult_x_L, mult_x_U, g, mult_g,
     184                                obj_val, user_data);
    184185  }
    185186  catch(INVALID_STDINTERFACE_NLP& exc) {
  • branches/dev/Interfaces/IpTNLPAdapter.cpp

    r433 r441  
    846846    ResortG(y_c, y_d, full_lambda_);
    847847
    848     const DenseVector* dc = dynamic_cast<const DenseVector*>(&c);
    849     const DenseVector* dd = dynamic_cast<const DenseVector*>(&d);
    850     DBG_ASSERT(dc && dd);
    851848    Number* full_g = new Number[n_full_g_];
    852849    ResortG(c, d, full_g);
  • branches/dev/Interfaces/Makefile.am

    r438 r441  
    1717        IpReturnCodes_inc.h \
    1818        IpReturnCodes.inc \
     19        IpSolveStatistics.hpp \
    1920        IpStdCInterface.h \
    2021        IpTNLP.hpp
     
    2728        IpNLP.hpp \
    2829        IpReturnCodes.h \
     30        IpSolveStatistics.cpp IpSolveStatistics.hpp \
    2931        IpStdCInterface.cpp IpStdCInterface.h \
    3032        IpStdFInterface.c \
     
    4648        IpIpoptApplication.cppbak IpIpoptApplication.hppbak \
    4749        IpNLP.hppbak \
     50        IpSolveStatistics.cppbak IpSolveStatistics.hppbak \
    4851        IpStdCInterface.cppbak \
    4952        IpStdInterfaceTNLP.cppbak IpStdInterfaceTNLP.hppbak \
  • branches/dev/Interfaces/Makefile.in

    r438 r441  
    5959libinterfaces_a_LIBADD =
    6060am_libinterfaces_a_OBJECTS = IpIpoptApplication.$(OBJEXT) \
    61         IpStdCInterface.$(OBJEXT) IpStdFInterface.$(OBJEXT) \
    62         IpStdInterfaceTNLP.$(OBJEXT) IpTNLPAdapter.$(OBJEXT)
     61        IpSolveStatistics.$(OBJEXT) IpStdCInterface.$(OBJEXT) \
     62        IpStdFInterface.$(OBJEXT) IpStdInterfaceTNLP.$(OBJEXT) \
     63        IpTNLPAdapter.$(OBJEXT)
    6364libinterfaces_a_OBJECTS = $(am_libinterfaces_a_OBJECTS)
    6465DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/inc
     
    223224        IpReturnCodes_inc.h \
    224225        IpReturnCodes.inc \
     226        IpSolveStatistics.hpp \
    225227        IpStdCInterface.h \
    226228        IpTNLP.hpp
     
    232234        IpNLP.hpp \
    233235        IpReturnCodes.h \
     236        IpSolveStatistics.cpp IpSolveStatistics.hpp \
    234237        IpStdCInterface.cpp IpStdCInterface.h \
    235238        IpStdFInterface.c \
     
    244247        IpIpoptApplication.cppbak IpIpoptApplication.hppbak \
    245248        IpNLP.hppbak \
     249        IpSolveStatistics.cppbak IpSolveStatistics.hppbak \
    246250        IpStdCInterface.cppbak \
    247251        IpStdInterfaceTNLP.cppbak IpStdInterfaceTNLP.hppbak \
     
    299303
    300304@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpIpoptApplication.Po@am__quote@
     305@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpSolveStatistics.Po@am__quote@
    301306@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpStdCInterface.Po@am__quote@
    302307@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IpStdFInterface.Po@am__quote@
  • branches/dev/LinAlg/Makefile.am

    r430 r441  
    1313includeipoptdir = $(includedir)/ipopt
    1414includeipopt_HEADERS = \
    15         IpCompoundVector.hpp \
    1615        IpMatrix.hpp \
    17         IpScaledMatrix.hpp \
    1816        IpSymMatrix.hpp \
    19         IpSymScaledMatrix.hpp \
    2017        IpVector.hpp
    2118
  • branches/dev/LinAlg/Makefile.in

    r438 r441  
    229229includeipoptdir = $(includedir)/ipopt
    230230includeipopt_HEADERS = \
    231         IpCompoundVector.hpp \
    232231        IpMatrix.hpp \
    233         IpScaledMatrix.hpp \
    234232        IpSymMatrix.hpp \
    235         IpSymScaledMatrix.hpp \
    236233        IpVector.hpp
    237234
  • branches/dev/Makefile.am

    r435 r441  
    5656        cd LinAlg; $(MAKE) astyle
    5757        cd LinAlg/TMatrices; $(MAKE) astyle
     58        cd Interfaces; $(MAKE) astyle
    5859
  • branches/dev/Makefile.in

    r438 r441  
    677677        cd LinAlg; $(MAKE) astyle
    678678        cd LinAlg/TMatrices; $(MAKE) astyle
     679        cd Interfaces; $(MAKE) astyle
    679680# Tell versions [3.59,3.63) of GNU make to not export all variables.
    680681# Otherwise a system limit (for SysV at least) may be exceeded.
  • branches/dev/configure

    r438 r441  
    320320#endif"
    321321
    322 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os AR ARFLAGS AR_X CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX RANLIB ac_ct_RANLIB LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CXXCPP EGREP F77 FFLAGS ac_ct_F77 FLIBS IPADDLIBS TAUCS_INCFLAGS ASLMAKEFLAGS ASLMAKEFILECMDS CXXLIBS ASTYLE ASTYLEFLAGS ipoptlib AMPL_CPPFLAGS IPALLLIBS BUILDBLAS_TRUE BUILDBLAS_FALSE BUILDHSL_TRUE BUILDHSL_FALSE BUILDMA27_TRUE BUILDMA27_FALSE BUILDMC19_TRUE BUILDMC19_FALSE BUILDBLASDIR_TRUE BUILDBLASDIR_FALSE BUILDHSLDIR_TRUE BUILDHSLDIR_FALSE HAVE_PARDISO_TRUE HAVE_PARDISO_FALSE HAVE_TAUCS_TRUE HAVE_TAUCS_FALSE BUILDASLDIR_TRUE BUILDASLDIR_FALSE BUILDAMPLINTERFACE_TRUE BUILDAMPLINTERFACE_FALSE ASLLIB LIBOBJS LTLIBOBJS'
     322ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os AR ARFLAGS AR_X CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CXXLIBS CC CFLAGS ac_ct_CC F77 FFLAGS ac_ct_F77 FLIBS RANLIB ac_ct_RANLIB LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CXXCPP EGREP IPADDLIBS TAUCS_INCFLAGS ASLMAKEFLAGS ASLMAKEFILECMDS ASTYLE ASTYLEFLAGS ipoptlib AMPL_CPPFLAGS IPALLLIBS BUILDBLAS_TRUE BUILDBLAS_FALSE BUILDHSL_TRUE BUILDHSL_FALSE BUILDMA27_TRUE BUILDMA27_FALSE BUILDMC19_TRUE BUILDMC19_FALSE BUILDBLASDIR_TRUE BUILDBLASDIR_FALSE BUILDHSLDIR_TRUE BUILDHSLDIR_FALSE HAVE_PARDISO_TRUE HAVE_PARDISO_FALSE HAVE_TAUCS_TRUE HAVE_TAUCS_FALSE BUILDASLDIR_TRUE BUILDASLDIR_FALSE BUILDAMPLINTERFACE_TRUE BUILDAMPLINTERFACE_FALSE ASLLIB LIBOBJS LTLIBOBJS'
    323323ac_subst_files=''
    324324
     
    773773ac_cv_env_AR_X_set=${AR_X+set}
    774774ac_cv_env_AR_X_value=$AR_X
     775ac_env_CXX_set=${CXX+set}
     776ac_env_CXX_value=$CXX
     777ac_cv_env_CXX_set=${CXX+set}
     778ac_cv_env_CXX_value=$CXX
     779ac_env_CXXFLAGS_set=${CXXFLAGS+set}
     780ac_env_CXXFLAGS_value=$CXXFLAGS
     781ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
     782ac_cv_env_CXXFLAGS_value=$CXXFLAGS
     783ac_env_LDFLAGS_set=${LDFLAGS+set}
     784ac_env_LDFLAGS_value=$LDFLAGS
     785ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
     786ac_cv_env_LDFLAGS_value=$LDFLAGS
     787ac_env_CPPFLAGS_set=${CPPFLAGS+set}
     788ac_env_CPPFLAGS_value=$CPPFLAGS
     789ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
     790ac_cv_env_CPPFLAGS_value=$CPPFLAGS
     791ac_env_CXXLIBS_set=${CXXLIBS+set}
     792ac_env_CXXLIBS_value=$CXXLIBS
     793ac_cv_env_CXXLIBS_set=${CXXLIBS+set}
     794ac_cv_env_CXXLIBS_value=$CXXLIBS
    775795ac_env_CC_set=${CC+set}
    776796ac_env_CC_value=$CC
     
    781801ac_cv_env_CFLAGS_set=${CFLAGS+set}
    782802ac_cv_env_CFLAGS_value=$CFLAGS
    783 ac_env_LDFLAGS_set=${LDFLAGS+set}
    784 ac_env_LDFLAGS_value=$LDFLAGS
    785 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
    786 ac_cv_env_LDFLAGS_value=$LDFLAGS
    787 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
    788 ac_env_CPPFLAGS_value=$CPPFLAGS
    789 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
    790 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
    791 ac_env_CXX_set=${CXX+set}
    792 ac_env_CXX_value=$CXX
    793 ac_cv_env_CXX_set=${CXX+set}
    794 ac_cv_env_CXX_value=$CXX
    795 ac_env_CXXFLAGS_set=${CXXFLAGS+set}
    796 ac_env_CXXFLAGS_value=$CXXFLAGS
    797 ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
    798 ac_cv_env_CXXFLAGS_value=$CXXFLAGS
    799 ac_env_CXXCPP_set=${CXXCPP+set}
    800 ac_env_CXXCPP_value=$CXXCPP
    801 ac_cv_env_CXXCPP_set=${CXXCPP+set}
    802 ac_cv_env_CXXCPP_value=$CXXCPP
    803803ac_env_F77_set=${F77+set}
    804804ac_env_F77_value=$F77
     
    809809ac_cv_env_FFLAGS_set=${FFLAGS+set}
    810810ac_cv_env_FFLAGS_value=$FFLAGS
     811ac_env_CXXCPP_set=${CXXCPP+set}
     812ac_env_CXXCPP_value=$CXXCPP
     813ac_cv_env_CXXCPP_set=${CXXCPP+set}
     814ac_cv_env_CXXCPP_value=$CXXCPP
    811815ac_env_TAUCS_INCFLAGS_set=${TAUCS_INCFLAGS+set}
    812816ac_env_TAUCS_INCFLAGS_value=$TAUCS_INCFLAGS
     
    817821ac_cv_env_ASLMAKEFLAGS_set=${ASLMAKEFLAGS+set}
    818822ac_cv_env_ASLMAKEFLAGS_value=$ASLMAKEFLAGS
    819 ac_env_CXXLIBS_set=${CXXLIBS+set}
    820 ac_env_CXXLIBS_value=$CXXLIBS
    821 ac_cv_env_CXXLIBS_set=${CXXLIBS+set}
    822 ac_cv_env_CXXLIBS_value=$CXXLIBS
    823823
    824824#
     
    921921  ARFLAGS     Flags for adding file for archive command (default is `crv')
    922922  AR_X        Command for extracing an archive (default is `ar x')
    923   CC          C compiler command
    924   CFLAGS      C compiler flags
     923  CXX         C++ compiler command
     924  CXXFLAGS    C++ compiler flags
    925925  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
    926926              nonstandard directory <lib dir>
    927927  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
    928928              headers in a nonstandard directory <include dir>
    929   CXX         C++ compiler command
    930   CXXFLAGS    C++ compiler flags
    931   CXXCPP      C++ preprocessor
     929  CXXLIBS     Libraries necessary for linking C++ code with Fortran compiler
     930  CC          C compiler command
     931  CFLAGS      C compiler flags
    932932  F77         Fortran 77 compiler command
    933933  FFLAGS      Fortran 77 compiler flags
     934  CXXCPP      C++ preprocessor
    934935  TAUCS_INCFLAGS
    935936              Flags for including taucs header files
     
    937938              Compilation flags necessary for compiling the AMPL solver
    938939              library
    939   CXXLIBS     Libraries necessary for linking C++ code with Fortran compiler
    940940
    941941Use these variables to override the choices made by `configure' or to help
     
    14601460
    14611461
    1462 # Set variables for the archiver
     1462##########################################
     1463# Set variables for the archiver         #
     1464# (for AIX in 64bit mode also on SGI...) #
     1465##########################################
    14631466if test -z "$AR"; then
    14641467  AR="ar"
     
    14791482  enableval="$enable_debug"
    14801483  case "${enableval}" in
    1481     yes) debugcompile=true ;;
     1484    yes) debugcompile=true
     1485
     1486cat >>confdefs.h <<\_ACEOF
     1487#define IP_DEBUG 1
     1488_ACEOF
     1489
     1490         ;;
    14821491    no)  debugcompile=false ;;
    14831492    *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-debug" >&5
     
    14891498fi;
    14901499
    1491 ####################
    1492 # Compiler Options #
    1493 ####################
    1494 
    1495 if test "$debugcompile" = "true"; then
    1496 
    1497 cat >>confdefs.h <<\_ACEOF
    1498 #define IP_DEBUG 1
    1499 _ACEOF
    1500 
    1501   if test -z "$CXXFLAGS"; then
    1502     CXXFLAGS="-g"
    1503   fi
    1504 
    1505   if test -z "$CFLAGS"; then
    1506     CFLAGS="-g"
    1507   fi
    1508 
    1509   if test -z "$FFLAGS"; then
    1510     FFLAGS="-g"
    1511   fi
    1512 else
    1513   if test -z "$CXXFLAGS"; then
    1514     CXXFLAGS="-O3 -pipe"
    1515   fi
    1516 
    1517   if test -z "$CFLAGS"; then
    1518     CFLAGS="-O3 -pipe"
    1519   fi
    1520 
    1521   if test -z "$FFLAGS"; then
    1522     FFLAGS="-O3"
    1523   fi
    1524 fi
    1525 
    1526 SAVE_CFLAGS="$CFLAGS"
    1527 #AC_PROG_CC([icc cl pgcc xlc cc gcc cl])
    1528 ac_ext=c
    1529 ac_cpp='$CPP $CPPFLAGS'
    1530 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    1531 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    1532 ac_compiler_gnu=$ac_cv_c_compiler_gnu
     1500########################
     1501# C++ Compiler Options #
     1502########################
     1503
     1504ac_ext=cc
     1505ac_cpp='$CXXCPP $CPPFLAGS'
     1506ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     1507ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     1508ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     1509
     1510SAVE_CXXFLAGS="$CXXFLAGS"
     1511ac_ext=cc
     1512ac_cpp='$CXXCPP $CPPFLAGS'
     1513ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     1514ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     1515ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
    15331516if test -n "$ac_tool_prefix"; then
    1534   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
    1535 set dummy ${ac_tool_prefix}gcc; ac_word=$2
     1517  for ac_prog in $CCC icpc cl xlC aCC CC g++
     1518  do
     1519    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
     1520set dummy $ac_tool_prefix$ac_prog; ac_word=$2
    15361521echo "$as_me:$LINENO: checking for $ac_word" >&5
    15371522echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1538 if test "${ac_cv_prog_CC+set}" = set; then
     1523if test "${ac_cv_prog_CXX+set}" = set; then
    15391524  echo $ECHO_N "(cached) $ECHO_C" >&6
    15401525else
    1541   if test -n "$CC"; then
    1542   ac_cv_prog_CC="$CC" # Let the user override the test.
     1526  if test -n "$CXX"; then
     1527  ac_cv_prog_CXX="$CXX" # Let the user override the test.
    15431528else
    15441529as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     
    15491534  for ac_exec_ext in '' $ac_executable_extensions; do
    15501535  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1551     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     1536    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    15521537    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    15531538    break 2
     
    15581543fi
    15591544fi
    1560 CC=$ac_cv_prog_CC
    1561 if test -n "$CC"; then
    1562   echo "$as_me:$LINENO: result: $CC" >&5
    1563 echo "${ECHO_T}$CC" >&6
     1545CXX=$ac_cv_prog_CXX
     1546if test -n "$CXX"; then
     1547  echo "$as_me:$LINENO: result: $CXX" >&5
     1548echo "${ECHO_T}$CXX" >&6
    15641549else
    15651550  echo "$as_me:$LINENO: result: no" >&5
     
    15671552fi
    15681553
    1569 fi
    1570 if test -z "$ac_cv_prog_CC"; then
    1571   ac_ct_CC=$CC
    1572   # Extract the first word of "gcc", so it can be a program name with args.
    1573 set dummy gcc; ac_word=$2
     1554    test -n "$CXX" && break
     1555  done
     1556fi
     1557if test -z "$CXX"; then
     1558  ac_ct_CXX=$CXX
     1559  for ac_prog in $CCC icpc cl xlC aCC CC g++
     1560do
     1561  # Extract the first word of "$ac_prog", so it can be a program name with args.
     1562set dummy $ac_prog; ac_word=$2
    15741563echo "$as_me:$LINENO: checking for $ac_word" >&5
    15751564echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1576 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
     1565if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
    15771566  echo $ECHO_N "(cached) $ECHO_C" >&6
    15781567else
    1579   if test -n "$ac_ct_CC"; then
    1580   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
     1568  if test -n "$ac_ct_CXX"; then
     1569  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
    15811570else
    15821571as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     
    15871576  for ac_exec_ext in '' $ac_executable_extensions; do
    15881577  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1589     ac_cv_prog_ac_ct_CC="gcc"
     1578    ac_cv_prog_ac_ct_CXX="$ac_prog"
    15901579    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    15911580    break 2
     
    15961585fi
    15971586fi
    1598 ac_ct_CC=$ac_cv_prog_ac_ct_CC
    1599 if test -n "$ac_ct_CC"; then
    1600   echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
    1601 echo "${ECHO_T}$ac_ct_CC" >&6
     1587ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
     1588if test -n "$ac_ct_CXX"; then
     1589  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
     1590echo "${ECHO_T}$ac_ct_CXX" >&6
    16021591else
    16031592  echo "$as_me:$LINENO: result: no" >&5
     
    16051594fi
    16061595
    1607   CC=$ac_ct_CC
    1608 else
    1609   CC="$ac_cv_prog_CC"
    1610 fi
    1611 
    1612 if test -z "$CC"; then
    1613   if test -n "$ac_tool_prefix"; then
    1614   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
    1615 set dummy ${ac_tool_prefix}cc; ac_word=$2
    1616 echo "$as_me:$LINENO: checking for $ac_word" >&5
    1617 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1618 if test "${ac_cv_prog_CC+set}" = set; then
    1619   echo $ECHO_N "(cached) $ECHO_C" >&6
    1620 else
    1621   if test -n "$CC"; then
    1622   ac_cv_prog_CC="$CC" # Let the user override the test.
    1623 else
    1624 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    1625 for as_dir in $PATH
    1626 do
    1627   IFS=$as_save_IFS
    1628   test -z "$as_dir" && as_dir=.
    1629   for ac_exec_ext in '' $ac_executable_extensions; do
    1630   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1631     ac_cv_prog_CC="${ac_tool_prefix}cc"
    1632     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    1633     break 2
    1634   fi
     1596  test -n "$ac_ct_CXX" && break
    16351597done
    1636 done
    1637 
    1638 fi
    1639 fi
    1640 CC=$ac_cv_prog_CC
    1641 if test -n "$CC"; then
    1642   echo "$as_me:$LINENO: result: $CC" >&5
    1643 echo "${ECHO_T}$CC" >&6
    1644 else
    1645   echo "$as_me:$LINENO: result: no" >&5
    1646 echo "${ECHO_T}no" >&6
    1647 fi
    1648 
    1649 fi
    1650 if test -z "$ac_cv_prog_CC"; then
    1651   ac_ct_CC=$CC
    1652   # Extract the first word of "cc", so it can be a program name with args.
    1653 set dummy cc; ac_word=$2
    1654 echo "$as_me:$LINENO: checking for $ac_word" >&5
    1655 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1656 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
    1657   echo $ECHO_N "(cached) $ECHO_C" >&6
    1658 else
    1659   if test -n "$ac_ct_CC"; then
    1660   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    1661 else
    1662 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    1663 for as_dir in $PATH
    1664 do
    1665   IFS=$as_save_IFS
    1666   test -z "$as_dir" && as_dir=.
    1667   for ac_exec_ext in '' $ac_executable_extensions; do
    1668   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1669     ac_cv_prog_ac_ct_CC="cc"
    1670     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    1671     break 2
    1672   fi
    1673 done
    1674 done
    1675 
    1676 fi
    1677 fi
    1678 ac_ct_CC=$ac_cv_prog_ac_ct_CC
    1679 if test -n "$ac_ct_CC"; then
    1680   echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
    1681 echo "${ECHO_T}$ac_ct_CC" >&6
    1682 else
    1683   echo "$as_me:$LINENO: result: no" >&5
    1684 echo "${ECHO_T}no" >&6
    1685 fi
    1686 
    1687   CC=$ac_ct_CC
    1688 else
    1689   CC="$ac_cv_prog_CC"
    1690 fi
    1691 
    1692 fi
    1693 if test -z "$CC"; then
    1694   # Extract the first word of "cc", so it can be a program name with args.
    1695 set dummy cc; ac_word=$2
    1696 echo "$as_me:$LINENO: checking for $ac_word" >&5
    1697 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1698 if test "${ac_cv_prog_CC+set}" = set; then
    1699   echo $ECHO_N "(cached) $ECHO_C" >&6
    1700 else
    1701   if test -n "$CC"; then
    1702   ac_cv_prog_CC="$CC" # Let the user override the test.
    1703 else
    1704   ac_prog_rejected=no
    1705 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    1706 for as_dir in $PATH
    1707 do
    1708   IFS=$as_save_IFS
    1709   test -z "$as_dir" && as_dir=.
    1710   for ac_exec_ext in '' $ac_executable_extensions; do
    1711   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1712     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
    1713        ac_prog_rejected=yes
    1714        continue
    1715      fi
    1716     ac_cv_prog_CC="cc"
    1717     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    1718     break 2
    1719   fi
    1720 done
    1721 done
    1722 
    1723 if test $ac_prog_rejected = yes; then
    1724   # We found a bogon in the path, so make sure we never use it.
    1725   set dummy $ac_cv_prog_CC
    1726   shift
    1727   if test $# != 0; then
    1728     # We chose a different compiler from the bogus one.
    1729     # However, it has the same basename, so the bogon will be chosen
    1730     # first if we set CC to just the basename; use the full file name.
    1731     shift
    1732     ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
    1733   fi
    1734 fi
    1735 fi
    1736 fi
    1737 CC=$ac_cv_prog_CC
    1738 if test -n "$CC"; then
    1739   echo "$as_me:$LINENO: result: $CC" >&5
    1740 echo "${ECHO_T}$CC" >&6
    1741 else
    1742   echo "$as_me:$LINENO: result: no" >&5
    1743 echo "${ECHO_T}no" >&6
    1744 fi
    1745 
    1746 fi
    1747 if test -z "$CC"; then
    1748   if test -n "$ac_tool_prefix"; then
    1749   for ac_prog in cl
    1750   do
    1751     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
    1752 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
    1753 echo "$as_me:$LINENO: checking for $ac_word" >&5
    1754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1755 if test "${ac_cv_prog_CC+set}" = set; then
    1756   echo $ECHO_N "(cached) $ECHO_C" >&6
    1757 else
    1758   if test -n "$CC"; then
    1759   ac_cv_prog_CC="$CC" # Let the user override the test.
    1760 else
    1761 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    1762 for as_dir in $PATH
    1763 do
    1764   IFS=$as_save_IFS
    1765   test -z "$as_dir" && as_dir=.
    1766   for ac_exec_ext in '' $ac_executable_extensions; do
    1767   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1768     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
    1769     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    1770     break 2
    1771   fi
    1772 done
    1773 done
    1774 
    1775 fi
    1776 fi
    1777 CC=$ac_cv_prog_CC
    1778 if test -n "$CC"; then
    1779   echo "$as_me:$LINENO: result: $CC" >&5
    1780 echo "${ECHO_T}$CC" >&6
    1781 else
    1782   echo "$as_me:$LINENO: result: no" >&5
    1783 echo "${ECHO_T}no" >&6
    1784 fi
    1785 
    1786     test -n "$CC" && break
    1787   done
    1788 fi
    1789 if test -z "$CC"; then
    1790   ac_ct_CC=$CC
    1791   for ac_prog in cl
    1792 do
    1793   # Extract the first word of "$ac_prog", so it can be a program name with args.
    1794 set dummy $ac_prog; ac_word=$2
    1795 echo "$as_me:$LINENO: checking for $ac_word" >&5
    1796 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    1797 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
    1798   echo $ECHO_N "(cached) $ECHO_C" >&6
    1799 else
    1800   if test -n "$ac_ct_CC"; then
    1801   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
    1802 else
    1803 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    1804 for as_dir in $PATH
    1805 do
    1806   IFS=$as_save_IFS
    1807   test -z "$as_dir" && as_dir=.
    1808   for ac_exec_ext in '' $ac_executable_extensions; do
    1809   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    1810     ac_cv_prog_ac_ct_CC="$ac_prog"
    1811     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    1812     break 2
    1813   fi
    1814 done
    1815 done
    1816 
    1817 fi
    1818 fi
    1819 ac_ct_CC=$ac_cv_prog_ac_ct_CC
    1820 if test -n "$ac_ct_CC"; then
    1821   echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
    1822 echo "${ECHO_T}$ac_ct_CC" >&6
    1823 else
    1824   echo "$as_me:$LINENO: result: no" >&5
    1825 echo "${ECHO_T}no" >&6
    1826 fi
    1827 
    1828   test -n "$ac_ct_CC" && break
    1829 done
    1830 
    1831   CC=$ac_ct_CC
    1832 fi
    1833 
    1834 fi
    1835 
    1836 
    1837 test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
    1838 See \`config.log' for more details." >&5
    1839 echo "$as_me: error: no acceptable C compiler found in \$PATH
    1840 See \`config.log' for more details." >&2;}
    1841    { (exit 1); exit 1; }; }
     1598test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
     1599
     1600  CXX=$ac_ct_CXX
     1601fi
     1602
    18421603
    18431604# Provide some information about the compiler.
    18441605echo "$as_me:$LINENO:" \
    1845      "checking for C compiler version" >&5
     1606     "checking for C++ compiler version" >&5
    18461607ac_compiler=`set X $ac_compile; echo $2`
    18471608{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
     
    18811642# It will help us diagnose broken compilers, and finding out an intuition
    18821643# of exeext.
    1883 echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
    1884 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
     1644echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5
     1645echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6
    18851646ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
    18861647if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
     
    19251686sed 's/^/| /' conftest.$ac_ext >&5
    19261687
    1927 { { echo "$as_me:$LINENO: error: C compiler cannot create executables
     1688{ { echo "$as_me:$LINENO: error: C++ compiler cannot create executables
    19281689See \`config.log' for more details." >&5
    1929 echo "$as_me: error: C compiler cannot create executables
     1690echo "$as_me: error: C++ compiler cannot create executables
    19301691See \`config.log' for more details." >&2;}
    19311692   { (exit 77); exit 77; }; }
     
    19381699# Check the compiler produces executables we can run.  If not, either
    19391700# the compiler is broken, or we cross compile.
    1940 echo "$as_me:$LINENO: checking whether the C compiler works" >&5
    1941 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
     1701echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5
     1702echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6
    19421703# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
    19431704# If not cross compiling, check that we can run a simple program.
     
    19541715        cross_compiling=yes
    19551716    else
    1956         { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
     1717        { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs.
    19571718If you meant to cross compile, use \`--host'.
    19581719See \`config.log' for more details." >&5
    1959 echo "$as_me: error: cannot run C compiled programs.
     1720echo "$as_me: error: cannot run C++ compiled programs.
    19601721If you meant to cross compile, use \`--host'.
    19611722See \`config.log' for more details." >&2;}
     
    20621823OBJEXT=$ac_cv_objext
    20631824ac_objext=$OBJEXT
     1825echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
     1826echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
     1827if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
     1828  echo $ECHO_N "(cached) $ECHO_C" >&6
     1829else
     1830  cat >conftest.$ac_ext <<_ACEOF
     1831/* confdefs.h.  */
     1832_ACEOF
     1833cat confdefs.h >>conftest.$ac_ext
     1834cat >>conftest.$ac_ext <<_ACEOF
     1835/* end confdefs.h.  */
     1836
     1837int
     1838main ()
     1839{
     1840#ifndef __GNUC__
     1841       choke me
     1842#endif
     1843
     1844  ;
     1845  return 0;
     1846}
     1847_ACEOF
     1848rm -f conftest.$ac_objext
     1849if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     1850  (eval $ac_compile) 2>conftest.er1
     1851  ac_status=$?
     1852  grep -v '^ *+' conftest.er1 >conftest.err
     1853  rm -f conftest.er1
     1854  cat conftest.err >&5
     1855  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     1856  (exit $ac_status); } &&
     1857         { ac_try='test -z "$ac_cxx_werror_flag"
     1858                         || test ! -s conftest.err'
     1859  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     1860  (eval $ac_try) 2>&5
     1861  ac_status=$?
     1862  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     1863  (exit $ac_status); }; } &&
     1864         { ac_try='test -s conftest.$ac_objext'
     1865  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     1866  (eval $ac_try) 2>&5
     1867  ac_status=$?
     1868  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     1869  (exit $ac_status); }; }; then
     1870  ac_compiler_gnu=yes
     1871else
     1872  echo "$as_me: failed program was:" >&5
     1873sed 's/^/| /' conftest.$ac_ext >&5
     1874
     1875ac_compiler_gnu=no
     1876fi
     1877rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     1878ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
     1879
     1880fi
     1881echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
     1882echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
     1883GXX=`test $ac_compiler_gnu = yes && echo yes`
     1884ac_test_CXXFLAGS=${CXXFLAGS+set}
     1885ac_save_CXXFLAGS=$CXXFLAGS
     1886CXXFLAGS="-g"
     1887echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
     1888echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
     1889if test "${ac_cv_prog_cxx_g+set}" = set; then
     1890  echo $ECHO_N "(cached) $ECHO_C" >&6
     1891else
     1892  cat >conftest.$ac_ext <<_ACEOF
     1893/* confdefs.h.  */
     1894_ACEOF
     1895cat confdefs.h >>conftest.$ac_ext
     1896cat >>conftest.$ac_ext <<_ACEOF
     1897/* end confdefs.h.  */
     1898
     1899int
     1900main ()
     1901{
     1902
     1903  ;
     1904  return 0;
     1905}
     1906_ACEOF
     1907rm -f conftest.$ac_objext
     1908if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     1909  (eval $ac_compile) 2>conftest.er1
     1910  ac_status=$?
     1911  grep -v '^ *+' conftest.er1 >conftest.err
     1912  rm -f conftest.er1
     1913  cat conftest.err >&5
     1914  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     1915  (exit $ac_status); } &&
     1916         { ac_try='test -z "$ac_cxx_werror_flag"
     1917                         || test ! -s conftest.err'
     1918  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     1919  (eval $ac_try) 2>&5
     1920  ac_status=$?
     1921  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     1922  (exit $ac_status); }; } &&
     1923         { ac_try='test -s conftest.$ac_objext'
     1924  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     1925  (eval $ac_try) 2>&5
     1926  ac_status=$?
     1927  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     1928  (exit $ac_status); }; }; then
     1929  ac_cv_prog_cxx_g=yes
     1930else
     1931  echo "$as_me: failed program was:" >&5
     1932sed 's/^/| /' conftest.$ac_ext >&5
     1933
     1934ac_cv_prog_cxx_g=no
     1935fi
     1936rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     1937fi
     1938echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
     1939echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
     1940if test "$ac_test_CXXFLAGS" = set; then
     1941  CXXFLAGS=$ac_save_CXXFLAGS
     1942elif test $ac_cv_prog_cxx_g = yes; then
     1943  if test "$GXX" = yes; then
     1944    CXXFLAGS="-g -O2"
     1945  else
     1946    CXXFLAGS="-g"
     1947  fi
     1948else
     1949  if test "$GXX" = yes; then
     1950    CXXFLAGS="-O2"
     1951  else
     1952    CXXFLAGS=
     1953  fi
     1954fi
     1955for ac_declaration in \
     1956   '' \
     1957   'extern "C" void std::exit (int) throw (); using std::exit;' \
     1958   'extern "C" void std::exit (int); using std::exit;' \
     1959   'extern "C" void exit (int) throw ();' \
     1960   'extern "C" void exit (int);' \
     1961   'void exit (int);'
     1962do
     1963  cat >conftest.$ac_ext <<_ACEOF
     1964/* confdefs.h.  */
     1965_ACEOF
     1966cat confdefs.h >>conftest.$ac_ext
     1967cat >>conftest.$ac_ext <<_ACEOF
     1968/* end confdefs.h.  */
     1969$ac_declaration
     1970#include <stdlib.h>
     1971int
     1972main ()
     1973{
     1974exit (42);
     1975  ;
     1976  return 0;
     1977}
     1978_ACEOF
     1979rm -f conftest.$ac_objext
     1980if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     1981  (eval $ac_compile) 2>conftest.er1
     1982  ac_status=$?
     1983  grep -v '^ *+' conftest.er1 >conftest.err
     1984  rm -f conftest.er1
     1985  cat conftest.err >&5
     1986  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     1987  (exit $ac_status); } &&
     1988         { ac_try='test -z "$ac_cxx_werror_flag"
     1989                         || test ! -s conftest.err'
     1990  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     1991  (eval $ac_try) 2>&5
     1992  ac_status=$?
     1993  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     1994  (exit $ac_status); }; } &&
     1995         { ac_try='test -s conftest.$ac_objext'
     1996  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     1997  (eval $ac_try) 2>&5
     1998  ac_status=$?
     1999  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2000  (exit $ac_status); }; }; then
     2001  :
     2002else
     2003  echo "$as_me: failed program was:" >&5
     2004sed 's/^/| /' conftest.$ac_ext >&5
     2005
     2006continue
     2007fi
     2008rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     2009  cat >conftest.$ac_ext <<_ACEOF
     2010/* confdefs.h.  */
     2011_ACEOF
     2012cat confdefs.h >>conftest.$ac_ext
     2013cat >>conftest.$ac_ext <<_ACEOF
     2014/* end confdefs.h.  */
     2015$ac_declaration
     2016int
     2017main ()
     2018{
     2019exit (42);
     2020  ;
     2021  return 0;
     2022}
     2023_ACEOF
     2024rm -f conftest.$ac_objext
     2025if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     2026  (eval $ac_compile) 2>conftest.er1
     2027  ac_status=$?
     2028  grep -v '^ *+' conftest.er1 >conftest.err
     2029  rm -f conftest.er1
     2030  cat conftest.err >&5
     2031  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2032  (exit $ac_status); } &&
     2033         { ac_try='test -z "$ac_cxx_werror_flag"
     2034                         || test ! -s conftest.err'
     2035  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2036  (eval $ac_try) 2>&5
     2037  ac_status=$?
     2038  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2039  (exit $ac_status); }; } &&
     2040         { ac_try='test -s conftest.$ac_objext'
     2041  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2042  (eval $ac_try) 2>&5
     2043  ac_status=$?
     2044  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2045  (exit $ac_status); }; }; then
     2046  break
     2047else
     2048  echo "$as_me: failed program was:" >&5
     2049sed 's/^/| /' conftest.$ac_ext >&5
     2050
     2051fi
     2052rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     2053done
     2054rm -f conftest*
     2055if test -n "$ac_declaration"; then
     2056  echo '#ifdef __cplusplus' >>confdefs.h
     2057  echo $ac_declaration      >>confdefs.h
     2058  echo '#endif'             >>confdefs.h
     2059fi
     2060
     2061ac_ext=cc
     2062ac_cpp='$CXXCPP $CPPFLAGS'
     2063ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     2064ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     2065ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     2066
     2067CXXFLAGS="$SAVE_CXXFLAGS"
     2068
     2069warn_cxxflags=
     2070
     2071if test -z "$CXXFLAGS"; then
     2072  add_cxxflags=
     2073  opt_cxxflags=
     2074  dbg_cxxflags=
     2075
     2076  if test "$GXX" = "yes"; then
     2077    case "$CXX" in
     2078      icpc | */icpc) ;;
     2079      *)
     2080        opt_cxxflags="-O3 -funroll-loops"
     2081        case $build in
     2082          i686-* )
     2083            CXXFLAGS="-march=i686 -mfpmath=sse -msse"
     2084            echo "$as_me:$LINENO: checking whether flags \"$CXXFLAGS\" work" >&5
     2085echo $ECHO_N "checking whether flags \"$CXXFLAGS\" work... $ECHO_C" >&6
     2086
     2087cat >conftest.$ac_ext <<_ACEOF
     2088/* confdefs.h.  */
     2089_ACEOF
     2090cat confdefs.h >>conftest.$ac_ext
     2091cat >>conftest.$ac_ext <<_ACEOF
     2092/* end confdefs.h.  */
     2093#include <cmath>
     2094int
     2095main ()
     2096{
     2097double s = sin(1.0);
     2098  ;
     2099  return 0;
     2100}
     2101_ACEOF
     2102rm -f conftest.$ac_objext conftest$ac_exeext
     2103if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2104  (eval $ac_link) 2>conftest.er1
     2105  ac_status=$?
     2106  grep -v '^ *+' conftest.er1 >conftest.err
     2107  rm -f conftest.er1
     2108  cat conftest.err >&5
     2109  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2110  (exit $ac_status); } &&
     2111         { ac_try='test -z "$ac_cxx_werror_flag"
     2112                         || test ! -s conftest.err'
     2113  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2114  (eval $ac_try) 2>&5
     2115  ac_status=$?
     2116  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2117  (exit $ac_status); }; } &&
     2118         { ac_try='test -s conftest$ac_exeext'
     2119  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2120  (eval $ac_try) 2>&5
     2121  ac_status=$?
     2122  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2123  (exit $ac_status); }; }; then
     2124  echo "$as_me:$LINENO: result: yes" >&5
     2125echo "${ECHO_T}yes" >&6; opt_cxxflags="$opt_cxxflags $CXXFLAGS"
     2126else
     2127  echo "$as_me: failed program was:" >&5
     2128sed 's/^/| /' conftest.$ac_ext >&5
     2129
     2130echo "$as_me:$LINENO: result: no" >&5
     2131echo "${ECHO_T}no" >&6
     2132fi
     2133rm -f conftest.err conftest.$ac_objext \
     2134      conftest$ac_exeext conftest.$ac_ext
     2135            CXXFLAGS=
     2136          ;;
     2137        esac
     2138        add_cxxflags="-pipe"
     2139        dbg_cxxflags="-g"
     2140        warn_cxxflags="-pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Werror -Wconversion"
     2141        case $build in
     2142          *-cygwin*) echo "$as_me:$LINENO: checking whether flag \" -mno-cygwin\" works" >&5
     2143echo $ECHO_N "checking whether flag \" -mno-cygwin\" works... $ECHO_C" >&6
     2144                    CXXFLAGS="-mno-cygwin"
     2145                    cat >conftest.$ac_ext <<_ACEOF
     2146/* confdefs.h.  */
     2147_ACEOF
     2148cat confdefs.h >>conftest.$ac_ext
     2149cat >>conftest.$ac_ext <<_ACEOF
     2150/* end confdefs.h.  */
     2151
     2152int
     2153main ()
     2154{
     2155int i=0; i++;
     2156  ;
     2157  return 0;
     2158}
     2159_ACEOF
     2160rm -f conftest.$ac_objext conftest$ac_exeext
     2161if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2162  (eval $ac_link) 2>conftest.er1
     2163  ac_status=$?
     2164  grep -v '^ *+' conftest.er1 >conftest.err
     2165  rm -f conftest.er1
     2166  cat conftest.err >&5
     2167  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2168  (exit $ac_status); } &&
     2169         { ac_try='test -z "$ac_cxx_werror_flag"
     2170                         || test ! -s conftest.err'
     2171  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2172  (eval $ac_try) 2>&5
     2173  ac_status=$?
     2174  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2175  (exit $ac_status); }; } &&
     2176         { ac_try='test -s conftest$ac_exeext'
     2177  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2178  (eval $ac_try) 2>&5
     2179  ac_status=$?
     2180  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2181  (exit $ac_status); }; }; then
     2182  echo "$as_me:$LINENO: result: yes" >&5
     2183echo "${ECHO_T}yes" >&6; add_cxxflags="-mno-cygwin $add_cxxflags"; use_mingw=yes
     2184else
     2185  echo "$as_me: failed program was:" >&5
     2186sed 's/^/| /' conftest.$ac_ext >&5
     2187
     2188echo "$as_me:$LINENO: result: no" >&5
     2189echo "${ECHO_T}no" >&6
     2190fi
     2191rm -f conftest.err conftest.$ac_objext \
     2192      conftest$ac_exeext conftest.$ac_ext
     2193                    CXXFLAGS= ;;
     2194        esac ;;
     2195    esac
     2196  fi
     2197  if test -z "$opt_cxxflags"; then
     2198    case $build in
     2199     *-cygwin*)
     2200      case "$CXX" in
     2201      cl | */cl)
     2202             opt_cxxflags="-Ot1"
     2203             add_cxxflags="-nologo"
     2204             dbg_cxxflags="-Yd";;
     2205      esac;;
     2206     *-linux-*)
     2207      case "$CXX" in
     2208      icpc | */icpc)
     2209#             AC_MSG_CHECKING([whether flag \"-fast\" works])
     2210#               CXXFLAGS="-fast"
     2211#               AC_TRY_RUN(,[int i=0; i++;],
     2212#                               [AC_MSG_RESULT([yes]); opt_cxxflags="-fast"],
     2213#                               [AC_MSG_RESULT([no]); opt_cxxflags="-O3 -ip -static"])
     2214#               CXXFLAGS=
     2215             opt_cxxflags="-O3 -ip"
     2216             add_cxxflags="-mp -pc64"
     2217             dbg_cxxflags="-g"
     2218             # Check if -i_dynamic is necessary (for new glibc library)
     2219             echo "$as_me:$LINENO: checking whether flag \"-i_dynamic\" is needed" >&5
     2220echo $ECHO_N "checking whether flag \"-i_dynamic\" is needed... $ECHO_C" >&6
     2221             CXXFLAGS=
     2222             cat >conftest.$ac_ext <<_ACEOF
     2223/* confdefs.h.  */
     2224_ACEOF
     2225cat confdefs.h >>conftest.$ac_ext
     2226cat >>conftest.$ac_ext <<_ACEOF
     2227/* end confdefs.h.  */
     2228
     2229int
     2230main ()
     2231{
     2232int i=0; i++;
     2233  ;
     2234  return 0;
     2235}
     2236_ACEOF
     2237rm -f conftest.$ac_objext conftest$ac_exeext
     2238if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2239  (eval $ac_link) 2>conftest.er1
     2240  ac_status=$?
     2241  grep -v '^ *+' conftest.er1 >conftest.err
     2242  rm -f conftest.er1
     2243  cat conftest.err >&5
     2244  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2245  (exit $ac_status); } &&
     2246         { ac_try='test -z "$ac_cxx_werror_flag"
     2247                         || test ! -s conftest.err'
     2248  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2249  (eval $ac_try) 2>&5
     2250  ac_status=$?
     2251  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2252  (exit $ac_status); }; } &&
     2253         { ac_try='test -s conftest$ac_exeext'
     2254  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2255  (eval $ac_try) 2>&5
     2256  ac_status=$?
     2257  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2258  (exit $ac_status); }; }; then
     2259  echo "$as_me:$LINENO: result: apparently not" >&5
     2260echo "${ECHO_T}apparently not" >&6
     2261else
     2262  echo "$as_me: failed program was:" >&5
     2263sed 's/^/| /' conftest.$ac_ext >&5
     2264
     2265echo "$as_me:$LINENO: result: seems so" >&5
     2266echo "${ECHO_T}seems so" >&6;
     2267                               add_cxxflags="-i_dynamic $add_cxxflags"
     2268fi
     2269rm -f conftest.err conftest.$ac_objext \
     2270      conftest$ac_exeext conftest.$ac_ext
     2271             ;;
     2272      esac;;
     2273    *-ibm-*)
     2274      case "$CXX" in
     2275      xlC* | */xlC* | mpxlC* | */mpxlC*)
     2276             opt_cxxflags="-O5 -qmaxmem=-1"
     2277             add_cxxflags="-bmaxdata:0x80000000"
     2278             dbg_cxxflags="-g";;
     2279      esac;;
     2280    *-hp-*)
     2281      case "$CXX" in
     2282      aCC | */aCC )
     2283             opt_cxxflags="+O4"
     2284             add_cxxflags="-AA -qrtti=dyna"
     2285             dbg_cxxflags="-g";;
     2286      esac;;
     2287    *-sun-*)
     2288             opt_cxxflags="-O5"
     2289             dbg_cxxflags="-g";;
     2290    esac
     2291  fi
     2292
     2293  if test "$ac_cv_prog_cxx_g" = yes && test -z "$dbg_cxxflags" ; then
     2294    dbg_cxxflags="-g"
     2295  fi
     2296
     2297  if test "$debugcompile" = "true"; then
     2298    CXXFLAGS="$dbg_cxxflags $add_cxxflags"
     2299  else
     2300    if test -z "$opt_cxxflags"; then
     2301# Try if -O option works if nothing else is set
     2302      CXXFLAGS="-O"
     2303      cat >conftest.$ac_ext <<_ACEOF
     2304/* confdefs.h.  */
     2305_ACEOF
     2306cat confdefs.h >>conftest.$ac_ext
     2307cat >>conftest.$ac_ext <<_ACEOF
     2308/* end confdefs.h.  */
     2309
     2310int
     2311main ()
     2312{
     2313int i=0; i++;
     2314  ;
     2315  return 0;
     2316}
     2317_ACEOF
     2318rm -f conftest.$ac_objext conftest$ac_exeext
     2319if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2320  (eval $ac_link) 2>conftest.er1
     2321  ac_status=$?
     2322  grep -v '^ *+' conftest.er1 >conftest.err
     2323  rm -f conftest.er1
     2324  cat conftest.err >&5
     2325  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2326  (exit $ac_status); } &&
     2327         { ac_try='test -z "$ac_cxx_werror_flag"
     2328                         || test ! -s conftest.err'
     2329  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2330  (eval $ac_try) 2>&5
     2331  ac_status=$?
     2332  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2333  (exit $ac_status); }; } &&
     2334         { ac_try='test -s conftest$ac_exeext'
     2335  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2336  (eval $ac_try) 2>&5
     2337  ac_status=$?
     2338  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2339  (exit $ac_status); }; }; then
     2340  opt_cxxflags="-O"
     2341else
     2342  echo "$as_me: failed program was:" >&5
     2343sed 's/^/| /' conftest.$ac_ext >&5
     2344
     2345fi
     2346rm -f conftest.err conftest.$ac_objext \
     2347      conftest$ac_exeext conftest.$ac_ext
     2348    fi
     2349    CXXFLAGS="$opt_cxxflags $add_cxxflags"
     2350  fi
     2351fi
     2352
     2353# Try if CXXFLAGS works
     2354echo "$as_me:$LINENO: checking whether CXXFLAGS=\"$CXXFLAGS\" works" >&5
     2355echo $ECHO_N "checking whether CXXFLAGS=\"$CXXFLAGS\" works... $ECHO_C" >&6
     2356cat >conftest.$ac_ext <<_ACEOF
     2357/* confdefs.h.  */
     2358_ACEOF
     2359cat confdefs.h >>conftest.$ac_ext
     2360cat >>conftest.$ac_ext <<_ACEOF
     2361/* end confdefs.h.  */
     2362
     2363int
     2364main ()
     2365{
     2366int i=0; i++;
     2367  ;
     2368  return 0;
     2369}
     2370_ACEOF
     2371rm -f conftest.$ac_objext conftest$ac_exeext
     2372if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2373  (eval $ac_link) 2>conftest.er1
     2374  ac_status=$?
     2375  grep -v '^ *+' conftest.er1 >conftest.err
     2376  rm -f conftest.er1
     2377  cat conftest.err >&5
     2378  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2379  (exit $ac_status); } &&
     2380         { ac_try='test -z "$ac_cxx_werror_flag"
     2381                         || test ! -s conftest.err'
     2382  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2383  (eval $ac_try) 2>&5
     2384  ac_status=$?
     2385  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2386  (exit $ac_status); }; } &&
     2387         { ac_try='test -s conftest$ac_exeext'
     2388  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2389  (eval $ac_try) 2>&5
     2390  ac_status=$?
     2391  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2392  (exit $ac_status); }; }; then
     2393  :
     2394else
     2395  echo "$as_me: failed program was:" >&5
     2396sed 's/^/| /' conftest.$ac_ext >&5
     2397
     2398CXXFLAGS=
     2399fi
     2400rm -f conftest.err conftest.$ac_objext \
     2401      conftest$ac_exeext conftest.$ac_ext
     2402if test -z "$CXXFLAGS"; then
     2403  echo "$as_me:$LINENO: result: no" >&5
     2404echo "${ECHO_T}no" >&6
     2405  { echo "$as_me:$LINENO: WARNING: This value for CXXFLAGS does not work.  I will now just try '-O', but you might want to set CXXFLAGS manually." >&5
     2406echo "$as_me: WARNING: This value for CXXFLAGS does not work.  I will now just try '-O', but you might want to set CXXFLAGS manually." >&2;}
     2407  CXXFLAGS='-O'
     2408  cat >conftest.$ac_ext <<_ACEOF
     2409/* confdefs.h.  */
     2410_ACEOF
     2411cat confdefs.h >>conftest.$ac_ext
     2412cat >>conftest.$ac_ext <<_ACEOF
     2413/* end confdefs.h.  */
     2414
     2415int
     2416main ()
     2417{
     2418int i=0; i++;
     2419  ;
     2420  return 0;
     2421}
     2422_ACEOF
     2423rm -f conftest.$ac_objext conftest$ac_exeext
     2424if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2425  (eval $ac_link) 2>conftest.er1
     2426  ac_status=$?
     2427  grep -v '^ *+' conftest.er1 >conftest.err
     2428  rm -f conftest.er1
     2429  cat conftest.err >&5
     2430  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2431  (exit $ac_status); } &&
     2432         { ac_try='test -z "$ac_cxx_werror_flag"
     2433                         || test ! -s conftest.err'
     2434  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2435  (eval $ac_try) 2>&5
     2436  ac_status=$?
     2437  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2438  (exit $ac_status); }; } &&
     2439         { ac_try='test -s conftest$ac_exeext'
     2440  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2441  (eval $ac_try) 2>&5
     2442  ac_status=$?
     2443  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2444  (exit $ac_status); }; }; then
     2445  :
     2446else
     2447  echo "$as_me: failed program was:" >&5
     2448sed 's/^/| /' conftest.$ac_ext >&5
     2449
     2450CXXFLAGS=
     2451fi
     2452rm -f conftest.err conftest.$ac_objext \
     2453      conftest$ac_exeext conftest.$ac_ext
     2454  if test -z "$CXXFLAGS"; then
     2455    echo "$as_me:$LINENO: result: no" >&5
     2456echo "${ECHO_T}no" >&6
     2457    { echo "$as_me:$LINENO: WARNING: This value for CXXFLAGS does not work.  I will continue with empty CXXFLAGS, but you might want to set CXXFLAGS manually." >&5
     2458echo "$as_me: WARNING: This value for CXXFLAGS does not work.  I will continue with empty CXXFLAGS, but you might want to set CXXFLAGS manually." >&2;}
     2459  fi
     2460else
     2461  echo "$as_me:$LINENO: result: yes" >&5
     2462echo "${ECHO_T}yes" >&6
     2463fi
     2464
     2465# C++ link libraries #
     2466CXXLIBS=
     2467if test -z "$CXXLIBS"; then
     2468  if test "$GXX" = "yes"; then
     2469    case "$CXX" in
     2470      icpc | */icpc)
     2471        CXXLIBS=""
     2472        ;;
     2473      *)
     2474        CXXLIBS="-lstdc++ -lm -lgcc_s -lgcc"
     2475        ;;
     2476    esac
     2477  fi
     2478  if test -z "$opt_cxxflags"; then
     2479    case $build in
     2480     *-linux-*)
     2481      case "$CXX" in
     2482      icpc | */icpc)
     2483        CXXLIBS=""
     2484             ;;
     2485      esac;;
     2486    *-ibm-*)
     2487      CXXLIBS="-lC -lc"
     2488      ;;
     2489    *-hp-*)
     2490      CXXLIBS="-L/opt/aCC/lib -l++ -lstd_v2 -lCsup_v2 -lm -lcl -lc"
     2491      ;;
     2492    *-sun-*)
     2493      CXXLIBS="-lCstd -lCrun"
     2494    esac
     2495  fi
     2496fi
     2497if test -z "$CXXLIBS"; then
     2498  { echo "$as_me:$LINENO: WARNING: Could not automatically determine CXXLIBS (C++ link libraries; necessary if main program is in Fortran of C)." >&5
     2499echo "$as_me: WARNING: Could not automatically determine CXXLIBS (C++ link libraries; necessary if main program is in Fortran of C)." >&2;}
     2500else
     2501  { echo "$as_me:$LINENO: Assuming that CXXLIBS is \"$CXXLIBS\"." >&5
     2502echo "$as_me: Assuming that CXXLIBS is \"$CXXLIBS\"." >&6;}
     2503fi
     2504ac_ext=c
     2505ac_cpp='$CPP $CPPFLAGS'
     2506ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     2507ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     2508ac_compiler_gnu=$ac_cv_c_compiler_gnu
     2509
     2510
     2511######################
     2512# C Compiler Options #
     2513######################
     2514
     2515SAVE_CFLAGS="$CFLAGS"
     2516ac_ext=c
     2517ac_cpp='$CPP $CPPFLAGS'
     2518ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     2519ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     2520ac_compiler_gnu=$ac_cv_c_compiler_gnu
     2521if test -n "$ac_tool_prefix"; then
     2522  for ac_prog in icc cl pgcc xlc cc gcc cl
     2523  do
     2524    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
     2525set dummy $ac_tool_prefix$ac_prog; ac_word=$2
     2526echo "$as_me:$LINENO: checking for $ac_word" >&5
     2527echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     2528if test "${ac_cv_prog_CC+set}" = set; then
     2529  echo $ECHO_N "(cached) $ECHO_C" >&6
     2530else
     2531  if test -n "$CC"; then
     2532  ac_cv_prog_CC="$CC" # Let the user override the test.
     2533else
     2534as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     2535for as_dir in $PATH
     2536do
     2537  IFS=$as_save_IFS
     2538  test -z "$as_dir" && as_dir=.
     2539  for ac_exec_ext in '' $ac_executable_extensions; do
     2540  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2541    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     2542    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2543    break 2
     2544  fi
     2545done
     2546done
     2547
     2548fi
     2549fi
     2550CC=$ac_cv_prog_CC
     2551if test -n "$CC"; then
     2552  echo "$as_me:$LINENO: result: $CC" >&5
     2553echo "${ECHO_T}$CC" >&6
     2554else
     2555  echo "$as_me:$LINENO: result: no" >&5
     2556echo "${ECHO_T}no" >&6
     2557fi
     2558
     2559    test -n "$CC" && break
     2560  done
     2561fi
     2562if test -z "$CC"; then
     2563  ac_ct_CC=$CC
     2564  for ac_prog in icc cl pgcc xlc cc gcc cl
     2565do
     2566  # Extract the first word of "$ac_prog", so it can be a program name with args.
     2567set dummy $ac_prog; ac_word=$2
     2568echo "$as_me:$LINENO: checking for $ac_word" >&5
     2569echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     2570if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
     2571  echo $ECHO_N "(cached) $ECHO_C" >&6
     2572else
     2573  if test -n "$ac_ct_CC"; then
     2574  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
     2575else
     2576as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     2577for as_dir in $PATH
     2578do
     2579  IFS=$as_save_IFS
     2580  test -z "$as_dir" && as_dir=.
     2581  for ac_exec_ext in '' $ac_executable_extensions; do
     2582  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2583    ac_cv_prog_ac_ct_CC="$ac_prog"
     2584    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2585    break 2
     2586  fi
     2587done
     2588done
     2589
     2590fi
     2591fi
     2592ac_ct_CC=$ac_cv_prog_ac_ct_CC
     2593if test -n "$ac_ct_CC"; then
     2594  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
     2595echo "${ECHO_T}$ac_ct_CC" >&6
     2596else
     2597  echo "$as_me:$LINENO: result: no" >&5
     2598echo "${ECHO_T}no" >&6
     2599fi
     2600
     2601  test -n "$ac_ct_CC" && break
     2602done
     2603
     2604  CC=$ac_ct_CC
     2605fi
     2606
     2607
     2608test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
     2609See \`config.log' for more details." >&5
     2610echo "$as_me: error: no acceptable C compiler found in \$PATH
     2611See \`config.log' for more details." >&2;}
     2612   { (exit 1); exit 1; }; }
     2613
     2614# Provide some information about the compiler.
     2615echo "$as_me:$LINENO:" \
     2616     "checking for C compiler version" >&5
     2617ac_compiler=`set X $ac_compile; echo $2`
     2618{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
     2619  (eval $ac_compiler --version </dev/null >&5) 2>&5
     2620  ac_status=$?
     2621  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2622  (exit $ac_status); }
     2623{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
     2624  (eval $ac_compiler -v </dev/null >&5) 2>&5
     2625  ac_status=$?
     2626  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2627  (exit $ac_status); }
     2628{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
     2629  (eval $ac_compiler -V </dev/null >&5) 2>&5
     2630  ac_status=$?
     2631  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2632  (exit $ac_status); }
     2633
    20642634echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
    20652635echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
     
    24583028CFLAGS="$SAVE_CFLAGS"
    24593029
    2460 SAVE_CXXFLAGS="$CXXFLAGS"
    2461 #AC_PROG_CXX([icpc cl KCC CC cxx cc++ xlC aCC c++ g++ egcs gcc])
    2462 ac_ext=cc
    2463 ac_cpp='$CXXCPP $CPPFLAGS'
    2464 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    2465 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    2466 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
     3030warn_cflags=
     3031
     3032if test -z "$CFLAGS"; then
     3033  add_cflags=
     3034  opt_cflags=
     3035  dbg_cflags=
     3036
     3037  if test "$GCC" = "yes"; then
     3038    case "$CC" in
     3039      icc | */icc) ;;
     3040      *)
     3041        opt_cflags="-O3 -funroll-loops"
     3042        case $build in
     3043          i686-* )
     3044            myCFLAGS="-march=i686 -mfpmath=sse -msse"
     3045            echo "$as_me:$LINENO: checking whether  flags \"$myCFLAGS\" work" >&5
     3046echo $ECHO_N "checking whether  flags \"$myCFLAGS\" work... $ECHO_C" >&6
     3047# This is a trick to make sure that the math library is included
     3048            CFLAGS="$myCFLAGS -lm"
     3049
     3050cat >conftest.$ac_ext <<_ACEOF
     3051/* confdefs.h.  */
     3052_ACEOF
     3053cat confdefs.h >>conftest.$ac_ext
     3054cat >>conftest.$ac_ext <<_ACEOF
     3055/* end confdefs.h.  */
     3056#include <math.h>
     3057int
     3058main ()
     3059{
     3060double s = sin(1.0);
     3061  ;
     3062  return 0;
     3063}
     3064_ACEOF
     3065rm -f conftest.$ac_objext conftest$ac_exeext
     3066if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3067  (eval $ac_link) 2>conftest.er1
     3068  ac_status=$?
     3069  grep -v '^ *+' conftest.er1 >conftest.err
     3070  rm -f conftest.er1
     3071  cat conftest.err >&5
     3072  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3073  (exit $ac_status); } &&
     3074         { ac_try='test -z "$ac_c_werror_flag"
     3075                         || test ! -s conftest.err'
     3076  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3077  (eval $ac_try) 2>&5
     3078  ac_status=$?
     3079  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3080  (exit $ac_status); }; } &&
     3081         { ac_try='test -s conftest$ac_exeext'
     3082  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3083  (eval $ac_try) 2>&5
     3084  ac_status=$?
     3085  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3086  (exit $ac_status); }; }; then
     3087  echo "$as_me:$LINENO: result: yes" >&5
     3088echo "${ECHO_T}yes" >&6; opt_cflags="$opt_cflags $myCFLAGS"
     3089else
     3090  echo "$as_me: failed program was:" >&5
     3091sed 's/^/| /' conftest.$ac_ext >&5
     3092
     3093echo "$as_me:$LINENO: result: no" >&5
     3094echo "${ECHO_T}no" >&6
     3095fi
     3096rm -f conftest.err conftest.$ac_objext \
     3097      conftest$ac_exeext conftest.$ac_ext
     3098            CFLAGS=
     3099          ;;
     3100        esac
     3101        add_cflags="-pipe"
     3102        dbg_cflags="-g"
     3103        warn_cflags="-pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Werror "
     3104        case $build in
     3105          *-cygwin*) echo "$as_me:$LINENO: checking whether flag \"-mno-cygwin\" works" >&5
     3106echo $ECHO_N "checking whether flag \"-mno-cygwin\" works... $ECHO_C" >&6
     3107                    CFLAGS="-mno-cygwin"
     3108                    cat >conftest.$ac_ext <<_ACEOF
     3109/* confdefs.h.  */
     3110_ACEOF
     3111cat confdefs.h >>conftest.$ac_ext
     3112cat >>conftest.$ac_ext <<_ACEOF
     3113/* end confdefs.h.  */
     3114
     3115int
     3116main ()
     3117{
     3118int i=0; i++;
     3119  ;
     3120  return 0;
     3121}
     3122_ACEOF
     3123rm -f conftest.$ac_objext conftest$ac_exeext
     3124if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3125  (eval $ac_link) 2>conftest.er1
     3126  ac_status=$?
     3127  grep -v '^ *+' conftest.er1 >conftest.err
     3128  rm -f conftest.er1
     3129  cat conftest.err >&5
     3130  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3131  (exit $ac_status); } &&
     3132         { ac_try='test -z "$ac_c_werror_flag"
     3133                         || test ! -s conftest.err'
     3134  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3135  (eval $ac_try) 2>&5
     3136  ac_status=$?
     3137  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3138  (exit $ac_status); }; } &&
     3139         { ac_try='test -s conftest$ac_exeext'
     3140  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3141  (eval $ac_try) 2>&5
     3142  ac_status=$?
     3143  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3144  (exit $ac_status); }; }; then
     3145  echo "$as_me:$LINENO: result: yes" >&5
     3146echo "${ECHO_T}yes" >&6; add_cflags="-mno-cygwin $add_cflags"; use_mingw=yes
     3147else
     3148  echo "$as_me: failed program was:" >&5
     3149sed 's/^/| /' conftest.$ac_ext >&5
     3150
     3151echo "$as_me:$LINENO: result: no" >&5
     3152echo "${ECHO_T}no" >&6
     3153fi
     3154rm -f conftest.err conftest.$ac_objext \
     3155      conftest$ac_exeext conftest.$ac_ext
     3156                    CFLAGS= ;;
     3157        esac ;;
     3158    esac
     3159  fi
     3160  if test -z "$opt_cflags"; then
     3161    case $build in
     3162     *-cygwin*)
     3163      case "$CC" in
     3164      cl | */cl)
     3165             opt_cflags="-Ot1"
     3166             add_cflags="-nologo"
     3167             dbg_cflags="-Yd";;
     3168      esac;;
     3169     *-linux-*)
     3170      case "$CC" in
     3171      icc | */icc)
     3172#             AC_MSG_CHECKING([whether flag \"-fast\" works])
     3173#               CFLAGS="-fast"
     3174#               AC_TRY_RUN(,[int i=0; i++;],
     3175#                               [AC_MSG_RESULT([yes]); opt_cflags="-fast"],
     3176#                               [AC_MSG_RESULT([no]); opt_cflags="-O3 -ipo -static"])
     3177#               CFLAGS=
     3178             opt_cflags="-O3 -ip"
     3179             add_cflags="-mp -pc64"
     3180             dbg_cflags="-g"
     3181             # Check if -i_dynamic is necessary (for new glibc library)
     3182             echo "$as_me:$LINENO: checking whether flag \"-i_dynamic\" is needed" >&5
     3183echo $ECHO_N "checking whether flag \"-i_dynamic\" is needed... $ECHO_C" >&6
     3184             CFLAGS=
     3185             cat >conftest.$ac_ext <<_ACEOF
     3186/* confdefs.h.  */
     3187_ACEOF
     3188cat confdefs.h >>conftest.$ac_ext
     3189cat >>conftest.$ac_ext <<_ACEOF
     3190/* end confdefs.h.  */
     3191
     3192int
     3193main ()
     3194{
     3195int i=0; i++;
     3196  ;
     3197  return 0;
     3198}
     3199_ACEOF
     3200rm -f conftest.$ac_objext conftest$ac_exeext
     3201if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3202  (eval $ac_link) 2>conftest.er1
     3203  ac_status=$?
     3204  grep -v '^ *+' conftest.er1 >conftest.err
     3205  rm -f conftest.er1
     3206  cat conftest.err >&5
     3207  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3208  (exit $ac_status); } &&
     3209         { ac_try='test -z "$ac_c_werror_flag"
     3210                         || test ! -s conftest.err'
     3211  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3212  (eval $ac_try) 2>&5
     3213  ac_status=$?
     3214  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3215  (exit $ac_status); }; } &&
     3216         { ac_try='test -s conftest$ac_exeext'
     3217  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3218  (eval $ac_try) 2>&5
     3219  ac_status=$?
     3220  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3221  (exit $ac_status); }; }; then
     3222  echo "$as_me:$LINENO: result: apparently not" >&5
     3223echo "${ECHO_T}apparently not" >&6
     3224else
     3225  echo "$as_me: failed program was:" >&5
     3226sed 's/^/| /' conftest.$ac_ext >&5
     3227
     3228echo "$as_me:$LINENO: result: seems so" >&5
     3229echo "${ECHO_T}seems so" >&6;
     3230                               add_cflags="-i_dynamic $add_cflags"
     3231fi
     3232rm -f conftest.err conftest.$ac_objext \
     3233      conftest$ac_exeext conftest.$ac_ext
     3234             ;;
     3235      pgcc | */pgcc)
     3236             opt_cflags="-fast"
     3237             add_cflags="-Kieee -Mstabs -pc 64"
     3238             dbg_cflags="-g" ;;
     3239      esac;;
     3240    *-ibm-*)
     3241      case "$CC" in
     3242      xlc* | */xlc* | mpxlc* | */mpxlc*)
     3243             opt_cflags="-O5 -qmaxmem=-1"
     3244             add_cflags="-bmaxdata:0x80000000"
     3245             dbg_cflags="-g";;
     3246      esac;;
     3247    *-hp-*)
     3248             opt_cflags="+O4"
     3249             add_cflags="-Ae"
     3250             dbg_cflags="-g";;
     3251    *-sun-*)
     3252             opt_cflags="-O5"
     3253             dbg_cflags="-g";;
     3254    *-sgi-*)
     3255             opt_cflags="-O -OPT:Olimit=0"
     3256             dbg_cflags="-g";;
     3257    esac
     3258  fi
     3259
     3260  if test "$ac_cv_prog_cc_g" = yes && test -z "$dbg_cflags" ; then
     3261    dbg_cflags="-g"
     3262  fi
     3263
     3264  if test "$debugcompile" = "true"; then
     3265    CFLAGS="$dbg_cflags $add_cflags"
     3266  else
     3267    if test -z "$opt_cflags"; then
     3268# Try if -O option works if nothing else is set
     3269      CFLAGS="-O"
     3270      cat >conftest.$ac_ext <<_ACEOF
     3271/* confdefs.h.  */
     3272_ACEOF
     3273cat confdefs.h >>conftest.$ac_ext
     3274cat >>conftest.$ac_ext <<_ACEOF
     3275/* end confdefs.h.  */
     3276
     3277int
     3278main ()
     3279{
     3280int i=0; i++;
     3281  ;
     3282  return 0;
     3283}
     3284_ACEOF
     3285rm -f conftest.$ac_objext conftest$ac_exeext
     3286if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3287  (eval $ac_link) 2>conftest.er1
     3288  ac_status=$?
     3289  grep -v '^ *+' conftest.er1 >conftest.err
     3290  rm -f conftest.er1
     3291  cat conftest.err >&5
     3292  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3293  (exit $ac_status); } &&
     3294         { ac_try='test -z "$ac_c_werror_flag"
     3295                         || test ! -s conftest.err'
     3296  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3297  (eval $ac_try) 2>&5
     3298  ac_status=$?
     3299  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3300  (exit $ac_status); }; } &&
     3301         { ac_try='test -s conftest$ac_exeext'
     3302  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3303  (eval $ac_try) 2>&5
     3304  ac_status=$?
     3305  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3306  (exit $ac_status); }; }; then
     3307  opt_cflags="-O"
     3308else
     3309  echo "$as_me: failed program was:" >&5
     3310sed 's/^/| /' conftest.$ac_ext >&5
     3311
     3312fi
     3313rm -f conftest.err conftest.$ac_objext \
     3314      conftest$ac_exeext conftest.$ac_ext
     3315    fi
     3316    CFLAGS="$opt_cflags $add_cflags"
     3317  fi
     3318fi
     3319
     3320# Try if CFLAGS works
     3321echo "$as_me:$LINENO: checking whether CFLAGS=\"$CFLAGS\" works" >&5
     3322echo $ECHO_N "checking whether CFLAGS=\"$CFLAGS\" works... $ECHO_C" >&6
     3323cat >conftest.$ac_ext <<_ACEOF
     3324/* confdefs.h.  */
     3325_ACEOF
     3326cat confdefs.h >>conftest.$ac_ext
     3327cat >>conftest.$ac_ext <<_ACEOF
     3328/* end confdefs.h.  */
     3329
     3330int
     3331main ()
     3332{
     3333int i=0; i++;
     3334  ;
     3335  return 0;
     3336}
     3337_ACEOF
     3338rm -f conftest.$ac_objext conftest$ac_exeext
     3339if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3340  (eval $ac_link) 2>conftest.er1
     3341  ac_status=$?
     3342  grep -v '^ *+' conftest.er1 >conftest.err
     3343  rm -f conftest.er1
     3344  cat conftest.err >&5
     3345  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3346  (exit $ac_status); } &&
     3347         { ac_try='test -z "$ac_c_werror_flag"
     3348                         || test ! -s conftest.err'
     3349  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3350  (eval $ac_try) 2>&5
     3351  ac_status=$?
     3352  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3353  (exit $ac_status); }; } &&
     3354         { ac_try='test -s conftest$ac_exeext'
     3355  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3356  (eval $ac_try) 2>&5
     3357  ac_status=$?
     3358  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3359  (exit $ac_status); }; }; then
     3360  :
     3361else
     3362  echo "$as_me: failed program was:" >&5
     3363sed 's/^/| /' conftest.$ac_ext >&5
     3364
     3365CFLAGS=
     3366fi
     3367rm -f conftest.err conftest.$ac_objext \
     3368      conftest$ac_exeext conftest.$ac_ext
     3369if test -z "$CFLAGS"; then
     3370  echo "$as_me:$LINENO: result: no" >&5
     3371echo "${ECHO_T}no" >&6
     3372  { echo "$as_me:$LINENO: WARNING: This value for CFLAGS does not work.  I will now just try '-O', but you might want to set CFLAGS manually." >&5
     3373echo "$as_me: WARNING: This value for CFLAGS does not work.  I will now just try '-O', but you might want to set CFLAGS manually." >&2;}
     3374  CFLAGS='-O'
     3375  cat >conftest.$ac_ext <<_ACEOF
     3376/* confdefs.h.  */
     3377_ACEOF
     3378cat confdefs.h >>conftest.$ac_ext
     3379cat >>conftest.$ac_ext <<_ACEOF
     3380/* end confdefs.h.  */
     3381
     3382int
     3383main ()
     3384{
     3385int i=0; i++;
     3386  ;
     3387  return 0;
     3388}
     3389_ACEOF
     3390rm -f conftest.$ac_objext conftest$ac_exeext
     3391if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3392  (eval $ac_link) 2>conftest.er1
     3393  ac_status=$?
     3394  grep -v '^ *+' conftest.er1 >conftest.err
     3395  rm -f conftest.er1
     3396  cat conftest.err >&5
     3397  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3398  (exit $ac_status); } &&
     3399         { ac_try='test -z "$ac_c_werror_flag"
     3400                         || test ! -s conftest.err'
     3401  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3402  (eval $ac_try) 2>&5
     3403  ac_status=$?
     3404  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3405  (exit $ac_status); }; } &&
     3406         { ac_try='test -s conftest$ac_exeext'
     3407  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3408  (eval $ac_try) 2>&5
     3409  ac_status=$?
     3410  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3411  (exit $ac_status); }; }; then
     3412  :
     3413else
     3414  echo "$as_me: failed program was:" >&5
     3415sed 's/^/| /' conftest.$ac_ext >&5
     3416
     3417CFLAGS=
     3418fi
     3419rm -f conftest.err conftest.$ac_objext \
     3420      conftest$ac_exeext conftest.$ac_ext
     3421  if test -z "$CFLAGS"; then
     3422    echo "$as_me:$LINENO: result: no" >&5
     3423echo "${ECHO_T}no" >&6
     3424    { echo "$as_me:$LINENO: WARNING: This value for CFLAGS does not work.  I will continue with empty CFLAGS, but you might want to set CFLAGS manually." >&5
     3425echo "$as_me: WARNING: This value for CFLAGS does not work.  I will continue with empty CFLAGS, but you might want to set CFLAGS manually." >&2;}
     3426  fi
     3427else
     3428  echo "$as_me:$LINENO: result: yes" >&5
     3429echo "${ECHO_T}yes" >&6
     3430fi
     3431
     3432###################################
     3433#   Fortran 77 compiler options   #
     3434###################################
     3435
     3436ac_ext=f
     3437ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     3438ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     3439ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     3440
     3441SAVE_FFLAGS="$FFLAGS"
     3442ac_ext=f
     3443ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     3444ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     3445ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    24673446if test -n "$ac_tool_prefix"; then
    2468   for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
     3447  for ac_prog in ifort ifc pgf77 xlf fort77 f77 g77 df
    24693448  do
    24703449    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
     
    24723451echo "$as_me:$LINENO: checking for $ac_word" >&5
    24733452echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2474 if test "${ac_cv_prog_CXX+set}" = set; then
     3453if test "${ac_cv_prog_F77+set}" = set; then
    24753454  echo $ECHO_N "(cached) $ECHO_C" >&6
    24763455else
    2477   if test -n "$CXX"; then
    2478   ac_cv_prog_CXX="$CXX" # Let the user override the test.
     3456  if test -n "$F77"; then
     3457  ac_cv_prog_F77="$F77" # Let the user override the test.
    24793458else
    24803459as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     
    24853464  for ac_exec_ext in '' $ac_executable_extensions; do
    24863465  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2487     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     3466    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
    24883467    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    24893468    break 2
     
    24943473fi
    24953474fi
    2496 CXX=$ac_cv_prog_CXX
    2497 if test -n "$CXX"; then
    2498   echo "$as_me:$LINENO: result: $CXX" >&5
    2499 echo "${ECHO_T}$CXX" >&6
     3475F77=$ac_cv_prog_F77
     3476if test -n "$F77"; then
     3477  echo "$as_me:$LINENO: result: $F77" >&5
     3478echo "${ECHO_T}$F77" >&6
    25003479else
    25013480  echo "$as_me:$LINENO: result: no" >&5
     
    25033482fi
    25043483
    2505     test -n "$CXX" && break
     3484    test -n "$F77" && break
    25063485  done
    25073486fi
    2508 if test -z "$CXX"; then
    2509   ac_ct_CXX=$CXX
    2510   for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
     3487if test -z "$F77"; then
     3488  ac_ct_F77=$F77
     3489  for ac_prog in ifort ifc pgf77 xlf fort77 f77 g77 df
    25113490do
    25123491  # Extract the first word of "$ac_prog", so it can be a program name with args.
     
    25143493echo "$as_me:$LINENO: checking for $ac_word" >&5
    25153494echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    2516 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
     3495if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
    25173496  echo $ECHO_N "(cached) $ECHO_C" >&6
    25183497else
    2519   if test -n "$ac_ct_CXX"; then
    2520   ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
     3498  if test -n "$ac_ct_F77"; then
     3499  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
    25213500else
    25223501as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     
    25273506  for ac_exec_ext in '' $ac_executable_extensions; do
    25283507  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    2529     ac_cv_prog_ac_ct_CXX="$ac_prog"
     3508    ac_cv_prog_ac_ct_F77="$ac_prog"
    25303509    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    25313510    break 2
     
    25363515fi
    25373516fi
    2538 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
    2539 if test -n "$ac_ct_CXX"; then
    2540   echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
    2541 echo "${ECHO_T}$ac_ct_CXX" >&6
     3517ac_ct_F77=$ac_cv_prog_ac_ct_F77
     3518if test -n "$ac_ct_F77"; then
     3519  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
     3520echo "${ECHO_T}$ac_ct_F77" >&6
    25423521else
    25433522  echo "$as_me:$LINENO: result: no" >&5
     
    25453524fi
    25463525
    2547   test -n "$ac_ct_CXX" && break
     3526  test -n "$ac_ct_F77" && break
    25483527done
    2549 test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
    2550 
    2551   CXX=$ac_ct_CXX
     3528
     3529  F77=$ac_ct_F77
    25523530fi
    25533531
    25543532
    25553533# Provide some information about the compiler.
    2556 echo "$as_me:$LINENO:" \
    2557      "checking for C++ compiler version" >&5
     3534echo "$as_me:3534:" \
     3535     "checking for Fortran 77 compiler version" >&5
    25583536ac_compiler=`set X $ac_compile; echo $2`
    25593537{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
     
    25723550  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    25733551  (exit $ac_status); }
    2574 
    2575 echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
    2576 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
    2577 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
     3552rm -f a.out
     3553
     3554# If we don't use `.F' as extension, the preprocessor is not run on the
     3555# input file.  (Note that this only needs to work for GNU compilers.)
     3556ac_save_ext=$ac_ext
     3557ac_ext=F
     3558echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
     3559echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
     3560if test "${ac_cv_f77_compiler_gnu+set}" = set; then
    25783561  echo $ECHO_N "(cached) $ECHO_C" >&6
    25793562else
    25803563  cat >conftest.$ac_ext <<_ACEOF
    2581 /* confdefs.h.  */
    2582 _ACEOF
    2583 cat confdefs.h >>conftest.$ac_ext
    2584 cat >>conftest.$ac_ext <<_ACEOF
    2585 /* end confdefs.h.  */
    2586 
    2587 int
    2588 main ()
    2589 {
     3564      program main
    25903565#ifndef __GNUC__
    25913566       choke me
    25923567#endif
    25933568
    2594   ;
    2595   return 0;
    2596 }
     3569      end
    25973570_ACEOF
    25983571rm -f conftest.$ac_objext
     
    26053578  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    26063579  (exit $ac_status); } &&
    2607          { ac_try='test -z "$ac_cxx_werror_flag"
     3580         { ac_try='test -z "$ac_f77_werror_flag"
    26083581                         || test ! -s conftest.err'
    26093582  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     
    26263599fi
    26273600rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    2628 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
    2629 
    2630 fi
    2631 echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
    2632 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
    2633 GXX=`test $ac_compiler_gnu = yes && echo yes`
    2634 ac_test_CXXFLAGS=${CXXFLAGS+set}
    2635 ac_save_CXXFLAGS=$CXXFLAGS
    2636 CXXFLAGS="-g"
    2637 echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
    2638 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
    2639 if test "${ac_cv_prog_cxx_g+set}" = set; then
     3601ac_cv_f77_compiler_gnu=$ac_compiler_gnu
     3602
     3603fi
     3604echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
     3605echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
     3606ac_ext=$ac_save_ext
     3607ac_test_FFLAGS=${FFLAGS+set}
     3608ac_save_FFLAGS=$FFLAGS
     3609FFLAGS=
     3610echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
     3611echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
     3612if test "${ac_cv_prog_f77_g+set}" = set; then
    26403613  echo $ECHO_N "(cached) $ECHO_C" >&6
    26413614else
    2642   cat >conftest.$ac_ext <<_ACEOF
    2643 /* confdefs.h.  */
    2644 _ACEOF
    2645 cat confdefs.h >>conftest.$ac_ext
    2646 cat >>conftest.$ac_ext <<_ACEOF
    2647 /* end confdefs.h.  */
    2648 
    2649 int
    2650 main ()
    2651 {
    2652 
    2653   ;
    2654   return 0;
    2655 }
     3615  FFLAGS=-g
     3616cat >conftest.$ac_ext <<_ACEOF
     3617      program main
     3618
     3619      end
    26563620_ACEOF
    26573621rm -f conftest.$ac_objext
     
    26643628  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    26653629  (exit $ac_status); } &&
    2666          { ac_try='test -z "$ac_cxx_werror_flag"
     3630         { ac_try='test -z "$ac_f77_werror_flag"
    26673631                         || test ! -s conftest.err'
    26683632  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     
    26773641  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    26783642  (exit $ac_status); }; }; then
    2679   ac_cv_prog_cxx_g=yes
     3643  ac_cv_prog_f77_g=yes
    26803644else
    26813645  echo "$as_me: failed program was:" >&5
    26823646sed 's/^/| /' conftest.$ac_ext >&5
    26833647
    2684 ac_cv_prog_cxx_g=no
     3648ac_cv_prog_f77_g=no
    26853649fi
    26863650rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    2687 fi
    2688 echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
    2689 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
    2690 if test "$ac_test_CXXFLAGS" = set; then
    2691   CXXFLAGS=$ac_save_CXXFLAGS
    2692 elif test $ac_cv_prog_cxx_g = yes; then
    2693   if test "$GXX" = yes; then
    2694     CXXFLAGS="-g -O2"
     3651
     3652fi
     3653echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
     3654echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
     3655if test "$ac_test_FFLAGS" = set; then
     3656  FFLAGS=$ac_save_FFLAGS
     3657elif test $ac_cv_prog_f77_g = yes; then
     3658  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
     3659    FFLAGS="-g -O2"
    26953660  else
    2696     CXXFLAGS="-g"
     3661    FFLAGS="-g"
    26973662  fi
    26983663else
    2699   if test "$GXX" = yes; then
    2700     CXXFLAGS="-O2"
     3664  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
     3665    FFLAGS="-O2"
    27013666  else
    2702     CXXFLAGS=
     3667    FFLAGS=
    27033668  fi
    27043669fi
    2705 for ac_declaration in \
    2706    '' \
    2707    'extern "C" void std::exit (int) throw (); using std::exit;' \
    2708    'extern "C" void std::exit (int); using std::exit;' \
    2709    'extern "C" void exit (int) throw ();' \
    2710    'extern "C" void exit (int);' \
    2711    'void exit (int);'
    2712 do
     3670
     3671G77=`test $ac_compiler_gnu = yes && echo yes`
     3672ac_ext=f
     3673ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     3674ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     3675ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     3676
     3677FFLAGS="$SAVE_FFLAGS"
     3678
     3679if test -z "$FFLAGS"; then
     3680  add_fflags=
     3681  opt_fflags=
     3682  dbg_fflags=
     3683
     3684  if test "$G77" = "yes"; then
     3685    opt_fflags="-O3 -funroll-loops"
     3686    case $build in
     3687      i686-* )
     3688        FFLAGS="-march=i686 -mfpmath=sse -msse"
     3689        echo "$as_me:$LINENO: checking whether flags \"$FFLAGS\" work" >&5
     3690echo $ECHO_N "checking whether flags \"$FFLAGS\" work... $ECHO_C" >&6
     3691
     3692cat >conftest.$ac_ext <<_ACEOF
     3693      program main
     3694
     3695      double precision x
     3696      x = sin(1.d0)
     3697      end
     3698_ACEOF
     3699rm -f conftest.$ac_objext conftest$ac_exeext
     3700if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3701  (eval $ac_link) 2>conftest.er1
     3702  ac_status=$?
     3703  grep -v '^ *+' conftest.er1 >conftest.err
     3704  rm -f conftest.er1
     3705  cat conftest.err >&5
     3706  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3707  (exit $ac_status); } &&
     3708         { ac_try='test -z "$ac_f77_werror_flag"
     3709                         || test ! -s conftest.err'
     3710  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3711  (eval $ac_try) 2>&5
     3712  ac_status=$?
     3713  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3714  (exit $ac_status); }; } &&
     3715         { ac_try='test -s conftest$ac_exeext'
     3716  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3717  (eval $ac_try) 2>&5
     3718  ac_status=$?
     3719  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3720  (exit $ac_status); }; }; then
     3721  echo "$as_me:$LINENO: result: yes" >&5
     3722echo "${ECHO_T}yes" >&6; opt_fflags="$opt_fflags $FFLAGS"
     3723else
     3724  echo "$as_me: failed program was:" >&5
     3725sed 's/^/| /' conftest.$ac_ext >&5
     3726
     3727echo "$as_me:$LINENO: result: no" >&5
     3728echo "${ECHO_T}no" >&6
     3729fi
     3730rm -f conftest.err conftest.$ac_objext \
     3731      conftest$ac_exeext conftest.$ac_ext
     3732        FFLAGS=
     3733      ;;
     3734    esac
     3735    add_fflags="-pipe"
     3736    dbg_fflags="-g"
     3737    case $build in
     3738      *-cygwin*) echo "$as_me:$LINENO: checking whether flag \"-mno-cygwin\" works" >&5
     3739echo $ECHO_N "checking whether flag \"-mno-cygwin\" works... $ECHO_C" >&6
     3740                FFLAGS="-mno-cygwin"
     3741                cat >conftest.$ac_ext <<_ACEOF
     3742      program main
     3743      write(*,*) 'Hello world'
     3744      end
     3745_ACEOF
     3746rm -f conftest.$ac_objext conftest$ac_exeext
     3747if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3748  (eval $ac_link) 2>conftest.er1
     3749  ac_status=$?
     3750  grep -v '^ *+' conftest.er1 >conftest.err
     3751  rm -f conftest.er1
     3752  cat conftest.err >&5
     3753  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3754  (exit $ac_status); } &&
     3755         { ac_try='test -z "$ac_f77_werror_flag"
     3756                         || test ! -s conftest.err'
     3757  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3758  (eval $ac_try) 2>&5
     3759  ac_status=$?
     3760  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3761  (exit $ac_status); }; } &&
     3762         { ac_try='test -s conftest$ac_exeext'
     3763  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3764  (eval $ac_try) 2>&5
     3765  ac_status=$?
     3766  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3767  (exit $ac_status); }; }; then
     3768  echo "$as_me:$LINENO: result: yes" >&5
     3769echo "${ECHO_T}yes" >&6; add_fflags="-mno-cygwin $add_fflags"
     3770else
     3771  echo "$as_me: failed program was:" >&5
     3772sed 's/^/| /' conftest.$ac_ext >&5
     3773
     3774echo "$as_me:$LINENO: result: no" >&5
     3775echo "${ECHO_T}no" >&6
     3776fi
     3777rm -f conftest.err conftest.$ac_objext \
     3778      conftest$ac_exeext conftest.$ac_ext
     3779                FFLAGS= ;;
     3780    esac
     3781  else
     3782    case $build in
     3783    *-cygwin*)
     3784      case $F77 in
     3785      ifort | */ifort)
     3786             opt_fflags="-O3"
     3787             add_fflags="-nologo -Qprec -fpp"
     3788             dbg_fflags="-debug" ;;
     3789      esac;;
     3790    *-linux-*)
     3791      case $F77 in
     3792      ifc | */ifc | ifort | */ifort)
     3793#             AC_MSG_CHECKING([whether flag \"-fast\" works])
     3794#               FFLAGS="-fast"
     3795#               AC_TRY_RUN(,[      write(*,*) 'Hello world'],
     3796#                               [AC_MSG_RESULT([yes]); opt_fflags="-fast"],
     3797#                               [AC_MSG_RESULT([no]); opt_fflags="-O3 -ipo -static"])
     3798#               FFLAGS=
     3799             opt_fflags="-O3 -ip"
     3800             add_fflags="-mp -pc64 -cm -w90 -w95"
     3801             dbg_fflags="-g -CA -CB -CS -CU"
     3802             # Check if -i_dynamic is necessary (for new glibc library)
     3803             echo "$as_me:$LINENO: checking whether flag \"-i_dynamic\" is needed" >&5
     3804echo $ECHO_N "checking whether flag \"-i_dynamic\" is needed... $ECHO_C" >&6
     3805             FFLAGS=
     3806             cat >conftest.$ac_ext <<_ACEOF
     3807      program main
     3808      write(*,*) 'Hello world'
     3809      end
     3810_ACEOF
     3811rm -f conftest.$ac_objext conftest$ac_exeext
     3812if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3813  (eval $ac_link) 2>conftest.er1
     3814  ac_status=$?
     3815  grep -v '^ *+' conftest.er1 >conftest.err
     3816  rm -f conftest.er1
     3817  cat conftest.err >&5
     3818  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3819  (exit $ac_status); } &&
     3820         { ac_try='test -z "$ac_f77_werror_flag"
     3821                         || test ! -s conftest.err'
     3822  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3823  (eval $ac_try) 2>&5
     3824  ac_status=$?
     3825  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3826  (exit $ac_status); }; } &&
     3827         { ac_try='test -s conftest$ac_exeext'
     3828  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3829  (eval $ac_try) 2>&5
     3830  ac_status=$?
     3831  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3832  (exit $ac_status); }; }; then
     3833  echo "$as_me:$LINENO: result: apparently not" >&5
     3834echo "${ECHO_T}apparently not" >&6
     3835else
     3836  echo "$as_me: failed program was:" >&5
     3837sed 's/^/| /' conftest.$ac_ext >&5
     3838
     3839echo "$as_me:$LINENO: result: seems so" >&5
     3840echo "${ECHO_T}seems so" >&6;
     3841                               add_fflags="-i_dynamic $add_fflags"
     3842fi
     3843rm -f conftest.err conftest.$ac_objext \
     3844      conftest$ac_exeext conftest.$ac_ext
     3845             ;;
     3846      pgf77 | */pgf77)
     3847             opt_fflags="-fast"
     3848             add_fflags="-Kieee -Mstabs -pc 64"
     3849             dbg_fflags="-g" ;;
     3850      esac;;
     3851    *-ibm-*)
     3852      case $F77 in
     3853      xlf* | */xlf* | mpxlf* | */mpxlf* )
     3854             opt_fflags="-O5 -qmaxmem=-1"
     3855             add_fflags="-bmaxdata:0x80000000"
     3856             dbg_fflags="-g -C";;
     3857      esac;;
     3858    *-hp-*)
     3859             opt_fflags="+O2"
     3860             add_fflags="+U77"
     3861             dbg_fflags="-C -g";;
     3862    *-sun-*)
     3863             opt_fflags="-O5"
     3864             dbg_fflags="-g";;
     3865    *-sgi-*)
     3866             opt_fflags="-O5 -OPT:Olimit=0"
     3867             dbg_fflags="-g";;
     3868    esac
     3869  fi
     3870
     3871  if test "$ac_cv_prog_f77_g" = yes && test -z "$dbg_fflags" ; then
     3872    dbg_fflags="-g"
     3873  fi
     3874
     3875  if test "$debugcompile" = true; then
     3876    FFLAGS="$dbg_fflags $add_fflags"
     3877  else
     3878    if test -z "$opt_fflags"; then
     3879# Try if -O option works if nothing else is set
     3880      echo "$as_me:$LINENO: checking whether FFLAGS=\"-O\" works" >&5
     3881echo $ECHO_N "checking whether FFLAGS=\"-O\" works... $ECHO_C" >&6
     3882      FFLAGS=-O
     3883      cat >conftest.$ac_ext <<_ACEOF
     3884      program main
     3885      integer i
     3886      end
     3887_ACEOF
     3888rm -f conftest.$ac_objext conftest$ac_exeext
     3889if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3890  (eval $ac_link) 2>conftest.er1
     3891  ac_status=$?
     3892  grep -v '^ *+' conftest.er1 >conftest.err
     3893  rm -f conftest.er1
     3894  cat conftest.err >&5
     3895  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3896  (exit $ac_status); } &&
     3897         { ac_try='test -z "$ac_f77_werror_flag"
     3898                         || test ! -s conftest.err'
     3899  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3900  (eval $ac_try) 2>&5
     3901  ac_status=$?
     3902  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3903  (exit $ac_status); }; } &&
     3904         { ac_try='test -s conftest$ac_exeext'
     3905  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3906  (eval $ac_try) 2>&5
     3907  ac_status=$?
     3908  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3909  (exit $ac_status); }; }; then
     3910  echo "$as_me:$LINENO: result: yes" >&5
     3911echo "${ECHO_T}yes" >&6; opt_fflags="-O"
     3912else
     3913  echo "$as_me: failed program was:" >&5
     3914sed 's/^/| /' conftest.$ac_ext >&5
     3915
     3916echo "$as_me:$LINENO: result: no" >&5
     3917echo "${ECHO_T}no" >&6
     3918fi
     3919rm -f conftest.err conftest.$ac_objext \
     3920      conftest$ac_exeext conftest.$ac_ext
     3921    fi
     3922    FFLAGS="$opt_fflags $add_fflags"
     3923  fi
     3924fi
     3925
     3926# Try if FFLAGS works
     3927echo "$as_me:$LINENO: checking whether FFLAGS=\"$FFLAGS\" works" >&5
     3928echo $ECHO_N "checking whether FFLAGS=\"$FFLAGS\" works... $ECHO_C" >&6
     3929cat >conftest.$ac_ext <<_ACEOF
     3930      program main
     3931      integer i
     3932      end
     3933_ACEOF
     3934rm -f conftest.$ac_objext conftest$ac_exeext
     3935if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3936  (eval $ac_link) 2>conftest.er1
     3937  ac_status=$?
     3938  grep -v '^ *+' conftest.er1 >conftest.err
     3939  rm -f conftest.er1
     3940  cat conftest.err >&5
     3941  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3942  (exit $ac_status); } &&
     3943         { ac_try='test -z "$ac_f77_werror_flag"
     3944                         || test ! -s conftest.err'
     3945  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3946  (eval $ac_try) 2>&5
     3947  ac_status=$?
     3948  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3949  (exit $ac_status); }; } &&
     3950         { ac_try='test -s conftest$ac_exeext'
     3951  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3952  (eval $ac_try) 2>&5
     3953  ac_status=$?
     3954  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3955  (exit $ac_status); }; }; then
     3956  :
     3957else
     3958  echo "$as_me: failed program was:" >&5
     3959sed 's/^/| /' conftest.$ac_ext >&5
     3960
     3961FFLAGS=
     3962fi
     3963rm -f conftest.err conftest.$ac_objext \
     3964      conftest$ac_exeext conftest.$ac_ext
     3965if test -z "$FFLAGS"; then
     3966  echo "$as_me:$LINENO: result: no" >&5
     3967echo "${ECHO_T}no" >&6
     3968  { echo "$as_me:$LINENO: WARNING: This value for FFLAGS does not work.  I will now jst try '-O', but you might want to set FFLAGS manually." >&5
     3969echo "$as_me: WARNING: This value for FFLAGS does not work.  I will now jst try '-O', but you might want to set FFLAGS manually." >&2;}
     3970  FFLAGS='-O'
    27133971  cat >conftest.$ac_ext <<_ACEOF
    2714 /* confdefs.h.  */
    2715 _ACEOF
    2716 cat confdefs.h >>conftest.$ac_ext
    2717 cat >>conftest.$ac_ext <<_ACEOF
    2718 /* end confdefs.h.  */
    2719 $ac_declaration
    2720 #include <stdlib.h>
    2721 int
    2722 main ()
    2723 {
    2724 exit (42);
    2725   ;
    2726   return 0;
    2727 }
     3972      program main
     3973      integer i
     3974      end
     3975_ACEOF
     3976rm -f conftest.$ac_objext conftest$ac_exeext
     3977if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     3978  (eval $ac_link) 2>conftest.er1
     3979  ac_status=$?
     3980  grep -v '^ *+' conftest.er1 >conftest.err
     3981  rm -f conftest.er1
     3982  cat conftest.err >&5
     3983  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3984  (exit $ac_status); } &&
     3985         { ac_try='test -z "$ac_f77_werror_flag"
     3986                         || test ! -s conftest.err'
     3987  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3988  (eval $ac_try) 2>&5
     3989  ac_status=$?
     3990  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3991  (exit $ac_status); }; } &&
     3992         { ac_try='test -s conftest$ac_exeext'
     3993  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     3994  (eval $ac_try) 2>&5
     3995  ac_status=$?
     3996  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     3997  (exit $ac_status); }; }; then
     3998  :
     3999else
     4000  echo "$as_me: failed program was:" >&5
     4001sed 's/^/| /' conftest.$ac_ext >&5
     4002
     4003FFLAGS=
     4004fi
     4005rm -f conftest.err conftest.$ac_objext \
     4006      conftest$ac_exeext conftest.$ac_ext
     4007  if test -z "$FFLAGS"; then
     4008    echo "$as_me:$LINENO: result: no" >&5
     4009echo "${ECHO_T}no" >&6
     4010    { echo "$as_me:$LINENO: WARNING: This value for FFLAGS does not work.  I will continue with empty FFLAGS, but you might want to set FFLAGS manually." >&5
     4011echo "$as_me: WARNING: This value for FFLAGS does not work.  I will continue with empty FFLAGS, but you might want to set FFLAGS manually." >&2;}
     4012  fi
     4013else
     4014  echo "$as_me:$LINENO: result: yes" >&5
     4015echo "${ECHO_T}yes" >&6
     4016fi
     4017
     4018ac_ext=f
     4019ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4020ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4021ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4022echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5
     4023echo $ECHO_N "checking how to get verbose linking output from $F77... $ECHO_C" >&6
     4024if test "${ac_cv_prog_f77_v+set}" = set; then
     4025  echo $ECHO_N "(cached) $ECHO_C" >&6
     4026else
     4027  cat >conftest.$ac_ext <<_ACEOF
     4028      program main
     4029
     4030      end
    27284031_ACEOF
    27294032rm -f conftest.$ac_objext
     
    27364039  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    27374040  (exit $ac_status); } &&
    2738          { ac_try='test -z "$ac_cxx_werror_flag"
     4041         { ac_try='test -z "$ac_f77_werror_flag"
    27394042                         || test ! -s conftest.err'
    27404043  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     
    27494052  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    27504053  (exit $ac_status); }; }; then
    2751   :
     4054  ac_cv_prog_f77_v=
     4055# Try some options frequently used verbose output
     4056for ac_verb in -v -verbose --verbose -V -\#\#\#; do
     4057  cat >conftest.$ac_ext <<_ACEOF
     4058      program main
     4059
     4060      end
     4061_ACEOF
     4062
     4063# Compile and link our simple test program by passing a flag (argument
     4064# 1 to this macro) to the Fortran compiler in order to get
     4065# "verbose" output that we can then parse for the Fortran linker
     4066# flags.
     4067ac_save_FFLAGS=$FFLAGS
     4068FFLAGS="$FFLAGS $ac_verb"
     4069(eval echo $as_me:4069: \"$ac_link\") >&5
     4070ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
     4071echo "$ac_f77_v_output" >&5
     4072FFLAGS=$ac_save_FFLAGS
     4073
     4074rm -f conftest*
     4075
     4076# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
     4077# /foo, /bar, and /baz are search directories for the Fortran linker.
     4078# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
     4079ac_f77_v_output="`echo $ac_f77_v_output |
     4080        grep 'LPATH is:' |
     4081        sed 's,.*LPATH is\(: *[^ ]*\).*,\1,;s,: */, -L/,g'` $ac_f77_v_output"
     4082
     4083case $ac_f77_v_output in
     4084  # If we are using xlf then replace all the commas with spaces.
     4085  *xlfentry*)
     4086    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
     4087
     4088  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
     4089  # $LIBS confuse us, and the libraries appear later in the output anyway).
     4090  *mGLOB_options_string*)
     4091    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/\"-mGLOB[^\"]*\"/ /g'` ;;
     4092
     4093  # If we are using Cray Fortran then delete quotes.
     4094  # Use "\"" instead of '"' for font-lock-mode.
     4095  # FIXME: a more general fix for quoted arguments with spaces?
     4096  *cft90*)
     4097    ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"` ;;
     4098esac
     4099
     4100
     4101  # look for -l* and *.a constructs in the output
     4102  for ac_arg in $ac_f77_v_output; do
     4103     case $ac_arg in
     4104        [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
     4105          ac_cv_prog_f77_v=$ac_verb
     4106          break 2 ;;
     4107     esac
     4108  done
     4109done
     4110if test -z "$ac_cv_prog_f77_v"; then
     4111   { echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5
     4112echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
     4113fi
    27524114else
    27534115  echo "$as_me: failed program was:" >&5
    27544116sed 's/^/| /' conftest.$ac_ext >&5
    27554117
    2756 continue
     4118{ echo "$as_me:$LINENO: WARNING: compilation failed" >&5
     4119echo "$as_me: WARNING: compilation failed" >&2;}
    27574120fi
    27584121rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    2759   cat >conftest.$ac_ext <<_ACEOF
    2760 /* confdefs.h.  */
    2761 _ACEOF
    2762 cat confdefs.h >>conftest.$ac_ext
    2763 cat >>conftest.$ac_ext <<_ACEOF
    2764 /* end confdefs.h.  */
    2765 $ac_declaration
    2766 int
    2767 main ()
    2768 {
    2769 exit (42);
    2770   ;
    2771   return 0;
    2772 }
    2773 _ACEOF
    2774 rm -f conftest.$ac_objext
    2775 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    2776   (eval $ac_compile) 2>conftest.er1
    2777   ac_status=$?
    2778   grep -v '^ *+' conftest.er1 >conftest.err
    2779   rm -f conftest.er1
    2780   cat conftest.err >&5
    2781   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2782   (exit $ac_status); } &&
    2783          { ac_try='test -z "$ac_cxx_werror_flag"
    2784                          || test ! -s conftest.err'
    2785   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    2786   (eval $ac_try) 2>&5
    2787   ac_status=$?
    2788   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2789   (exit $ac_status); }; } &&
    2790          { ac_try='test -s conftest.$ac_objext'
    2791   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    2792   (eval $ac_try) 2>&5
    2793   ac_status=$?
    2794   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    2795   (exit $ac_status); }; }; then
    2796   break
    2797 else
    2798   echo "$as_me: failed program was:" >&5
    2799 sed 's/^/| /' conftest.$ac_ext >&5
    2800 
    2801 fi
    2802 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     4122
     4123fi
     4124echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5
     4125echo "${ECHO_T}$ac_cv_prog_f77_v" >&6
     4126echo "$as_me:$LINENO: checking for Fortran libraries of $F77" >&5
     4127echo $ECHO_N "checking for Fortran libraries of $F77... $ECHO_C" >&6
     4128if test "${ac_cv_f77_libs+set}" = set; then
     4129  echo $ECHO_N "(cached) $ECHO_C" >&6
     4130else
     4131  if test "x$FLIBS" != "x"; then
     4132  ac_cv_f77_libs="$FLIBS" # Let the user override the test.
     4133else
     4134
     4135cat >conftest.$ac_ext <<_ACEOF
     4136      program main
     4137
     4138      end
     4139_ACEOF
     4140
     4141# Compile and link our simple test program by passing a flag (argument
     4142# 1 to this macro) to the Fortran compiler in order to get
     4143# "verbose" output that we can then parse for the Fortran linker
     4144# flags.
     4145ac_save_FFLAGS=$FFLAGS
     4146FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
     4147(eval echo $as_me:4147: \"$ac_link\") >&5
     4148ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
     4149echo "$ac_f77_v_output" >&5
     4150FFLAGS=$ac_save_FFLAGS
     4151
     4152rm -f conftest*
     4153
     4154# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
     4155# /foo, /bar, and /baz are search directories for the Fortran linker.
     4156# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
     4157ac_f77_v_output="`echo $ac_f77_v_output |
     4158        grep 'LPATH is:' |
     4159        sed 's,.*LPATH is\(: *[^ ]*\).*,\1,;s,: */, -L/,g'` $ac_f77_v_output"
     4160
     4161case $ac_f77_v_output in
     4162  # If we are using xlf then replace all the commas with spaces.
     4163  *xlfentry*)
     4164    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
     4165
     4166  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
     4167  # $LIBS confuse us, and the libraries appear later in the output anyway).
     4168  *mGLOB_options_string*)
     4169    ac_f77_v_output=`echo $ac_f77_v_output | sed 's/\"-mGLOB[^\"]*\"/ /g'` ;;
     4170
     4171  # If we are using Cray Fortran then delete quotes.
     4172  # Use "\"" instead of '"' for font-lock-mode.
     4173  # FIXME: a more general fix for quoted arguments with spaces?
     4174  *cft90*)
     4175    ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"` ;;
     4176esac
     4177
     4178
     4179
     4180ac_cv_f77_libs=
     4181
     4182# Save positional arguments (if any)
     4183ac_save_positional="$@"
     4184
     4185set X $ac_f77_v_output
     4186while test $# != 1; do
     4187  shift
     4188  ac_arg=$1
     4189  case $ac_arg in
     4190        [\\/]*.a | ?:[\\/]*.a)
     4191            ac_exists=false
     4192  for ac_i in $ac_cv_f77_libs; do
     4193    if test x"$ac_arg" = x"$ac_i"; then
     4194      ac_exists=true
     4195      break
     4196    fi
     4197  done
     4198
     4199  if test x"$ac_exists" = xtrue; then
     4200  :
     4201else
     4202  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
     4203fi
     4204
     4205          ;;
     4206        -bI:*)
     4207            ac_exists=false
     4208  for ac_i in $ac_cv_f77_libs; do
     4209    if test x"$ac_arg" = x"$ac_i"; then
     4210      ac_exists=true
     4211      break
     4212    fi
     4213  done
     4214
     4215  if test x"$ac_exists" = xtrue; then
     4216  :
     4217else
     4218  if test "$ac_compiler_gnu" = yes; then
     4219  for ac_link_opt in $ac_arg; do
     4220    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
     4221  done
     4222else
     4223  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
     4224fi
     4225fi
     4226
     4227          ;;
     4228          # Ignore these flags.
     4229        -lang* | -lcrt*.o | -lc | -lgcc | -libmil | -LANG:=*)
     4230          ;;
     4231        -lkernel32)
     4232          test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
     4233          ;;
     4234        -[LRuY])
     4235          # These flags, when seen by themselves, take an argument.
     4236          # We remove the space between option and argument and re-iterate
     4237          # unless we find an empty arg or a new option (starting with -)
     4238          case $2 in
     4239             "" | -*);;
     4240             *)
     4241                ac_arg="$ac_arg$2"
     4242                shift; shift
     4243                set X $ac_arg "$@"
     4244                ;;
     4245          esac
     4246          ;;
     4247        -YP,*)
     4248          for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
     4249              ac_exists=false
     4250  for ac_i in $ac_cv_f77_libs; do
     4251    if test x"$ac_j" = x"$ac_i"; then
     4252      ac_exists=true
     4253      break
     4254    fi
     4255  done
     4256
     4257  if test x"$ac_exists" = xtrue; then
     4258  :
     4259else
     4260  ac_arg="$ac_arg $ac_j"
     4261                               ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
     4262fi
     4263
     4264          done
     4265          ;;
     4266        -[lLR]*)
     4267            ac_exists=false
     4268  for ac_i in $ac_cv_f77_libs; do
     4269    if test x"$ac_arg" = x"$ac_i"; then
     4270      ac_exists=true
     4271      break
     4272    fi
     4273  done
     4274
     4275  if test x"$ac_exists" = xtrue; then
     4276  :
     4277else
     4278  ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
     4279fi
     4280
     4281          ;;
     4282          # Ignore everything else.
     4283  esac
    28034284done
    2804 rm -f conftest*
    2805 if test -n "$ac_declaration"; then
    2806   echo '#ifdef __cplusplus' >>confdefs.h
    2807   echo $ac_declaration      >>confdefs.h
    2808   echo '#endif'             >>confdefs.h
    2809 fi
    2810 
    2811 ac_ext=c
     4285# restore positional arguments
     4286set X $ac_save_positional; shift
     4287
     4288# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
     4289# then we insist that the "run path" must be an absolute path (i.e. it
     4290# must begin with a "/").
     4291case `(uname -sr) 2>/dev/null` in
     4292   "SunOS 5"*)
     4293      ac_ld_run_path=`echo $ac_f77_v_output |
     4294                        sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
     4295      test "x$ac_ld_run_path" != x &&
     4296        if test "$ac_compiler_gnu" = yes; then
     4297  for ac_link_opt in $ac_ld_run_path; do
     4298    ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
     4299  done
     4300else
     4301  ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
     4302fi
     4303      ;;
     4304esac
     4305fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
     4306
     4307fi
     4308echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5
     4309echo "${ECHO_T}$ac_cv_f77_libs" >&6
     4310FLIBS="$ac_cv_f77_libs"
     4311
     4312
     4313ac_ext=f
     4314ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4315ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4316ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4317
     4318ac_ext=f
     4319ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4320ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4321ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4322
     4323echo "$as_me:$LINENO: checking for dummy main to link with Fortran libraries" >&5
     4324echo $ECHO_N "checking for dummy main to link with Fortran libraries... $ECHO_C" >&6
     4325if test "${ac_cv_f77_dummy_main+set}" = set; then
     4326  echo $ECHO_N "(cached) $ECHO_C" >&6
     4327else
     4328  ac_f77_dm_save_LIBS=$LIBS
     4329 LIBS="$LIBS $FLIBS"
     4330 ac_fortran_dm_var=F77_DUMMY_MAIN
     4331 ac_ext=c
    28124332ac_cpp='$CPP $CPPFLAGS'
    28134333ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     
    28154335ac_compiler_gnu=$ac_cv_c_compiler_gnu
    28164336
    2817 CXXFLAGS="$SAVE_CXXFLAGS"
     4337 # First, try linking without a dummy main:
     4338 cat >conftest.$ac_ext <<_ACEOF
     4339/* confdefs.h.  */
     4340_ACEOF
     4341cat confdefs.h >>conftest.$ac_ext
     4342cat >>conftest.$ac_ext <<_ACEOF
     4343/* end confdefs.h.  */
     4344
     4345#ifdef F77_DUMMY_MAIN
     4346
     4347#  ifdef __cplusplus
     4348     extern "C"
     4349#  endif
     4350   int F77_DUMMY_MAIN() { return 1; }
     4351
     4352#endif
     4353int
     4354main ()
     4355{
     4356
     4357  ;
     4358  return 0;
     4359}
     4360_ACEOF
     4361rm -f conftest.$ac_objext conftest$ac_exeext
     4362if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4363  (eval $ac_link) 2>conftest.er1
     4364  ac_status=$?
     4365  grep -v '^ *+' conftest.er1 >conftest.err
     4366  rm -f conftest.er1
     4367  cat conftest.err >&5
     4368  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4369  (exit $ac_status); } &&
     4370         { ac_try='test -z "$ac_c_werror_flag"
     4371                         || test ! -s conftest.err'
     4372  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4373  (eval $ac_try) 2>&5
     4374  ac_status=$?
     4375  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4376  (exit $ac_status); }; } &&
     4377         { ac_try='test -s conftest$ac_exeext'
     4378  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4379  (eval $ac_try) 2>&5
     4380  ac_status=$?
     4381  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4382  (exit $ac_status); }; }; then
     4383  ac_cv_fortran_dummy_main=none
     4384else
     4385  echo "$as_me: failed program was:" >&5
     4386sed 's/^/| /' conftest.$ac_ext >&5
     4387
     4388ac_cv_fortran_dummy_main=unknown
     4389fi
     4390rm -f conftest.err conftest.$ac_objext \
     4391      conftest$ac_exeext conftest.$ac_ext
     4392
     4393 if test $ac_cv_fortran_dummy_main = unknown; then
     4394   for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
     4395     cat >conftest.$ac_ext <<_ACEOF
     4396/* confdefs.h.  */
     4397_ACEOF
     4398cat confdefs.h >>conftest.$ac_ext
     4399cat >>conftest.$ac_ext <<_ACEOF
     4400/* end confdefs.h.  */
     4401#define $ac_fortran_dm_var $ac_func
     4402#ifdef F77_DUMMY_MAIN
     4403
     4404#  ifdef __cplusplus
     4405     extern "C"
     4406#  endif
     4407   int F77_DUMMY_MAIN() { return 1; }
     4408
     4409#endif
     4410int
     4411main ()
     4412{
     4413
     4414  ;
     4415  return 0;
     4416}
     4417_ACEOF
     4418rm -f conftest.$ac_objext conftest$ac_exeext
     4419if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4420  (eval $ac_link) 2>conftest.er1
     4421  ac_status=$?
     4422  grep -v '^ *+' conftest.er1 >conftest.err
     4423  rm -f conftest.er1
     4424  cat conftest.err >&5
     4425  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4426  (exit $ac_status); } &&
     4427         { ac_try='test -z "$ac_c_werror_flag"
     4428                         || test ! -s conftest.err'
     4429  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4430  (eval $ac_try) 2>&5
     4431  ac_status=$?
     4432  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4433  (exit $ac_status); }; } &&
     4434         { ac_try='test -s conftest$ac_exeext'
     4435  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4436  (eval $ac_try) 2>&5
     4437  ac_status=$?
     4438  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4439  (exit $ac_status); }; }; then
     4440  ac_cv_fortran_dummy_main=$ac_func; break
     4441else
     4442  echo "$as_me: failed program was:" >&5
     4443sed 's/^/| /' conftest.$ac_ext >&5
     4444
     4445fi
     4446rm -f conftest.err conftest.$ac_objext \
     4447      conftest$ac_exeext conftest.$ac_ext
     4448   done
     4449 fi
     4450 ac_ext=f
     4451ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4452ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4453ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4454 ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main
     4455 rm -f conftest*
     4456 LIBS=$ac_f77_dm_save_LIBS
     4457
     4458fi
     4459echo "$as_me:$LINENO: result: $ac_cv_f77_dummy_main" >&5
     4460echo "${ECHO_T}$ac_cv_f77_dummy_main" >&6
     4461F77_DUMMY_MAIN=$ac_cv_f77_dummy_main
     4462if test "$F77_DUMMY_MAIN" != unknown; then
     4463  if test $F77_DUMMY_MAIN != none; then
     4464
     4465cat >>confdefs.h <<_ACEOF
     4466#define F77_DUMMY_MAIN $F77_DUMMY_MAIN
     4467_ACEOF
     4468
     4469  if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then
     4470
     4471cat >>confdefs.h <<\_ACEOF
     4472#define FC_DUMMY_MAIN_EQ_F77 1
     4473_ACEOF
     4474
     4475  fi
     4476fi
     4477else
     4478  { { echo "$as_me:$LINENO: error: linking to Fortran libraries from C fails
     4479See \`config.log' for more details." >&5
     4480echo "$as_me: error: linking to Fortran libraries from C fails
     4481See \`config.log' for more details." >&2;}
     4482   { (exit 1); exit 1; }; }
     4483fi
     4484
     4485
     4486ac_ext=f
     4487ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4488ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4489ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4490
     4491ac_ext=f
     4492ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4493ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4494ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4495echo "$as_me:$LINENO: checking for Fortran name-mangling scheme" >&5
     4496echo $ECHO_N "checking for Fortran name-mangling scheme... $ECHO_C" >&6
     4497if test "${ac_cv_f77_mangling+set}" = set; then
     4498  echo $ECHO_N "(cached) $ECHO_C" >&6
     4499else
     4500  cat >conftest.$ac_ext <<_ACEOF
     4501      subroutine foobar()
     4502      return
     4503      end
     4504      subroutine foo_bar()
     4505      return
     4506      end
     4507_ACEOF
     4508rm -f conftest.$ac_objext
     4509if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     4510  (eval $ac_compile) 2>conftest.er1
     4511  ac_status=$?
     4512  grep -v '^ *+' conftest.er1 >conftest.err
     4513  rm -f conftest.er1
     4514  cat conftest.err >&5
     4515  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4516  (exit $ac_status); } &&
     4517         { ac_try='test -z "$ac_f77_werror_flag"
     4518                         || test ! -s conftest.err'
     4519  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4520  (eval $ac_try) 2>&5
     4521  ac_status=$?
     4522  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4523  (exit $ac_status); }; } &&
     4524         { ac_try='test -s conftest.$ac_objext'
     4525  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4526  (eval $ac_try) 2>&5
     4527  ac_status=$?
     4528  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4529  (exit $ac_status); }; }; then
     4530  mv conftest.$ac_objext cfortran_test.$ac_objext
     4531
     4532  ac_save_LIBS=$LIBS
     4533  LIBS="cfortran_test.$ac_objext $LIBS $FLIBS"
     4534
     4535  ac_ext=c
     4536ac_cpp='$CPP $CPPFLAGS'
     4537ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     4538ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4539ac_compiler_gnu=$ac_cv_c_compiler_gnu
     4540  ac_success=no
     4541  for ac_foobar in foobar FOOBAR; do
     4542    for ac_underscore in "" "_"; do
     4543      ac_func="$ac_foobar$ac_underscore"
     4544      cat >conftest.$ac_ext <<_ACEOF
     4545/* confdefs.h.  */
     4546_ACEOF
     4547cat confdefs.h >>conftest.$ac_ext
     4548cat >>conftest.$ac_ext <<_ACEOF
     4549/* end confdefs.h.  */
     4550
     4551/* Override any gcc2 internal prototype to avoid an error.  */
     4552#ifdef __cplusplus
     4553extern "C"
     4554#endif
     4555/* We use char because int might match the return type of a gcc2
     4556   builtin and then its argument prototype would still apply.  */
     4557char $ac_func ();
     4558#ifdef F77_DUMMY_MAIN
     4559
     4560#  ifdef __cplusplus
     4561     extern "C"
     4562#  endif
     4563   int F77_DUMMY_MAIN() { return 1; }
     4564
     4565#endif
     4566int
     4567main ()
     4568{
     4569$ac_func ();
     4570  ;
     4571  return 0;
     4572}
     4573_ACEOF
     4574rm -f conftest.$ac_objext conftest$ac_exeext
     4575if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4576  (eval $ac_link) 2>conftest.er1
     4577  ac_status=$?
     4578  grep -v '^ *+' conftest.er1 >conftest.err
     4579  rm -f conftest.er1
     4580  cat conftest.err >&5
     4581  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4582  (exit $ac_status); } &&
     4583         { ac_try='test -z "$ac_c_werror_flag"
     4584                         || test ! -s conftest.err'
     4585  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4586  (eval $ac_try) 2>&5
     4587  ac_status=$?
     4588  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4589  (exit $ac_status); }; } &&
     4590         { ac_try='test -s conftest$ac_exeext'
     4591  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4592  (eval $ac_try) 2>&5
     4593  ac_status=$?
     4594  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4595  (exit $ac_status); }; }; then
     4596  ac_success=yes; break 2
     4597else
     4598  echo "$as_me: failed program was:" >&5
     4599sed 's/^/| /' conftest.$ac_ext >&5
     4600
     4601fi
     4602rm -f conftest.err conftest.$ac_objext \
     4603      conftest$ac_exeext conftest.$ac_ext
     4604    done
     4605  done
     4606  ac_ext=f
     4607ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4608ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4609ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4610
     4611  if test "$ac_success" = "yes"; then
     4612     case $ac_foobar in
     4613        foobar)
     4614           ac_case=lower
     4615           ac_foo_bar=foo_bar
     4616           ;;
     4617        FOOBAR)
     4618           ac_case=upper
     4619           ac_foo_bar=FOO_BAR
     4620           ;;
     4621     esac
     4622
     4623     ac_ext=c
     4624ac_cpp='$CPP $CPPFLAGS'
     4625ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
     4626ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4627ac_compiler_gnu=$ac_cv_c_compiler_gnu
     4628     ac_success_extra=no
     4629     for ac_extra in "" "_"; do
     4630        ac_func="$ac_foo_bar$ac_underscore$ac_extra"
     4631        cat >conftest.$ac_ext <<_ACEOF
     4632/* confdefs.h.  */
     4633_ACEOF
     4634cat confdefs.h >>conftest.$ac_ext
     4635cat >>conftest.$ac_ext <<_ACEOF
     4636/* end confdefs.h.  */
     4637
     4638/* Override any gcc2 internal prototype to avoid an error.  */
     4639#ifdef __cplusplus
     4640extern "C"
     4641#endif
     4642/* We use char because int might match the return type of a gcc2
     4643   builtin and then its argument prototype would still apply.  */
     4644char $ac_func ();
     4645#ifdef F77_DUMMY_MAIN
     4646
     4647#  ifdef __cplusplus
     4648     extern "C"
     4649#  endif
     4650   int F77_DUMMY_MAIN() { return 1; }
     4651
     4652#endif
     4653int
     4654main ()
     4655{
     4656$ac_func ();
     4657  ;
     4658  return 0;
     4659}
     4660_ACEOF
     4661rm -f conftest.$ac_objext conftest$ac_exeext
     4662if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     4663  (eval $ac_link) 2>conftest.er1
     4664  ac_status=$?
     4665  grep -v '^ *+' conftest.er1 >conftest.err
     4666  rm -f conftest.er1
     4667  cat conftest.err >&5
     4668  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4669  (exit $ac_status); } &&
     4670         { ac_try='test -z "$ac_c_werror_flag"
     4671                         || test ! -s conftest.err'
     4672  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4673  (eval $ac_try) 2>&5
     4674  ac_status=$?
     4675  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4676  (exit $ac_status); }; } &&
     4677         { ac_try='test -s conftest$ac_exeext'
     4678  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     4679  (eval $ac_try) 2>&5
     4680  ac_status=$?
     4681  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     4682  (exit $ac_status); }; }; then
     4683  ac_success_extra=yes; break
     4684else
     4685  echo "$as_me: failed program was:" >&5
     4686sed 's/^/| /' conftest.$ac_ext >&5
     4687
     4688fi
     4689rm -f conftest.err conftest.$ac_objext \
     4690      conftest$ac_exeext conftest.$ac_ext
     4691     done
     4692     ac_ext=f
     4693ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4694ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4695ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4696
     4697     if test "$ac_success_extra" = "yes"; then
     4698        ac_cv_f77_mangling="$ac_case case"
     4699        if test -z "$ac_underscore"; then
     4700           ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore"
     4701        else
     4702           ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore"
     4703        fi
     4704        if test -z "$ac_extra"; then
     4705           ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore"
     4706        else
     4707           ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore"
     4708        fi
     4709      else
     4710        ac_cv_f77_mangling="unknown"
     4711      fi
     4712  else
     4713     ac_cv_f77_mangling="unknown"
     4714  fi
     4715
     4716  LIBS=$ac_save_LIBS
     4717  rm -f cfortran_test* conftest*
     4718else
     4719  echo "$as_me: failed program was:" >&5
     4720sed 's/^/| /' conftest.$ac_ext >&5
     4721
     4722{ { echo "$as_me:$LINENO: error: cannot compile a simple Fortran program
     4723See \`config.log' for more details." >&5
     4724echo "$as_me: error: cannot compile a simple Fortran program
     4725See \`config.log' for more details." >&2;}
     4726   { (exit 1); exit 1; }; }
     4727fi
     4728rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     4729
     4730fi
     4731echo "$as_me:$LINENO: result: $ac_cv_f77_mangling" >&5
     4732echo "${ECHO_T}$ac_cv_f77_mangling" >&6
     4733
     4734ac_ext=f
     4735ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4736ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4737ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4738
     4739ac_ext=f
     4740ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4741ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4742ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4743
     4744
     4745case $ac_cv_f77_mangling in
     4746  "lower case, no underscore, no extra underscore")
     4747          cat >>confdefs.h <<\_ACEOF
     4748#define F77_FUNC(name,NAME) name
     4749_ACEOF
     4750
     4751          cat >>confdefs.h <<\_ACEOF
     4752#define F77_FUNC_(name,NAME) name
     4753_ACEOF
     4754 ;;
     4755  "lower case, no underscore, extra underscore")
     4756          cat >>confdefs.h <<\_ACEOF
     4757#define F77_FUNC(name,NAME) name
     4758_ACEOF
     4759
     4760          cat >>confdefs.h <<\_ACEOF
     4761#define F77_FUNC_(name,NAME) name ## _
     4762_ACEOF
     4763 ;;
     4764  "lower case, underscore, no extra underscore")
     4765          cat >>confdefs.h <<\_ACEOF
     4766#define F77_FUNC(name,NAME) name ## _
     4767_ACEOF
     4768
     4769          cat >>confdefs.h <<\_ACEOF
     4770#define F77_FUNC_(name,NAME) name ## _
     4771_ACEOF
     4772 ;;
     4773  "lower case, underscore, extra underscore")
     4774          cat >>confdefs.h <<\_ACEOF
     4775#define F77_FUNC(name,NAME) name ## _
     4776_ACEOF
     4777
     4778          cat >>confdefs.h <<\_ACEOF
     4779#define F77_FUNC_(name,NAME) name ## __
     4780_ACEOF
     4781 ;;
     4782  "upper case, no underscore, no extra underscore")
     4783          cat >>confdefs.h <<\_ACEOF
     4784#define F77_FUNC(name,NAME) NAME
     4785_ACEOF
     4786
     4787          cat >>confdefs.h <<\_ACEOF
     4788#define F77_FUNC_(name,NAME) NAME
     4789_ACEOF
     4790 ;;
     4791  "upper case, no underscore, extra underscore")
     4792          cat >>confdefs.h <<\_ACEOF
     4793#define F77_FUNC(name,NAME) NAME
     4794_ACEOF
     4795
     4796          cat >>confdefs.h <<\_ACEOF
     4797#define F77_FUNC_(name,NAME) NAME ## _
     4798_ACEOF
     4799 ;;
     4800  "upper case, underscore, no extra underscore")
     4801          cat >>confdefs.h <<\_ACEOF
     4802#define F77_FUNC(name,NAME) NAME ## _
     4803_ACEOF
     4804
     4805          cat >>confdefs.h <<\_ACEOF
     4806#define F77_FUNC_(name,NAME) NAME ## _
     4807_ACEOF
     4808 ;;
     4809  "upper case, underscore, extra underscore")
     4810          cat >>confdefs.h <<\_ACEOF
     4811#define F77_FUNC(name,NAME) NAME ## _
     4812_ACEOF
     4813
     4814          cat >>confdefs.h <<\_ACEOF
     4815#define F77_FUNC_(name,NAME) NAME ## __
     4816_ACEOF
     4817 ;;
     4818  *)
     4819          { echo "$as_me:$LINENO: WARNING: unknown Fortran name-mangling scheme" >&5
     4820echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;}
     4821          ;;
     4822esac
     4823
     4824ac_ext=f
     4825ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     4826ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
     4827ac_compiler_gnu=$ac_cv_f77_compiler_gnu
     4828
     4829
     4830case $build in
     4831# The following is a fix to define FLIBS for ifort on Windows
     4832   *-cygwin*)
     4833     case $F77 in
     4834       ifort | */ifort)
     4835           FLIBS="libifcorert.lib libcmt.lib /link /NODEFAULTLIB:libc.lib $LIBS";;
     4836     esac;;
     4837   *-hp-*)
     4838       FLIBS="$FLIBS -lm";;
     4839esac
    28184840
    28194841if test -n "$ac_tool_prefix"; then
     
    36505672################
    36515673
    3652 
    36535674ac_ext=cc
    36545675ac_cpp='$CXXCPP $CPPFLAGS'
     
    39135934#include <float.h>
    39145935
     5936#ifdef F77_DUMMY_MAIN
     5937
     5938#  ifdef __cplusplus
     5939     extern "C"
     5940#  endif
     5941   int F77_DUMMY_MAIN() { return 1; }
     5942
     5943#endif
    39155944int
    39165945main ()
     
    62838312#endif
    62848313
     8314#ifdef F77_DUMMY_MAIN
     8315
     8316#  ifdef __cplusplus
     8317     extern "C"
     8318#  endif
     8319   int F77_DUMMY_MAIN() { return 1; }
     8320
     8321#endif
    62858322int
    62868323main ()
     
    63668403#endif
    63678404
     8405#ifdef F77_DUMMY_MAIN
     8406
     8407#  ifdef __cplusplus
     8408     extern "C"
     8409#  endif
     8410   int F77_DUMMY_MAIN() { return 1; }
     8411
     8412#endif
    63688413int
    63698414main ()
     
    64498494#endif
    64508495
     8496#ifdef F77_DUMMY_MAIN
     8497
     8498#  ifdef __cplusplus
     8499     extern "C"
     8500#  endif
     8501   int F77_DUMMY_MAIN() { return 1; }
     8502
     8503#endif
    64518504int
    64528505main ()
     
    65348587#endif
    65358588
     8589#ifdef F77_DUMMY_MAIN
     8590
     8591#  ifdef __cplusplus
     8592     extern "C"
     8593#  endif
     8594   int F77_DUMMY_MAIN() { return 1; }
     8595
     8596#endif
    65368597int
    65378598main ()
     
    65878648
    65888649
    6589 ac_ext=c
    6590 ac_cpp='$CPP $CPPFLAGS'
    6591 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    6592 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    6593 ac_compiler_gnu=$ac_cv_c_compiler_gnu
    6594 
    6595 
    6596 ###################################
    6597 #   Fortran 77 compiler options   #
    6598 ###################################
    6599 
    66008650ac_ext=f
    66018651ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
     
    66038653ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    66048654
    6605 SAVE_FFLAGS="$FFLAGS"
    6606 #AC_PROG_F77(ifort ifc pgf77 xlf fort77 f77 g77 df)
    6607 ac_ext=f
    6608 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    6609 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    6610 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    6611 if test -n "$ac_tool_prefix"; then
    6612   for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
    6613   do
    6614     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
    6615 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
    6616 echo "$as_me:$LINENO: checking for $ac_word" >&5
    6617 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    6618 if test "${ac_cv_prog_F77+set}" = set; then
    6619   echo $ECHO_N "(cached) $ECHO_C" >&6
    6620 else
    6621   if test -n "$F77"; then
    6622   ac_cv_prog_F77="$F77" # Let the user override the test.
    6623 else
    6624 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    6625 for as_dir in $PATH
    6626 do
    6627   IFS=$as_save_IFS
    6628   test -z "$as_dir" && as_dir=.
    6629   for ac_exec_ext in '' $ac_executable_extensions; do
    6630   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    6631     ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
    6632     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    6633     break 2
    6634   fi
    6635 done
    6636 done
    6637 
    6638 fi
    6639 fi
    6640 F77=$ac_cv_prog_F77
    6641 if test -n "$F77"; then
    6642   echo "$as_me:$LINENO: result: $F77" >&5
    6643 echo "${ECHO_T}$F77" >&6
    6644 else
    6645   echo "$as_me:$LINENO: result: no" >&5
    6646 echo "${ECHO_T}no" >&6
    6647 fi
    6648 
    6649     test -n "$F77" && break
    6650   done
    6651 fi
    6652 if test -z "$F77"; then
    6653   ac_ct_F77=$F77
    6654   for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
    6655 do
    6656   # Extract the first word of "$ac_prog", so it can be a program name with args.
    6657 set dummy $ac_prog; ac_word=$2
    6658 echo "$as_me:$LINENO: checking for $ac_word" >&5
    6659 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    6660 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
    6661   echo $ECHO_N "(cached) $ECHO_C" >&6
    6662 else
    6663   if test -n "$ac_ct_F77"; then
    6664   ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
    6665 else
    6666 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    6667 for as_dir in $PATH
    6668 do
    6669   IFS=$as_save_IFS
    6670   test -z "$as_dir" && as_dir=.
    6671   for ac_exec_ext in '' $ac_executable_extensions; do
    6672   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    6673     ac_cv_prog_ac_ct_F77="$ac_prog"
    6674     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    6675     break 2
    6676   fi
    6677 done
    6678 done
    6679 
    6680 fi
    6681 fi
    6682 ac_ct_F77=$ac_cv_prog_ac_ct_F77
    6683 if test -n "$ac_ct_F77"; then
    6684   echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
    6685 echo "${ECHO_T}$ac_ct_F77" >&6
    6686 else
    6687   echo "$as_me:$LINENO: result: no" >&5
    6688 echo "${ECHO_T}no" >&6
    6689 fi
    6690 
    6691   test -n "$ac_ct_F77" && break
    6692 done
    6693 
    6694   F77=$ac_ct_F77
    6695 fi
    6696 
    6697 
    6698 # Provide some information about the compiler.
    6699 echo "$as_me:6699:" \
    6700      "checking for Fortran 77 compiler version" >&5
    6701 ac_compiler=`set X $ac_compile; echo $2`
    6702 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
    6703   (eval $ac_compiler --version </dev/null >&5) 2>&5
    6704   ac_status=$?
    6705   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6706   (exit $ac_status); }
    6707 { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
    6708   (eval $ac_compiler -v </dev/null >&5) 2>&5
    6709   ac_status=$?
    6710   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6711   (exit $ac_status); }
    6712 { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
    6713   (eval $ac_compiler -V </dev/null >&5) 2>&5
    6714   ac_status=$?
    6715   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6716   (exit $ac_status); }
    6717 rm -f a.out
    6718 
    6719 # If we don't use `.F' as extension, the preprocessor is not run on the
    6720 # input file.  (Note that this only needs to work for GNU compilers.)
    6721 ac_save_ext=$ac_ext
    6722 ac_ext=F
    6723 echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
    6724 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
    6725 if test "${ac_cv_f77_compiler_gnu+set}" = set; then
    6726   echo $ECHO_N "(cached) $ECHO_C" >&6
    6727 else
    6728   cat >conftest.$ac_ext <<_ACEOF
    6729       program main
    6730 #ifndef __GNUC__
    6731        choke me
    6732 #endif
    6733 
    6734       end
    6735 _ACEOF
    6736 rm -f conftest.$ac_objext
    6737 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    6738   (eval $ac_compile) 2>conftest.er1
    6739   ac_status=$?
    6740   grep -v '^ *+' conftest.er1 >conftest.err
    6741   rm -f conftest.er1
    6742   cat conftest.err >&5
    6743   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6744   (exit $ac_status); } &&
    6745          { ac_try='test -z "$ac_f77_werror_flag"
    6746                          || test ! -s conftest.err'
    6747   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6748   (eval $ac_try) 2>&5
    6749   ac_status=$?
    6750   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6751   (exit $ac_status); }; } &&
    6752          { ac_try='test -s conftest.$ac_objext'
    6753   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6754   (eval $ac_try) 2>&5
    6755   ac_status=$?
    6756   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6757   (exit $ac_status); }; }; then
    6758   ac_compiler_gnu=yes
    6759 else
    6760   echo "$as_me: failed program was:" >&5
    6761 sed 's/^/| /' conftest.$ac_ext >&5
    6762 
    6763 ac_compiler_gnu=no
    6764 fi
    6765 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    6766 ac_cv_f77_compiler_gnu=$ac_compiler_gnu
    6767 
    6768 fi
    6769 echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
    6770 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
    6771 ac_ext=$ac_save_ext
    6772 ac_test_FFLAGS=${FFLAGS+set}
    6773 ac_save_FFLAGS=$FFLAGS
    6774 FFLAGS=
    6775 echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
    6776 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
    6777 if test "${ac_cv_prog_f77_g+set}" = set; then
    6778   echo $ECHO_N "(cached) $ECHO_C" >&6
    6779 else
    6780   FFLAGS=-g
    6781 cat >conftest.$ac_ext <<_ACEOF
    6782       program main
    6783 
    6784       end
    6785 _ACEOF
    6786 rm -f conftest.$ac_objext
    6787 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    6788   (eval $ac_compile) 2>conftest.er1
    6789   ac_status=$?
    6790   grep -v '^ *+' conftest.er1 >conftest.err
    6791   rm -f conftest.er1
    6792   cat conftest.err >&5
    6793   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6794   (exit $ac_status); } &&
    6795          { ac_try='test -z "$ac_f77_werror_flag"
    6796                          || test ! -s conftest.err'
    6797   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6798   (eval $ac_try) 2>&5
    6799   ac_status=$?
    6800   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6801   (exit $ac_status); }; } &&
    6802          { ac_try='test -s conftest.$ac_objext'
    6803   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6804   (eval $ac_try) 2>&5
    6805   ac_status=$?
    6806   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6807   (exit $ac_status); }; }; then
    6808   ac_cv_prog_f77_g=yes
    6809 else
    6810   echo "$as_me: failed program was:" >&5
    6811 sed 's/^/| /' conftest.$ac_ext >&5
    6812 
    6813 ac_cv_prog_f77_g=no
    6814 fi
    6815 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    6816 
    6817 fi
    6818 echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
    6819 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
    6820 if test "$ac_test_FFLAGS" = set; then
    6821   FFLAGS=$ac_save_FFLAGS
    6822 elif test $ac_cv_prog_f77_g = yes; then
    6823   if test "x$ac_cv_f77_compiler_gnu" = xyes; then
    6824     FFLAGS="-g -O2"
    6825   else
    6826     FFLAGS="-g"
    6827   fi
    6828 else
    6829   if test "x$ac_cv_f77_compiler_gnu" = xyes; then
    6830     FFLAGS="-O2"
    6831   else
    6832     FFLAGS=
    6833   fi
    6834 fi
    6835 
    6836 G77=`test $ac_compiler_gnu = yes && echo yes`
    6837 ac_ext=f
    6838 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    6839 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    6840 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    6841 
    6842 FFLAGS="$SAVE_FFLAGS"
    6843 
    6844 
    6845 ac_ext=f
    6846 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    6847 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    6848 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    6849 echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5
    6850 echo $ECHO_N "checking how to get verbose linking output from $F77... $ECHO_C" >&6
    6851 if test "${ac_cv_prog_f77_v+set}" = set; then
    6852   echo $ECHO_N "(cached) $ECHO_C" >&6
    6853 else
    6854   cat >conftest.$ac_ext <<_ACEOF
    6855       program main
    6856 
    6857       end
    6858 _ACEOF
    6859 rm -f conftest.$ac_objext
    6860 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    6861   (eval $ac_compile) 2>conftest.er1
    6862   ac_status=$?
    6863   grep -v '^ *+' conftest.er1 >conftest.err
    6864   rm -f conftest.er1
    6865   cat conftest.err >&5
    6866   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6867   (exit $ac_status); } &&
    6868          { ac_try='test -z "$ac_f77_werror_flag"
    6869                          || test ! -s conftest.err'
    6870   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6871   (eval $ac_try) 2>&5
    6872   ac_status=$?
    6873   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6874   (exit $ac_status); }; } &&
    6875          { ac_try='test -s conftest.$ac_objext'
    6876   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6877   (eval $ac_try) 2>&5
    6878   ac_status=$?
    6879   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6880   (exit $ac_status); }; }; then
    6881   ac_cv_prog_f77_v=
    6882 # Try some options frequently used verbose output
    6883 for ac_verb in -v -verbose --verbose -V -\#\#\#; do
    6884   cat >conftest.$ac_ext <<_ACEOF
    6885       program main
    6886 
    6887       end
    6888 _ACEOF
    6889 
    6890 # Compile and link our simple test program by passing a flag (argument
    6891 # 1 to this macro) to the Fortran compiler in order to get
    6892 # "verbose" output that we can then parse for the Fortran linker
    6893 # flags.
    6894 ac_save_FFLAGS=$FFLAGS
    6895 FFLAGS="$FFLAGS $ac_verb"
    6896 (eval echo $as_me:6896: \"$ac_link\") >&5
    6897 ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
    6898 echo "$ac_f77_v_output" >&5
    6899 FFLAGS=$ac_save_FFLAGS
    6900 
    6901 rm -f conftest*
    6902 
    6903 # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
    6904 # /foo, /bar, and /baz are search directories for the Fortran linker.
    6905 # Here, we change these into -L/foo -L/bar -L/baz (and put it first):
    6906 ac_f77_v_output="`echo $ac_f77_v_output |
    6907         grep 'LPATH is:' |
    6908         sed 's,.*LPATH is\(: *[^ ]*\).*,\1,;s,: */, -L/,g'` $ac_f77_v_output"
    6909 
    6910 case $ac_f77_v_output in
    6911   # If we are using xlf then replace all the commas with spaces.
    6912   *xlfentry*)
    6913     ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
    6914 
    6915   # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
    6916   # $LIBS confuse us, and the libraries appear later in the output anyway).
    6917   *mGLOB_options_string*)
    6918     ac_f77_v_output=`echo $ac_f77_v_output | sed 's/\"-mGLOB[^\"]*\"/ /g'` ;;
    6919 
    6920   # If we are using Cray Fortran then delete quotes.
    6921   # Use "\"" instead of '"' for font-lock-mode.
    6922   # FIXME: a more general fix for quoted arguments with spaces?
    6923   *cft90*)
    6924     ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"` ;;
    6925 esac
    6926 
    6927 
    6928   # look for -l* and *.a constructs in the output
    6929   for ac_arg in $ac_f77_v_output; do
    6930      case $ac_arg in
    6931         [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
    6932           ac_cv_prog_f77_v=$ac_verb
    6933           break 2 ;;
    6934      esac
    6935   done
    6936 done
    6937 if test -z "$ac_cv_prog_f77_v"; then
    6938    { echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5
    6939 echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;}
    6940 fi
    6941 else
    6942   echo "$as_me: failed program was:" >&5
    6943 sed 's/^/| /' conftest.$ac_ext >&5
    6944 
    6945 { echo "$as_me:$LINENO: WARNING: compilation failed" >&5
    6946 echo "$as_me: WARNING: compilation failed" >&2;}
    6947 fi
    6948 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    6949 
    6950 fi
    6951 echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5
    6952 echo "${ECHO_T}$ac_cv_prog_f77_v" >&6
    6953 echo "$as_me:$LINENO: checking for Fortran libraries of $F77" >&5
    6954 echo $ECHO_N "checking for Fortran libraries of $F77... $ECHO_C" >&6
    6955 if test "${ac_cv_f77_libs+set}" = set; then
    6956   echo $ECHO_N "(cached) $ECHO_C" >&6
    6957 else
    6958   if test "x$FLIBS" != "x"; then
    6959   ac_cv_f77_libs="$FLIBS" # Let the user override the test.
    6960 else
    6961 
    6962 cat >conftest.$ac_ext <<_ACEOF
    6963       program main
    6964 
    6965       end
    6966 _ACEOF
    6967 
    6968 # Compile and link our simple test program by passing a flag (argument
    6969 # 1 to this macro) to the Fortran compiler in order to get
    6970 # "verbose" output that we can then parse for the Fortran linker
    6971 # flags.
    6972 ac_save_FFLAGS=$FFLAGS
    6973 FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
    6974 (eval echo $as_me:6974: \"$ac_link\") >&5
    6975 ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
    6976 echo "$ac_f77_v_output" >&5
    6977 FFLAGS=$ac_save_FFLAGS
    6978 
    6979 rm -f conftest*
    6980 
    6981 # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
    6982 # /foo, /bar, and /baz are search directories for the Fortran linker.
    6983 # Here, we change these into -L/foo -L/bar -L/baz (and put it first):
    6984 ac_f77_v_output="`echo $ac_f77_v_output |
    6985         grep 'LPATH is:' |
    6986         sed 's,.*LPATH is\(: *[^ ]*\).*,\1,;s,: */, -L/,g'` $ac_f77_v_output"
    6987 
    6988 case $ac_f77_v_output in
    6989   # If we are using xlf then replace all the commas with spaces.
    6990   *xlfentry*)
    6991     ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;;
    6992 
    6993   # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
    6994   # $LIBS confuse us, and the libraries appear later in the output anyway).
    6995   *mGLOB_options_string*)
    6996     ac_f77_v_output=`echo $ac_f77_v_output | sed 's/\"-mGLOB[^\"]*\"/ /g'` ;;
    6997 
    6998   # If we are using Cray Fortran then delete quotes.
    6999   # Use "\"" instead of '"' for font-lock-mode.
    7000   # FIXME: a more general fix for quoted arguments with spaces?
    7001   *cft90*)
    7002     ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"` ;;
    7003 esac
    7004 
    7005 
    7006 
    7007 ac_cv_f77_libs=
    7008 
    7009 # Save positional arguments (if any)
    7010 ac_save_positional="$@"
    7011 
    7012 set X $ac_f77_v_output
    7013 while test $# != 1; do
    7014   shift
    7015   ac_arg=$1
    7016   case $ac_arg in
    7017         [\\/]*.a | ?:[\\/]*.a)
    7018             ac_exists=false
    7019   for ac_i in $ac_cv_f77_libs; do
    7020     if test x"$ac_arg" = x"$ac_i"; then
    7021       ac_exists=true
    7022       break
    7023     fi
    7024   done
    7025 
    7026   if test x"$ac_exists" = xtrue; then
    7027   :
    7028 else
    7029   ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
    7030 fi
    7031 
    7032           ;;
    7033         -bI:*)
    7034             ac_exists=false
    7035   for ac_i in $ac_cv_f77_libs; do
    7036     if test x"$ac_arg" = x"$ac_i"; then
    7037       ac_exists=true
    7038       break
    7039     fi
    7040   done
    7041 
    7042   if test x"$ac_exists" = xtrue; then
    7043   :
    7044 else
    7045   if test "$ac_compiler_gnu" = yes; then
    7046   for ac_link_opt in $ac_arg; do
    7047     ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
    7048   done
    7049 else
    7050   ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
    7051 fi
    7052 fi
    7053 
    7054           ;;
    7055           # Ignore these flags.
    7056         -lang* | -lcrt*.o | -lc | -lgcc | -libmil | -LANG:=*)
    7057           ;;
    7058         -lkernel32)
    7059           test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
    7060           ;;
    7061         -[LRuY])
    7062           # These flags, when seen by themselves, take an argument.
    7063           # We remove the space between option and argument and re-iterate
    7064           # unless we find an empty arg or a new option (starting with -)
    7065           case $2 in
    7066              "" | -*);;
    7067              *)
    7068                 ac_arg="$ac_arg$2"
    7069                 shift; shift
    7070                 set X $ac_arg "$@"
    7071                 ;;
    7072           esac
    7073           ;;
    7074         -YP,*)
    7075           for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
    7076               ac_exists=false
    7077   for ac_i in $ac_cv_f77_libs; do
    7078     if test x"$ac_j" = x"$ac_i"; then
    7079       ac_exists=true
    7080       break
    7081     fi
    7082   done
    7083 
    7084   if test x"$ac_exists" = xtrue; then
    7085   :
    7086 else
    7087   ac_arg="$ac_arg $ac_j"
    7088                                ac_cv_f77_libs="$ac_cv_f77_libs $ac_j"
    7089 fi
    7090 
    7091           done
    7092           ;;
    7093         -[lLR]*)
    7094             ac_exists=false
    7095   for ac_i in $ac_cv_f77_libs; do
    7096     if test x"$ac_arg" = x"$ac_i"; then
    7097       ac_exists=true
    7098       break
    7099     fi
    7100   done
    7101 
    7102   if test x"$ac_exists" = xtrue; then
    7103   :
    7104 else
    7105   ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg"
    7106 fi
    7107 
    7108           ;;
    7109           # Ignore everything else.
    7110   esac
    7111 done
    7112 # restore positional arguments
    7113 set X $ac_save_positional; shift
    7114 
    7115 # We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
    7116 # then we insist that the "run path" must be an absolute path (i.e. it
    7117 # must begin with a "/").
    7118 case `(uname -sr) 2>/dev/null` in
    7119    "SunOS 5"*)
    7120       ac_ld_run_path=`echo $ac_f77_v_output |
    7121                         sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
    7122       test "x$ac_ld_run_path" != x &&
    7123         if test "$ac_compiler_gnu" = yes; then
    7124   for ac_link_opt in $ac_ld_run_path; do
    7125     ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt"
    7126   done
    7127 else
    7128   ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path"
    7129 fi
    7130       ;;
    7131 esac
    7132 fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
    7133 
    7134 fi
    7135 echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5
    7136 echo "${ECHO_T}$ac_cv_f77_libs" >&6
    7137 FLIBS="$ac_cv_f77_libs"
    7138 
    7139 
    7140 ac_ext=f
    7141 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7142 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7143 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7144 
    7145 
    7146 ac_ext=f
    7147 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7148 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7149 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7150 
    7151 echo "$as_me:$LINENO: checking for dummy main to link with Fortran libraries" >&5
    7152 echo $ECHO_N "checking for dummy main to link with Fortran libraries... $ECHO_C" >&6
    7153 if test "${ac_cv_f77_dummy_main+set}" = set; then
    7154   echo $ECHO_N "(cached) $ECHO_C" >&6
    7155 else
    7156   ac_f77_dm_save_LIBS=$LIBS
    7157  LIBS="$LIBS $FLIBS"
    7158  ac_fortran_dm_var=F77_DUMMY_MAIN
    7159  ac_ext=c
    7160 ac_cpp='$CPP $CPPFLAGS'
    7161 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    7162 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7163 ac_compiler_gnu=$ac_cv_c_compiler_gnu
    7164 
    7165  # First, try linking without a dummy main:
    7166  cat >conftest.$ac_ext <<_ACEOF
    7167 /* confdefs.h.  */
    7168 _ACEOF
    7169 cat confdefs.h >>conftest.$ac_ext
    7170 cat >>conftest.$ac_ext <<_ACEOF
    7171 /* end confdefs.h.  */
    7172 
    7173 #ifdef F77_DUMMY_MAIN
    7174 
    7175 #  ifdef __cplusplus
    7176      extern "C"
    7177 #  endif
    7178    int F77_DUMMY_MAIN() { return 1; }
    7179 
    7180 #endif
    7181 int
    7182 main ()
    7183 {
    7184 
    7185   ;
    7186   return 0;
    7187 }
    7188 _ACEOF
    7189 rm -f conftest.$ac_objext conftest$ac_exeext
    7190 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    7191   (eval $ac_link) 2>conftest.er1
    7192   ac_status=$?
    7193   grep -v '^ *+' conftest.er1 >conftest.err
    7194   rm -f conftest.er1
    7195   cat conftest.err >&5
    7196   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7197   (exit $ac_status); } &&
    7198          { ac_try='test -z "$ac_c_werror_flag"
    7199                          || test ! -s conftest.err'
    7200   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7201   (eval $ac_try) 2>&5
    7202   ac_status=$?
    7203   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7204   (exit $ac_status); }; } &&
    7205          { ac_try='test -s conftest$ac_exeext'
    7206   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7207   (eval $ac_try) 2>&5
    7208   ac_status=$?
    7209   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7210   (exit $ac_status); }; }; then
    7211   ac_cv_fortran_dummy_main=none
    7212 else
    7213   echo "$as_me: failed program was:" >&5
    7214 sed 's/^/| /' conftest.$ac_ext >&5
    7215 
    7216 ac_cv_fortran_dummy_main=unknown
    7217 fi
    7218 rm -f conftest.err conftest.$ac_objext \
    7219       conftest$ac_exeext conftest.$ac_ext
    7220 
    7221  if test $ac_cv_fortran_dummy_main = unknown; then
    7222    for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
    7223      cat >conftest.$ac_ext <<_ACEOF
    7224 /* confdefs.h.  */
    7225 _ACEOF
    7226 cat confdefs.h >>conftest.$ac_ext
    7227 cat >>conftest.$ac_ext <<_ACEOF
    7228 /* end confdefs.h.  */
    7229 #define $ac_fortran_dm_var $ac_func
    7230 #ifdef F77_DUMMY_MAIN
    7231 
    7232 #  ifdef __cplusplus
    7233      extern "C"
    7234 #  endif
    7235    int F77_DUMMY_MAIN() { return 1; }
    7236 
    7237 #endif
    7238 int
    7239 main ()
    7240 {
    7241 
    7242   ;
    7243   return 0;
    7244 }
    7245 _ACEOF
    7246 rm -f conftest.$ac_objext conftest$ac_exeext
    7247 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    7248   (eval $ac_link) 2>conftest.er1
    7249   ac_status=$?
    7250   grep -v '^ *+' conftest.er1 >conftest.err
    7251   rm -f conftest.er1
    7252   cat conftest.err >&5
    7253   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7254   (exit $ac_status); } &&
    7255          { ac_try='test -z "$ac_c_werror_flag"
    7256                          || test ! -s conftest.err'
    7257   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7258   (eval $ac_try) 2>&5
    7259   ac_status=$?
    7260   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7261   (exit $ac_status); }; } &&
    7262          { ac_try='test -s conftest$ac_exeext'
    7263   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7264   (eval $ac_try) 2>&5
    7265   ac_status=$?
    7266   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7267   (exit $ac_status); }; }; then
    7268   ac_cv_fortran_dummy_main=$ac_func; break
    7269 else
    7270   echo "$as_me: failed program was:" >&5
    7271 sed 's/^/| /' conftest.$ac_ext >&5
    7272 
    7273 fi
    7274 rm -f conftest.err conftest.$ac_objext \
    7275       conftest$ac_exeext conftest.$ac_ext
    7276    done
    7277  fi
    7278  ac_ext=f
    7279 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7280 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7281 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7282  ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main
    7283  rm -f conftest*
    7284  LIBS=$ac_f77_dm_save_LIBS
    7285 
    7286 fi
    7287 echo "$as_me:$LINENO: result: $ac_cv_f77_dummy_main" >&5
    7288 echo "${ECHO_T}$ac_cv_f77_dummy_main" >&6
    7289 F77_DUMMY_MAIN=$ac_cv_f77_dummy_main
    7290 if test "$F77_DUMMY_MAIN" != unknown; then
    7291   if test $F77_DUMMY_MAIN != none; then
    7292 
    7293 cat >>confdefs.h <<_ACEOF
    7294 #define F77_DUMMY_MAIN $F77_DUMMY_MAIN
    7295 _ACEOF
    7296 
    7297   if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then
    7298 
    7299 cat >>confdefs.h <<\_ACEOF
    7300 #define FC_DUMMY_MAIN_EQ_F77 1
    7301 _ACEOF
    7302 
    7303   fi
    7304 fi
    7305 else
    7306   { { echo "$as_me:$LINENO: error: linking to Fortran libraries from C fails
    7307 See \`config.log' for more details." >&5
    7308 echo "$as_me: error: linking to Fortran libraries from C fails
    7309 See \`config.log' for more details." >&2;}
    7310    { (exit 1); exit 1; }; }
    7311 fi
    7312 
    7313 
    7314 ac_ext=f
    7315 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7316 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7317 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7318 
    7319 ac_ext=f
    7320 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7321 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7322 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7323 echo "$as_me:$LINENO: checking for Fortran name-mangling scheme" >&5
    7324 echo $ECHO_N "checking for Fortran name-mangling scheme... $ECHO_C" >&6
    7325 if test "${ac_cv_f77_mangling+set}" = set; then
    7326   echo $ECHO_N "(cached) $ECHO_C" >&6
    7327 else
    7328   cat >conftest.$ac_ext <<_ACEOF
    7329       subroutine foobar()
    7330       return
    7331       end
    7332       subroutine foo_bar()
    7333       return
    7334       end
    7335 _ACEOF
    7336 rm -f conftest.$ac_objext
    7337 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    7338   (eval $ac_compile) 2>conftest.er1
    7339   ac_status=$?
    7340   grep -v '^ *+' conftest.er1 >conftest.err
    7341   rm -f conftest.er1
    7342   cat conftest.err >&5
    7343   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7344   (exit $ac_status); } &&
    7345          { ac_try='test -z "$ac_f77_werror_flag"
    7346                          || test ! -s conftest.err'
    7347   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7348   (eval $ac_try) 2>&5
    7349   ac_status=$?
    7350   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7351   (exit $ac_status); }; } &&
    7352          { ac_try='test -s conftest.$ac_objext'
    7353   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7354   (eval $ac_try) 2>&5
    7355   ac_status=$?
    7356   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7357   (exit $ac_status); }; }; then
    7358   mv conftest.$ac_objext cfortran_test.$ac_objext
    7359 
    7360   ac_save_LIBS=$LIBS
    7361   LIBS="cfortran_test.$ac_objext $LIBS $FLIBS"
    7362 
    7363   ac_ext=c
    7364 ac_cpp='$CPP $CPPFLAGS'
    7365 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    7366 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7367 ac_compiler_gnu=$ac_cv_c_compiler_gnu
    7368   ac_success=no
    7369   for ac_foobar in foobar FOOBAR; do
    7370     for ac_underscore in "" "_"; do
    7371       ac_func="$ac_foobar$ac_underscore"
    7372       cat >conftest.$ac_ext <<_ACEOF
    7373 /* confdefs.h.  */
    7374 _ACEOF
    7375 cat confdefs.h >>conftest.$ac_ext
    7376 cat >>conftest.$ac_ext <<_ACEOF
    7377 /* end confdefs.h.  */
    7378 
    7379 /* Override any gcc2 internal prototype to avoid an error.  */
    7380 #ifdef __cplusplus
    7381 extern "C"
    7382 #endif
    7383 /* We use char because int might match the return type of a gcc2
    7384    builtin and then its argument prototype would still apply.  */
    7385 char $ac_func ();
    7386 #ifdef F77_DUMMY_MAIN
    7387 
    7388 #  ifdef __cplusplus
    7389      extern "C"
    7390 #  endif
    7391    int F77_DUMMY_MAIN() { return 1; }
    7392 
    7393 #endif
    7394 int
    7395 main ()
    7396 {
    7397 $ac_func ();
    7398   ;
    7399   return 0;
    7400 }
    7401 _ACEOF
    7402 rm -f conftest.$ac_objext conftest$ac_exeext
    7403 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    7404   (eval $ac_link) 2>conftest.er1
    7405   ac_status=$?
    7406   grep -v '^ *+' conftest.er1 >conftest.err
    7407   rm -f conftest.er1
    7408   cat conftest.err >&5
    7409   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7410   (exit $ac_status); } &&
    7411          { ac_try='test -z "$ac_c_werror_flag"
    7412                          || test ! -s conftest.err'
    7413   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7414   (eval $ac_try) 2>&5
    7415   ac_status=$?
    7416   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7417   (exit $ac_status); }; } &&
    7418          { ac_try='test -s conftest$ac_exeext'
    7419   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7420   (eval $ac_try) 2>&5
    7421   ac_status=$?
    7422   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7423   (exit $ac_status); }; }; then
    7424   ac_success=yes; break 2
    7425 else
    7426   echo "$as_me: failed program was:" >&5
    7427 sed 's/^/| /' conftest.$ac_ext >&5
    7428 
    7429 fi
    7430 rm -f conftest.err conftest.$ac_objext \
    7431       conftest$ac_exeext conftest.$ac_ext
    7432     done
    7433   done
    7434   ac_ext=f
    7435 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7436 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7437 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7438 
    7439   if test "$ac_success" = "yes"; then
    7440      case $ac_foobar in
    7441         foobar)
    7442            ac_case=lower
    7443            ac_foo_bar=foo_bar
    7444            ;;
    7445         FOOBAR)
    7446            ac_case=upper
    7447            ac_foo_bar=FOO_BAR
    7448            ;;
    7449      esac
    7450 
    7451      ac_ext=c
    7452 ac_cpp='$CPP $CPPFLAGS'
    7453 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    7454 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7455 ac_compiler_gnu=$ac_cv_c_compiler_gnu
    7456      ac_success_extra=no
    7457      for ac_extra in "" "_"; do
    7458         ac_func="$ac_foo_bar$ac_underscore$ac_extra"
    7459         cat >conftest.$ac_ext <<_ACEOF
    7460 /* confdefs.h.  */
    7461 _ACEOF
    7462 cat confdefs.h >>conftest.$ac_ext
    7463 cat >>conftest.$ac_ext <<_ACEOF
    7464 /* end confdefs.h.  */
    7465 
    7466 /* Override any gcc2 internal prototype to avoid an error.  */
    7467 #ifdef __cplusplus
    7468 extern "C"
    7469 #endif
    7470 /* We use char because int might match the return type of a gcc2
    7471    builtin and then its argument prototype would still apply.  */
    7472 char $ac_func ();
    7473 #ifdef F77_DUMMY_MAIN
    7474 
    7475 #  ifdef __cplusplus
    7476      extern "C"
    7477 #  endif
    7478    int F77_DUMMY_MAIN() { return 1; }
    7479 
    7480 #endif
    7481 int
    7482 main ()
    7483 {
    7484 $ac_func ();
    7485   ;
    7486   return 0;
    7487 }
    7488 _ACEOF
    7489 rm -f conftest.$ac_objext conftest$ac_exeext
    7490 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    7491   (eval $ac_link) 2>conftest.er1
    7492   ac_status=$?
    7493   grep -v '^ *+' conftest.er1 >conftest.err
    7494   rm -f conftest.er1
    7495   cat conftest.err >&5
    7496   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7497   (exit $ac_status); } &&
    7498          { ac_try='test -z "$ac_c_werror_flag"
    7499                          || test ! -s conftest.err'
    7500   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7501   (eval $ac_try) 2>&5
    7502   ac_status=$?
    7503   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7504   (exit $ac_status); }; } &&
    7505          { ac_try='test -s conftest$ac_exeext'
    7506   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7507   (eval $ac_try) 2>&5
    7508   ac_status=$?
    7509   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7510   (exit $ac_status); }; }; then
    7511   ac_success_extra=yes; break
    7512 else
    7513   echo "$as_me: failed program was:" >&5
    7514 sed 's/^/| /' conftest.$ac_ext >&5
    7515 
    7516 fi
    7517 rm -f conftest.err conftest.$ac_objext \
    7518       conftest$ac_exeext conftest.$ac_ext
    7519      done
    7520      ac_ext=f
    7521 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7522 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7523 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7524 
    7525      if test "$ac_success_extra" = "yes"; then
    7526         ac_cv_f77_mangling="$ac_case case"
    7527         if test -z "$ac_underscore"; then
    7528            ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore"
    7529         else
    7530            ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore"
    7531         fi
    7532         if test -z "$ac_extra"; then
    7533            ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore"
    7534         else
    7535            ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore"
    7536         fi
    7537       else
    7538         ac_cv_f77_mangling="unknown"
    7539       fi
    7540   else
    7541      ac_cv_f77_mangling="unknown"
    7542   fi
    7543 
    7544   LIBS=$ac_save_LIBS
    7545   rm -f cfortran_test* conftest*
    7546 else
    7547   echo "$as_me: failed program was:" >&5
    7548 sed 's/^/| /' conftest.$ac_ext >&5
    7549 
    7550 { { echo "$as_me:$LINENO: error: cannot compile a simple Fortran program
    7551 See \`config.log' for more details." >&5
    7552 echo "$as_me: error: cannot compile a simple Fortran program
    7553 See \`config.log' for more details." >&2;}
    7554    { (exit 1); exit 1; }; }
    7555 fi
    7556 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    7557 
    7558 fi
    7559 echo "$as_me:$LINENO: result: $ac_cv_f77_mangling" >&5
    7560 echo "${ECHO_T}$ac_cv_f77_mangling" >&6
    7561 
    7562 ac_ext=f
    7563 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7564 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7565 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7566 
    7567 ac_ext=f
    7568 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7569 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7570 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7571 
    7572 
    7573 case $ac_cv_f77_mangling in
    7574   "lower case, no underscore, no extra underscore")
    7575           cat >>confdefs.h <<\_ACEOF
    7576 #define F77_FUNC(name,NAME) name
    7577 _ACEOF
    7578 
    7579           cat >>confdefs.h <<\_ACEOF
    7580 #define F77_FUNC_(name,NAME) name
    7581 _ACEOF
    7582  ;;
    7583   "lower case, no underscore, extra underscore")
    7584           cat >>confdefs.h <<\_ACEOF
    7585 #define F77_FUNC(name,NAME) name
    7586 _ACEOF
    7587 
    7588           cat >>confdefs.h <<\_ACEOF
    7589 #define F77_FUNC_(name,NAME) name ## _
    7590 _ACEOF
    7591  ;;
    7592   "lower case, underscore, no extra underscore")
    7593           cat >>confdefs.h <<\_ACEOF
    7594 #define F77_FUNC(name,NAME) name ## _
    7595 _ACEOF
    7596 
    7597           cat >>confdefs.h <<\_ACEOF
    7598 #define F77_FUNC_(name,NAME) name ## _
    7599 _ACEOF
    7600  ;;
    7601   "lower case, underscore, extra underscore")
    7602           cat >>confdefs.h <<\_ACEOF
    7603 #define F77_FUNC(name,NAME) name ## _
    7604 _ACEOF
    7605 
    7606           cat >>confdefs.h <<\_ACEOF
    7607 #define F77_FUNC_(name,NAME) name ## __
    7608 _ACEOF
    7609  ;;
    7610   "upper case, no underscore, no extra underscore")
    7611           cat >>confdefs.h <<\_ACEOF
    7612 #define F77_FUNC(name,NAME) NAME
    7613 _ACEOF
    7614 
    7615           cat >>confdefs.h <<\_ACEOF
    7616 #define F77_FUNC_(name,NAME) NAME
    7617 _ACEOF
    7618  ;;
    7619   "upper case, no underscore, extra underscore")
    7620           cat >>confdefs.h <<\_ACEOF
    7621 #define F77_FUNC(name,NAME) NAME
    7622 _ACEOF
    7623 
    7624           cat >>confdefs.h <<\_ACEOF
    7625 #define F77_FUNC_(name,NAME) NAME ## _
    7626 _ACEOF
    7627  ;;
    7628   "upper case, underscore, no extra underscore")
    7629           cat >>confdefs.h <<\_ACEOF
    7630 #define F77_FUNC(name,NAME) NAME ## _
    7631 _ACEOF
    7632 
    7633           cat >>confdefs.h <<\_ACEOF
    7634 #define F77_FUNC_(name,NAME) NAME ## _
    7635 _ACEOF
    7636  ;;
    7637   "upper case, underscore, extra underscore")
    7638           cat >>confdefs.h <<\_ACEOF
    7639 #define F77_FUNC(name,NAME) NAME ## _
    7640 _ACEOF
    7641 
    7642           cat >>confdefs.h <<\_ACEOF
    7643 #define F77_FUNC_(name,NAME) NAME ## __
    7644 _ACEOF
    7645  ;;
    7646   *)
    7647           { echo "$as_me:$LINENO: WARNING: unknown Fortran name-mangling scheme" >&5
    7648 echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;}
    7649           ;;
    7650 esac
    7651 
    7652 ac_ext=f
    7653 ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
    7654 ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    7655 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
    7656 
    7657 
    7658 case $build in
    7659 # The following is a fix to define FLIBS for ifort on Windows
    7660    *-cygwin*)
    7661      case $F77 in
    7662        ifort | */ifort)
    7663            FLIBS="libifcorert.lib libcmt.lib /link /NODEFAULTLIB:libc.lib $LIBS";;
    7664      esac;;
    7665    *-hp-*)
    7666        FLIBS="$FLIBS -lm";;
    7667 esac
    76688655
    76698656##########################################################################
     
    85479534echo $ECHO_N "checking whether $am_make understands the \`-j 1' flag... $ECHO_C" >&6
    85489535      cat >conftest.$ac_ext <<_ACEOF
    8549 bla:
    8550 _ACEOF
    8551       if ($am_make -f conftest.c -j 1 bla >&5) 2>&5 ; then
     9536bladfaoekja:
     9537_ACEOF
     9538      if ($am_make -f conftest.c -j 1 bladfaoekja >&5) 2>&5 ; then
    85529539        echo "$as_me:$LINENO: result: yes" >&5
    85539540echo "${ECHO_T}yes" >&6
     
    85589545        echo "$as_me:$LINENO: checking whether $am_make understands the \`-J 1' flag" >&5
    85599546echo $ECHO_N "checking whether $am_make understands the \`-J 1' flag... $ECHO_C" >&6
    8560         if ($am_make -f conftest.c -J 1 bla >&5) 2>&5 ; then
     9547        if ($am_make -f conftest.c -J 1 bladfaoekja >&5) 2>&5 ; then
    85619548          echo "$as_me:$LINENO: result: yes" >&5
    85629549echo "${ECHO_T}yes" >&6
     
    86889675#fi
    86899676
    8690 ######################
    8691 # C++ link libraries #
    8692 ######################
    8693 if test -z "$CXXLIBS"; then
    8694   CXXLIBS="-L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2 -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../.. -lstdc++ -lm -lgcc_s -lgcc"
    8695 fi
    8696 
    86979677
    86989678IPADDLIBS="$IPADDLIBS"
    8699 
    8700 ##################################
    8701 # Debug compiler warning options #
    8702 ##################################
    8703 
    8704 if test "$debugcompile" = "true"; then
    8705 #ToDo this should only be added for GNU compilers
    8706   CXXFLAGS="$CXXFLAGS -pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Werror -pipe -Wconversion"
    8707 
    8708   CFLAGS="$CFLAGS -pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Werror -pipe"
    8709 fi
    87109679
    87119680##########
     
    87279696
    87289697AMPL_CPPFLAGS="-I\$(top_builddir)/Extern/ASL -I\$(top_srcdir)/Extern/ASL/solvers"
     9698
     9699# Add the compiler warning flags for GNU compilers
     9700# (we can't use them during tests
     9701CFLAGS="$CFLAGS $warn_cflags"
     9702CXXFLAGS="$CXXFLAGS $warn_cxxflags"
    87299703
    87309704#########################
     
    963310607s,@ARFLAGS@,$ARFLAGS,;t t
    963410608s,@AR_X@,$AR_X,;t t
     10609s,@CXX@,$CXX,;t t
     10610s,@CXXFLAGS@,$CXXFLAGS,;t t
     10611s,@LDFLAGS@,$LDFLAGS,;t t
     10612s,@CPPFLAGS@,$CPPFLAGS,;t t
     10613s,@ac_ct_CXX@,$ac_ct_CXX,;t t
     10614s,@EXEEXT@,$EXEEXT,;t t
     10615s,@OBJEXT@,$OBJEXT,;t t
     10616s,@CXXLIBS@,$CXXLIBS,;t t
    963510617s,@CC@,$CC,;t t
    963610618s,@CFLAGS@,$CFLAGS,;t t
    9637 s,@LDFLAGS@,$LDFLAGS,;t t
    9638 s,@CPPFLAGS@,$CPPFLAGS,;t t
    963910619s,@ac_ct_CC@,$ac_ct_CC,;t t
    9640 s,@EXEEXT@,$EXEEXT,;t t
    9641 s,@OBJEXT@,$OBJEXT,;t t
    9642 s,@CXX@,$CXX,;t t
    9643 s,@CXXFLAGS@,$CXXFLAGS,;t t
    9644 s,@ac_ct_CXX@,$ac_ct_CXX,;t t
     10620s,@F77@,$F77,;t t
     10621s,@FFLAGS@,$FFLAGS,;t t
     10622s,@ac_ct_F77@,$ac_ct_F77,;t t
     10623s,@FLIBS@,$FLIBS,;t t
    964510624s,@RANLIB@,$RANLIB,;t t
    964610625s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
     
    968510664s,@CXXCPP@,$CXXCPP,;t t
    968610665s,@EGREP@,$EGREP,;t t
    9687 s,@F77@,$F77,;t t
    9688 s,@FFLAGS@,$FFLAGS,;t t
    9689 s,@ac_ct_F77@,$ac_ct_F77,;t t
    9690 s,@FLIBS@,$FLIBS,;t t
    969110666s,@IPADDLIBS@,$IPADDLIBS,;t t
    969210667s,@TAUCS_INCFLAGS@,$TAUCS_INCFLAGS,;t t
    969310668s,@ASLMAKEFLAGS@,$ASLMAKEFLAGS,;t t
    969410669s,@ASLMAKEFILECMDS@,$ASLMAKEFILECMDS,;t t
    9695 s,@CXXLIBS@,$CXXLIBS,;t t
    969610670s,@ASTYLE@,$ASTYLE,;t t
    969710671s,@ASTYLEFLAGS@,$ASTYLEFLAGS,;t t
  • branches/dev/configure.ac

    r438 r441  
    1 # Copyright (C) 2004, 2005, International Business Machines and others.
     1# Copyright (C) 2004, 2005 International Business Machines and others.
    22# All Rights Reserved.
    33# This file is distributed under the Common Public License.
     
    2828AC_CANONICAL_BUILD
    2929
    30 # Set variables for the archiver
     30##########################################
     31# Set variables for the archiver         #
     32# (for AIX in 64bit mode also on SGI...) #
     33##########################################
    3134if test -z "$AR"; then
    3235  AR="ar"
     
    4649  AC_HELP_STRING([--enable-debug], [compile with debug options and runtime tests]),
    4750  [case "${enableval}" in
    48     yes) debugcompile=true ;;
     51    yes) debugcompile=true
     52         AC_DEFINE([IP_DEBUG],[1],
     53                   [If defined, debug sanity checks are performed during runtime])
     54         ;;
    4955    no)  debugcompile=false ;;
    5056    *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
    5157  esac],[debugcompile=false])
    5258
    53 ####################
    54 # Compiler Options #
    55 ####################
    56 
    57 if test "$debugcompile" = "true"; then
    58   AC_DEFINE([IP_DEBUG],[1],[If defined, debug sanity checks are performed during runtime])
     59########################
     60# C++ Compiler Options #
     61########################
     62
     63AC_LANG_PUSH(C++)
     64SAVE_CXXFLAGS="$CXXFLAGS"
     65AC_PROG_CXX([icpc cl xlC aCC CC g++])
     66CXXFLAGS="$SAVE_CXXFLAGS"
     67
     68warn_cxxflags=
     69
     70if test -z "$CXXFLAGS"; then
     71  add_cxxflags=
     72  opt_cxxflags=
     73  dbg_cxxflags=
     74
     75  if test "$GXX" = "yes"; then
     76    case "$CXX" in
     77      icpc | */icpc) ;;
     78      *)
     79        opt_cxxflags="-O3 -funroll-loops"
     80        case $build in
     81          i686-* )
     82            CXXFLAGS="-march=i686 -mfpmath=sse -msse"
     83            AC_MSG_CHECKING([whether flags \"$CXXFLAGS\" work])
     84            AC_TRY_LINK([#include <cmath>],[double s = sin(1.0);],
     85                           [AC_MSG_RESULT([yes]); opt_cxxflags="$opt_cxxflags $CXXFLAGS"],
     86                           [AC_MSG_RESULT([no])])
     87            CXXFLAGS=
     88          ;;
     89        esac
     90        add_cxxflags="-pipe"
     91        dbg_cxxflags="-g"
     92        warn_cxxflags="-pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Werror -Wconversion"
     93        case $build in
     94          *-cygwin*) AC_MSG_CHECKING([whether flag \" -mno-cygwin\" works])
     95                    CXXFLAGS="-mno-cygwin"
     96                    AC_TRY_LINK(,[int i=0; i++;],
     97                                    [AC_MSG_RESULT([yes]); add_cxxflags="-mno-cygwin $add_cxxflags"; use_mingw=yes],
     98                                    [AC_MSG_RESULT([no])])
     99                    CXXFLAGS= ;;
     100        esac ;;
     101    esac
     102  fi
     103  if test -z "$opt_cxxflags"; then
     104    case $build in
     105     *-cygwin*)
     106      case "$CXX" in
     107      cl | */cl)
     108             opt_cxxflags="-Ot1"
     109             add_cxxflags="-nologo"
     110             dbg_cxxflags="-Yd";;
     111      esac;;
     112     *-linux-*)
     113      case "$CXX" in
     114      icpc | */icpc)
     115#             AC_MSG_CHECKING([whether flag \"-fast\" works])
     116#               CXXFLAGS="-fast"
     117#               AC_TRY_RUN(,[int i=0; i++;],
     118#                               [AC_MSG_RESULT([yes]); opt_cxxflags="-fast"],
     119#                               [AC_MSG_RESULT([no]); opt_cxxflags="-O3 -ip -static"])
     120#               CXXFLAGS=
     121             opt_cxxflags="-O3 -ip"
     122             add_cxxflags="-mp -pc64"
     123             dbg_cxxflags="-g"
     124             # Check if -i_dynamic is necessary (for new glibc library)
     125             AC_MSG_CHECKING([whether flag \"-i_dynamic\" is needed])
     126             CXXFLAGS=
     127             AC_TRY_LINK(,[int i=0; i++;],
     128                         [AC_MSG_RESULT([apparently not])],
     129                         [AC_MSG_RESULT([seems so]);
     130                               add_cxxflags="-i_dynamic $add_cxxflags"])
     131             ;;
     132      esac;;
     133    *-ibm-*)
     134      case "$CXX" in
     135      xlC* | */xlC* | mpxlC* | */mpxlC*)
     136             opt_cxxflags="-O5 -qmaxmem=-1"
     137             add_cxxflags="-bmaxdata:0x80000000"
     138             dbg_cxxflags="-g";;
     139      esac;;
     140    *-hp-*)
     141      case "$CXX" in
     142      aCC | */aCC )
     143             opt_cxxflags="+O4"
     144             add_cxxflags="-AA -qrtti=dyna"
     145             dbg_cxxflags="-g";;
     146      esac;;
     147    *-sun-*)
     148             opt_cxxflags="-O5"
     149             dbg_cxxflags="-g";;
     150    esac
     151  fi
     152
     153  if test "$ac_cv_prog_cxx_g" = yes && test -z "$dbg_cxxflags" ; then
     154    dbg_cxxflags="-g"
     155  fi
     156
     157  if test "$debugcompile" = "true"; then
     158    CXXFLAGS="$dbg_cxxflags $add_cxxflags"
     159  else
     160    if test -z "$opt_cxxflags"; then
     161# Try if -O option works if nothing else is set
     162      CXXFLAGS="-O"
     163      AC_TRY_LINK([],[int i=0; i++;],[opt_cxxflags="-O"],[])
     164    fi
     165    CXXFLAGS="$opt_cxxflags $add_cxxflags"
     166  fi
     167fi
     168
     169# Try if CXXFLAGS works
     170AC_MSG_CHECKING([whether CXXFLAGS=\"$CXXFLAGS\" works])
     171AC_TRY_LINK([],[int i=0; i++;],[],[CXXFLAGS=])
     172if test -z "$CXXFLAGS"; then
     173  AC_MSG_RESULT([no])
     174  AC_MSG_WARN([This value for CXXFLAGS does not work.  I will now just try '-O', but you might want to set CXXFLAGS manually.])
     175  CXXFLAGS='-O'
     176  AC_TRY_LINK([],[int i=0; i++;],[],[CXXFLAGS=])
    59177  if test -z "$CXXFLAGS"; then
    60     CXXFLAGS="-g"
    61   fi
    62 
     178    AC_MSG_RESULT([no])
     179    AC_MSG_WARN([This value for CXXFLAGS does not work.  I will continue with empty CXXFLAGS, but you might want to set CXXFLAGS manually.])
     180  fi
     181else
     182  AC_MSG_RESULT([yes])
     183fi
     184
     185# C++ link libraries #
     186AC_ARG_VAR(CXXLIBS,[Libraries necessary for linking C++ code with Fortran compiler])CXXLIBS=
     187if test -z "$CXXLIBS"; then
     188  if test "$GXX" = "yes"; then
     189    case "$CXX" in
     190      icpc | */icpc)
     191        CXXLIBS=""
     192        ;;
     193      *)
     194        CXXLIBS="-lstdc++ -lm -lgcc_s -lgcc"
     195        ;;
     196    esac
     197  fi
     198  if test -z "$opt_cxxflags"; then
     199    case $build in
     200     *-linux-*)
     201      case "$CXX" in
     202      icpc | */icpc)
     203        CXXLIBS=""
     204             ;;
     205      esac;;
     206    *-ibm-*)
     207      CXXLIBS="-lC -lc"
     208      ;;
     209    *-hp-*)
     210      CXXLIBS="-L/opt/aCC/lib -l++ -lstd_v2 -lCsup_v2 -lm -lcl -lc"
     211      ;;
     212    *-sun-*)
     213      CXXLIBS="-lCstd -lCrun"
     214    esac
     215  fi
     216fi
     217if test -z "$CXXLIBS"; then
     218  AC_MSG_WARN([Could not automatically determine CXXLIBS (C++ link libraries; necessary if main program is in Fortran of C).])
     219else
     220  AC_MSG_NOTICE([Assuming that CXXLIBS is \"$CXXLIBS\".])
     221fi
     222AC_LANG_POP(C++)
     223
     224######################
     225# C Compiler Options #
     226######################
     227
     228SAVE_CFLAGS="$CFLAGS"
     229AC_PROG_CC([icc cl pgcc xlc cc gcc cl])
     230CFLAGS="$SAVE_CFLAGS"
     231
     232warn_cflags=
     233
     234if test -z "$CFLAGS"; then
     235  add_cflags=
     236  opt_cflags=
     237  dbg_cflags=
     238
     239  if test "$GCC" = "yes"; then
     240    case "$CC" in
     241      icc | */icc) ;;
     242      *)
     243        opt_cflags="-O3 -funroll-loops"
     244        case $build in
     245          i686-* )
     246            myCFLAGS="-march=i686 -mfpmath=sse -msse"
     247            AC_MSG_CHECKING([whether  flags \"$myCFLAGS\" work])
     248# This is a trick to make sure that the math library is included
     249            CFLAGS="$myCFLAGS -lm"
     250            AC_TRY_LINK([#include <math.h>],[double s = sin(1.0);],
     251                           [AC_MSG_RESULT([yes]); opt_cflags="$opt_cflags $myCFLAGS"],
     252                           [AC_MSG_RESULT([no])])
     253            CFLAGS=
     254          ;;
     255        esac
     256        add_cflags="-pipe"
     257        dbg_cflags="-g"
     258        warn_cflags="-pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Werror "
     259        case $build in
     260          *-cygwin*) AC_MSG_CHECKING([whether flag \"-mno-cygwin\" works])
     261                    CFLAGS="-mno-cygwin"
     262                    AC_TRY_LINK(,[int i=0; i++;],
     263                                    [AC_MSG_RESULT([yes]); add_cflags="-mno-cygwin $add_cflags"; use_mingw=yes],
     264                                    [AC_MSG_RESULT([no])])
     265                    CFLAGS= ;;
     266        esac ;;
     267    esac
     268  fi
     269  if test -z "$opt_cflags"; then
     270    case $build in
     271     *-cygwin*)
     272      case "$CC" in
     273      cl | */cl)
     274             opt_cflags="-Ot1"
     275             add_cflags="-nologo"
     276             dbg_cflags="-Yd";;
     277      esac;;
     278     *-linux-*)
     279      case "$CC" in
     280      icc | */icc)
     281#             AC_MSG_CHECKING([whether flag \"-fast\" works])
     282#               CFLAGS="-fast"
     283#               AC_TRY_RUN(,[int i=0; i++;],
     284#                               [AC_MSG_RESULT([yes]); opt_cflags="-fast"],
     285#                               [AC_MSG_RESULT([no]); opt_cflags="-O3 -ipo -static"])
     286#               CFLAGS=
     287             opt_cflags="-O3 -ip"
     288             add_cflags="-mp -pc64"
     289             dbg_cflags="-g"
     290             # Check if -i_dynamic is necessary (for new glibc library)
     291             AC_MSG_CHECKING([whether flag \"-i_dynamic\" is needed])
     292             CFLAGS=
     293             AC_TRY_LINK(,[int i=0; i++;],
     294                         [AC_MSG_RESULT([apparently not])],
     295                         [AC_MSG_RESULT([seems so]);
     296                               add_cflags="-i_dynamic $add_cflags"])
     297             ;;
     298      pgcc | */pgcc)
     299             opt_cflags="-fast"
     300             add_cflags="-Kieee -Mstabs -pc 64"
     301             dbg_cflags="-g" ;;
     302      esac;;
     303    *-ibm-*)
     304      case "$CC" in
     305      xlc* | */xlc* | mpxlc* | */mpxlc*)
     306             opt_cflags="-O5 -qmaxmem=-1"
     307             add_cflags="-bmaxdata:0x80000000"
     308             dbg_cflags="-g";;
     309      esac;;
     310    *-hp-*)
     311             opt_cflags="+O4"
     312             add_cflags="-Ae"
     313             dbg_cflags="-g";;
     314    *-sun-*)
     315             opt_cflags="-O5"
     316             dbg_cflags="-g";;
     317    *-sgi-*)
     318             opt_cflags="-O -OPT:Olimit=0"
     319             dbg_cflags="-g";;
     320    esac
     321  fi
     322
     323  if test "$ac_cv_prog_cc_g" = yes && test -z "$dbg_cflags" ; then
     324    dbg_cflags="-g"
     325  fi
     326
     327  if test "$debugcompile" = "true"; then
     328    CFLAGS="$dbg_cflags $add_cflags"
     329  else
     330    if test -z "$opt_cflags"; then
     331# Try if -O option works if nothing else is set
     332      CFLAGS="-O"
     333      AC_TRY_LINK([],[int i=0; i++;],[opt_cflags="-O"],[])
     334    fi
     335    CFLAGS="$opt_cflags $add_cflags"
     336  fi
     337fi
     338
     339# Try if CFLAGS works
     340AC_MSG_CHECKING([whether CFLAGS=\"$CFLAGS\" works])
     341AC_TRY_LINK([],[int i=0; i++;],[],[CFLAGS=])
     342if test -z "$CFLAGS"; then
     343  AC_MSG_RESULT([no])
     344  AC_MSG_WARN([This value for CFLAGS does not work.  I will now just try '-O', but you might want to set CFLAGS manually.])
     345  CFLAGS='-O'
     346  AC_TRY_LINK([],[int i=0; i++;],[],[CFLAGS=])
    63347  if test -z "$CFLAGS"; then
    64     CFLAGS="-g"
    65   fi
    66 
     348    AC_MSG_RESULT([no])
     349    AC_MSG_WARN([This value for CFLAGS does not work.  I will continue with empty CFLAGS, but you might want to set CFLAGS manually.])
     350  fi
     351else
     352  AC_MSG_RESULT([yes])
     353fi
     354
     355###################################
     356#   Fortran 77 compiler options   #
     357###################################
     358
     359AC_LANG_PUSH(Fortran 77)
     360SAVE_FFLAGS="$FFLAGS"
     361AC_PROG_F77(ifort ifc pgf77 xlf fort77 f77 g77 df)
     362FFLAGS="$SAVE_FFLAGS"
     363
     364if test -z "$FFLAGS"; then
     365  add_fflags=
     366  opt_fflags=
     367  dbg_fflags=
     368
     369  if test "$G77" = "yes"; then
     370    opt_fflags="-O3 -funroll-loops"
     371    case $build in
     372      i686-* )
     373        FFLAGS="-march=i686 -mfpmath=sse -msse"
     374        AC_MSG_CHECKING([whether flags \"$FFLAGS\" work])
     375        AC_TRY_LINK(,[
     376      double precision x
     377      x = sin(1.d0)],
     378                       [AC_MSG_RESULT([yes]); opt_fflags="$opt_fflags $FFLAGS"],
     379                       [AC_MSG_RESULT([no])])
     380        FFLAGS=
     381      ;;
     382    esac
     383    add_fflags="-pipe"
     384    dbg_fflags="-g"
     385    case $build in
     386      *-cygwin*) AC_MSG_CHECKING([whether flag \"-mno-cygwin\" works])
     387                FFLAGS="-mno-cygwin"
     388                AC_TRY_LINK(,[      write(*,*) 'Hello world'],
     389                                [AC_MSG_RESULT([yes]); add_fflags="-mno-cygwin $add_fflags"],
     390                                [AC_MSG_RESULT([no])])
     391                FFLAGS= ;;
     392    esac
     393  else
     394    case $build in
     395    *-cygwin*)
     396      case $F77 in
     397      ifort | */ifort)
     398             opt_fflags="-O3"
     399             add_fflags="-nologo -Qprec -fpp"
     400             dbg_fflags="-debug" ;;
     401      esac;;
     402    *-linux-*)
     403      case $F77 in
     404      ifc | */ifc | ifort | */ifort)
     405#             AC_MSG_CHECKING([whether flag \"-fast\" works])
     406#               FFLAGS="-fast"
     407#               AC_TRY_RUN(,[      write(*,*) 'Hello world'],
     408#                               [AC_MSG_RESULT([yes]); opt_fflags="-fast"],
     409#                               [AC_MSG_RESULT([no]); opt_fflags="-O3 -ipo -static"])
     410#               FFLAGS=
     411             opt_fflags="-O3 -ip"
     412             add_fflags="-mp -pc64 -cm -w90 -w95"
     413             dbg_fflags="-g -CA -CB -CS -CU"
     414             # Check if -i_dynamic is necessary (for new glibc library)
     415             AC_MSG_CHECKING([whether flag \"-i_dynamic\" is needed])
     416             FFLAGS=
     417             AC_TRY_LINK(,[      write(*,*) 'Hello world'],
     418                         [AC_MSG_RESULT([apparently not])],
     419                         [AC_MSG_RESULT([seems so]);
     420                               add_fflags="-i_dynamic $add_fflags"])
     421             ;;
     422      pgf77 | */pgf77)
     423             opt_fflags="-fast"
     424             add_fflags="-Kieee -Mstabs -pc 64"
     425             dbg_fflags="-g" ;;
     426      esac;;
     427    *-ibm-*)
     428      case $F77 in
     429      xlf* | */xlf* | mpxlf* | */mpxlf* )
     430             opt_fflags="-O5 -qmaxmem=-1"
     431             add_fflags="-bmaxdata:0x80000000"
     432             dbg_fflags="-g -C";;
     433      esac;;
     434    *-hp-*)
     435             opt_fflags="+O2"
     436             add_fflags="+U77"
     437             dbg_fflags="-C -g";;
     438    *-sun-*)
     439             opt_fflags="-O5"
     440             dbg_fflags="-g";;
     441    *-sgi-*)
     442             opt_fflags="-O5 -OPT:Olimit=0"
     443             dbg_fflags="-g";;
     444    esac
     445  fi
     446
     447  if test "$ac_cv_prog_f77_g" = yes && test -z "$dbg_fflags" ; then
     448    dbg_fflags="-g"
     449  fi
     450
     451  if test "$debugcompile" = true; then
     452    FFLAGS="$dbg_fflags $add_fflags"
     453  else
     454    if test -z "$opt_fflags"; then
     455# Try if -O option works if nothing else is set
     456      AC_MSG_CHECKING([whether FFLAGS=\"-O\" works])
     457      FFLAGS=-O
     458      AC_TRY_LINK(,[      integer i],[AC_MSG_RESULT([yes]); opt_fflags="-O"],[AC_MSG_RESULT([no])])
     459    fi
     460    FFLAGS="$opt_fflags $add_fflags"
     461  fi
     462fi
     463
     464# Try if FFLAGS works
     465AC_MSG_CHECKING([whether FFLAGS=\"$FFLAGS\" works])
     466AC_TRY_LINK([],[      integer i],[],[FFLAGS=])
     467if test -z "$FFLAGS"; then
     468  AC_MSG_RESULT([no])
     469  AC_MSG_WARN([This value for FFLAGS does not work.  I will now jst try '-O', but you might want to set FFLAGS manually.])
     470  FFLAGS='-O'
     471  AC_TRY_LINK([],[      integer i],[],[FFLAGS=])
    67472  if test -z "$FFLAGS"; then
    68     FFLAGS="-g"
     473    AC_MSG_RESULT([no])
     474    AC_MSG_WARN([This value for FFLAGS does not work.  I will continue with empty FFLAGS, but you might want to set FFLAGS manually.])
    69475  fi
    70476else
    71   if test -z "$CXXFLAGS"; then
    72     CXXFLAGS="-O3 -pipe"
    73   fi
    74 
    75   if test -z "$CFLAGS"; then
    76     CFLAGS="-O3 -pipe"
    77   fi
    78 
    79   if test -z "$FFLAGS"; then
    80     FFLAGS="-O3"
    81   fi
    82 fi
    83 
    84 SAVE_CFLAGS="$CFLAGS"
    85 #AC_PROG_CC([icc cl pgcc xlc cc gcc cl])
    86 AC_PROG_CC
    87 CFLAGS="$SAVE_CFLAGS"
    88 
    89 SAVE_CXXFLAGS="$CXXFLAGS"
    90 #AC_PROG_CXX([icpc cl KCC CC cxx cc++ xlC aCC c++ g++ egcs gcc])
    91 AC_PROG_CXX
    92 CXXFLAGS="$SAVE_CXXFLAGS"
     477  AC_MSG_RESULT([yes])
     478fi
     479
     480AC_F77_WRAPPERS
     481
     482case $build in
     483# The following is a fix to define FLIBS for ifort on Windows
     484   *-cygwin*)
     485     case $F77 in
     486       ifort | */ifort)
     487           FLIBS="libifcorert.lib libcmt.lib /link /NODEFAULTLIB:libc.lib $LIBS";;
     488     esac;;
     489   *-hp-*)
     490       FLIBS="$FLIBS -lm";;
     491esac
    93492
    94493AC_PROG_RANLIB
     
    235634AC_LANG_POP(C++)
    236635
    237 ###################################
    238 #   Fortran 77 compiler options   #
    239 ###################################
    240 
    241 AC_LANG_PUSH(Fortran 77)
    242 SAVE_FFLAGS="$FFLAGS"
    243 #AC_PROG_F77(ifort ifc pgf77 xlf fort77 f77 g77 df)
    244 AC_PROG_F77
    245 FFLAGS="$SAVE_FFLAGS"
    246 
    247 AC_F77_WRAPPERS
    248 
    249 case $build in
    250 # The following is a fix to define FLIBS for ifort on Windows
    251    *-cygwin*)
    252      case $F77 in
    253        ifort | */ifort)
    254            FLIBS="libifcorert.lib libcmt.lib /link /NODEFAULTLIB:libc.lib $LIBS";;
    255      esac;;
    256    *-hp-*)
    257        FLIBS="$FLIBS -lm";;
    258 esac
    259 
    260636##########################################################################
    261637
     
    552928    else
    553929      AC_MSG_CHECKING([whether $am_make understands the `-j 1' flag])
    554       AC_LANG_CONFTEST([[bla:]])
    555       if ($am_make -f conftest.c -j 1 bla >&5) 2>&5 ; then
     930      AC_LANG_CONFTEST([[bladfaoekja:]])
     931      if ($am_make -f conftest.c -j 1 bladfaoekja >&5) 2>&5 ; then
    556932        AC_MSG_RESULT([yes])
    557933        ASLMAKEFLAGS="-j 1 $ASLMAKEFLAGS"
     
    559935        AC_MSG_RESULT([no])
    560936        AC_MSG_CHECKING([whether $am_make understands the `-J 1' flag])
    561         if ($am_make -f conftest.c -J 1 bla >&5) 2>&5 ; then
     937        if ($am_make -f conftest.c -J 1 bladfaoekja >&5) 2>&5 ; then
    562938          AC_MSG_RESULT([yes])
    563939          ASLMAKEFLAGS="-J 1 $ASLMAKEFLAGS"
     
    603979#fi
    604980
    605 ######################
    606 # C++ link libraries #
    607 ######################
    608 if test -z "$CXXLIBS"; then
    609   CXXLIBS="-L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2 -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../.. -lstdc++ -lm -lgcc_s -lgcc"
    610 fi
    611 AC_ARG_VAR(CXXLIBS,[Libraries necessary for linking C++ code with Fortran compiler])
    612981
    613982IPADDLIBS="$IPADDLIBS"
    614 
    615 ##################################
    616 # Debug compiler warning options #
    617 ##################################
    618 
    619 if test "$debugcompile" = "true"; then
    620 #ToDo this should only be added for GNU compilers
    621   CXXFLAGS="$CXXFLAGS -pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Werror -pipe -Wconversion"
    622 
    623   CFLAGS="$CFLAGS -pedantic-errors -Wimplicit -Wparentheses -Wsequence-point -Wreturn-type -Wcast-qual -Wall -Werror -pipe"
    624 fi
    625983
    626984##########
     
    6421000AC_SUBST(AMPL_CPPFLAGS)
    6431001AMPL_CPPFLAGS="-I\$(top_builddir)/Extern/ASL -I\$(top_srcdir)/Extern/ASL/solvers"
     1002
     1003# Add the compiler warning flags for GNU compilers
     1004# (we can't use them during tests
     1005CFLAGS="$CFLAGS $warn_cflags"
     1006CXXFLAGS="$CXXFLAGS $warn_cxxflags"
    6441007
    6451008#########################
Note: See TracChangeset for help on using the changeset viewer.