coin-or / Clp

COIN-OR Linear Programming Solver
Other
396 stars 82 forks source link

enable-aboca=1 does not compile #139

Closed svigerske closed 4 years ago

svigerske commented 4 years ago

With the current master and --enable-aboca=1, I get an error due to abcstate_ not being defined:

../../src/AbcSimplexDual.cpp: In member function ‘void AbcSimplexDual::statusOfProblemInDual(int)’:
../../src/AbcSimplexDual.cpp:3036:5: error: ‘abcState_’ was not declared in this scope; did you mean ‘abcState’?
 3036 |     abcState_ |= CLP_ABC_BEEN_FEASIBLE;
      |     ^~~~~~~~~
      |     abcState
../../src/AbcSimplexDual.cpp:3150:7: error: ‘abcState_’ was not declared in this scope; did you mean ‘abcState’?
 3150 |       abcState_ |= CLP_ABC_BEEN_FEASIBLE;
      |       ^~~~~~~~~
      |       abcState
../../src/AbcSimplexDual.cpp:3203:7: error: ‘abcState_’ was not declared in this scope; did you mean ‘abcState’?
 3203 |       abcState_ |= CLP_ABC_BEEN_FEASIBLE;
      |       ^~~~~~~~~
      |       abcState
../../src/AbcSimplexDual.cpp:3253:5: error: ‘abcState_’ was not declared in this scope; did you mean ‘abcState’?
 3253 |     abcState_ |= CLP_ABC_BEEN_FEASIBLE;
      |     ^~~~~~~~~
      |     abcState
../../src/AbcSimplexDual.cpp:3263:5: error: ‘abcState_’ was not declared in this scope; did you mean ‘abcState’?
 3263 |     abcState_ |= CLP_ABC_BEEN_FEASIBLE;
      |     ^~~~~~~~~
      |     abcState
../../src/AbcSimplexDual.cpp:3440:52: error: ‘abcState_’ was not declared in this scope; did you mean ‘abcState’?
 3440 |           if ((moreSpecialOptions_ & 256) == 0 || (abcState_ & CLP_ABC_BEEN_FEASIBLE) != 0) {
      |                                                    ^~~~~~~~~
      |                                                    abcState

There is this chunk of code in ClpSimplex.hpp that should probably have taken care of getting abcstate_, but I guess ABOCA_LITE or ABCSTATE_LITE did not get defined appropriately?

#ifndef ABC_INHERIT
#if ABOCA_LITE
void moveAndZero(clpTempInfo *info, int type, void *extra);
// 2 is owner of abcState_
#ifdef ABCSTATE_LITE
#if ABCSTATE_LITE == 2
int abcState_ = 0;
#else
extern int abcState_;
#endif
inline int abcState()
{
  return abcState_;
}
inline void setAbcState(int state)
{
  abcState_ = state;
}
#endif
#else
#define abcState 0
#endif
#endif
svigerske commented 4 years ago

Fixed by @jjhforrest in recent commits.