Changeset 1468 for trunk/Cbc/examples


Ignore:
Timestamp:
Jun 13, 2010 8:35:15 AM (8 years ago)
Author:
stefan
Message:

do not require CbcConfig?.h in example to decide whether sample or miplib3 is present - do this in makefile

Location:
trunk/Cbc/examples
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/examples/Makefile.in

    r1464 r1468  
    4949
    5050# C++ Compiler options
    51 CXXFLAGS = @CXXFLAGS@ -DSAMPLEDIR=\"@SAMPLE_DATA@\" -DMIPLIB3DIR=\"@MIPLIB3_DATA@\"
     51CXXFLAGS = @CXXFLAGS@
     52@COIN_HAS_SAMPLE_TRUE@CXXFLAGS += -DSAMPLEDIR=\"@SAMPLE_DATA@\"
     53@COIN_HAS_SAMPLE_TRUE@CXXFLAGS += -DMIPLIB3DIR=\"@MIPLIB3_DATA@\"
    5254
    5355# C Compiler options
    54 CFLAGS = @CFLAGS@ -DSAMPLEDIR=\"@SAMPLE_DATA@\"
     56CFLAGS = @CFLAGS@
     57@COIN_HAS_SAMPLE_TRUE@CFLAGS += -DSAMPLEDIR=\"@SAMPLE_DATA@\"
    5558
    5659# additional C++ Compiler options for linking
  • trunk/Cbc/examples/allCuts.cpp

    r1464 r1468  
    241241  // and assert that it is a clean model
    242242  std::string mpsFileName;
    243 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     243#if defined(SAMPLEDIR)
    244244  mpsFileName = SAMPLEDIR "/p0033.mps";
    245245#else
  • trunk/Cbc/examples/barrier.cpp

    r1464 r1468  
    5959  // and assert that it is a clean model
    6060  std::string mpsFileName;
    61 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     61#if defined(SAMPLEDIR)
    6262  mpsFileName = SAMPLEDIR "/p0033.mps";
    6363#else
  • trunk/Cbc/examples/cbc_driverC_sos.c

    r1464 r1468  
    44/* This example shows the use of the "C" interface for CBC. */
    55
    6 #include "CbcConfig.h"
    76#include "Cbc_C_Interface.h"
    87#include <stdio.h>
     
    7170  /* Keep names when reading an mps file */
    7271  if (argc<2) {
    73 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     72#if defined(SAMPLEDIR)
    7473    status=Cbc_readMps(model, SAMPLEDIR "/p0033.mps");
    7574#else
  • trunk/Cbc/examples/crew.cpp

    r1464 r1468  
    1010
    1111
    12 #include "CbcConfig.h"
    1312// For Branch and bound
    1413#include "OsiClpSolverInterface.hpp"
     
    3736  // and assert that it is a clean model
    3837  std::string mpsFileName;
    39 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     38#if defined(SAMPLEDIR)
    4039  mpsFileName = SAMPLEDIR "/p0033.mps";
    4140#else
  • trunk/Cbc/examples/driver.cpp

    r1464 r1468  
    3737  // and assert that it is a clean model
    3838  std::string mpsFileName;
    39 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     39#if defined(SAMPLEDIR)
    4040  mpsFileName = SAMPLEDIR "/p0033.mps";
    4141#else
  • trunk/Cbc/examples/driver2.cpp

    r1464 r1468  
    1212// For Branch and bound
    1313//#include "CbcStrategy.hpp"
    14 #include "CbcConfig.h"
    1514#include "OsiCbcSolverInterface.hpp"
    1615
     
    3837  // and assert that it is a clean model
    3938  std::string mpsFileName;
    40 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     39#if defined(SAMPLEDIR)
    4140  mpsFileName = SAMPLEDIR "/p0033.mps";
    4241#else
  • trunk/Cbc/examples/driver3.cpp

    r1464 r1468  
    99#include <iomanip>
    1010
    11 #include "CbcConfig.h"
    1211#include "CbcModel.hpp"
    1312#include "OsiClpSolverInterface.hpp"
     
    4342  // and assert that it is a clean model
    4443  std::string mpsFileName;
    45 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     44#if defined(SAMPLEDIR)
    4645  mpsFileName = SAMPLEDIR "/p0033.mps";
    4746#else
  • trunk/Cbc/examples/driver4.cpp

    r1464 r1468  
    1010
    1111
    12 #include "CbcConfig.h"
    1312#include "CbcModel.hpp"
    1413#include "OsiClpSolverInterface.hpp"
     
    210209  // and assert that it is a clean model
    211210  std::string mpsFileName;
    212 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     211#if defined(SAMPLEDIR)
    213212  mpsFileName = SAMPLEDIR "/p0033.mps";
    214213#else
  • trunk/Cbc/examples/hotstart.cpp

    r1464 r1468  
    1010
    1111
    12 #include "CbcConfig.h"
    1312// For Branch and bound
    1413#include "OsiSolverInterface.hpp"
     
    6261  // and assert that it is a clean model
    6362  std::string mpsFileName;
    64 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     63#if defined(SAMPLEDIR)
    6564  mpsFileName = SAMPLEDIR "/p0033.mps";
    6665#else
  • trunk/Cbc/examples/longthin.cpp

    r1464 r1468  
    1010
    1111
    12 #include "CbcConfig.h"
    1312// For Branch and bound
    1413#include "OsiSolverInterface.hpp"
     
    4645  // and assert that it is a clean model
    4746  std::string mpsFileName;
    48 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     47#if defined(SAMPLEDIR)
    4948  mpsFileName = SAMPLEDIR "/p0033.mps";
    5049#else
  • trunk/Cbc/examples/lotsize.cpp

    r1464 r1468  
    1010
    1111
    12 #include "CbcConfig.h"
    1312// For Branch and bound
    1413#include "CbcModel.hpp"
     
    3837  // and assert that it is a clean model
    3938  std::string mpsFileName;
    40 #if defined(COIN_HAS_MIPLIB3) && defined(MIPLIB3DIR)
     39#if defined(MIPLIB3DIR)
    4140  mpsFileName = MIPLIB3DIR "/10teams";
    4241#else
  • trunk/Cbc/examples/minimum.cpp

    r1464 r1468  
    22// Corporation and others.  All Rights Reserved.
    33
    4 #include "CbcConfig.h"
    54#include "CbcModel.hpp"
    65
     
    1312  // Read in example model
    1413  // and assert that it is a clean model
    15 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     14#if defined(SAMPLEDIR)
    1615  int numMpsReadErrors = solver1.readMps(SAMPLEDIR "/p0033.mps","");
    1716  assert(numMpsReadErrors==0);
  • trunk/Cbc/examples/nway.cpp

    r1464 r1468  
    1010
    1111
    12 #include "CbcConfig.h"
    1312// For Branch and bound
    1413#include "CbcModel.hpp"
     
    3736  // and assert that it is a clean model
    3837  std::string mpsFileName;
    39 #if defined(COIN_HAS_MIPLIB3) && defined(MIPLIB3DIR)
     38#if defined(MIPLIB3DIR)
    4039  mpsFileName = MIPLIB3DIR "/10teams";
    4140#else
  • trunk/Cbc/examples/repeat.cpp

    r1464 r1468  
    6666  // and assert that it is a clean model
    6767  std::string mpsFileName;
    68 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     68#if defined(SAMPLEDIR)
    6969  mpsFileName = SAMPLEDIR "/p0033.mps";
    7070#else
  • trunk/Cbc/examples/sample2.cpp

    r1464 r1468  
    1010
    1111
    12 #include "CbcConfig.h"
    1312// For Branch and bound
    1413#include "OsiSolverInterface.hpp"
     
    7675  const char dirsep =  CoinFindDirSeparator();
    7776  std::string mpsFileName;
    78 #if defined(COIN_HAS_SAMPLE) && defined(SAMPLEDIR)
     77#if defined(SAMPLEDIR)
    7978  mpsFileName = SAMPLEDIR "/p0033.mps";
    8079#else
  • trunk/Cbc/examples/sos.cpp

    r1464 r1468  
    1010
    1111
    12 #include "CbcConfig.h"
    1312// For Branch and bound
    1413#include "CbcModel.hpp"
     
    3736  // and assert that it is a clean model
    3837  std::string mpsFileName;
    39 #if defined(COIN_HAS_MIPLIB3) && defined(MIPLIB3DIR)
     38#if defined(MIPLIB3DIR)
    4039  mpsFileName = MIPLIB3DIR "/10teams";
    4140#else
Note: See TracChangeset for help on using the changeset viewer.