coin-or / Clp

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

CLP_EXTERN_C missing in master/HEAD/Clp_C_Interface.h #283

Closed amigalemming closed 8 months ago

amigalemming commented 8 months ago

In the CLP -1.17.9 release I can reveal the definition of Clp_Simplex in Clp_C_Interface.h by defining the preprocessor symbol CLP_EXTERN_C. With master/HEAD this is not possible. However, I want to define more C wrappers to some C++ methods. How can I do this in a way that works for both the latest release and master/HEAD?

svigerske commented 8 months ago

So you refer to

/* Real typedef for structure */
class CMessageHandler;
typedef struct {
  ClpSimplex *model_;
  CMessageHandler *handler_;
} Clp_Simplex;

(https://github.com/coin-or/CoinUtils/blob/86548bb58c06c562ea7291b2a8e884e840b490f4/CoinUtils/src/Coin_C_defines.h#L52-L57) from CoinUtils 2.11?

I suppose the cleaner way would be to add a function to the C interface of Clp that returns the ClpSimplex* from a given Clp_Simplex struct. Would that be sufficient?

amigalemming commented 8 months ago

On Mon, 1 Jan 2024, Stefan Vigerske wrote:

So you refer to

https://github.com/coin-or/CoinUtils/blob/86548bb58c06c562ea7291b2a8e884e840b490f4/CoinUtils/src/Coin_C_defines.h#L52-L57

from CoinUtils 2.11?

Yes. First of all I wonder, how this file enters the release archive, because it is not present in the Git master branch.

I suppose the cleaner way would be to add a function to the C interface of Clp that returns the ClpSimplex* from a given Clp_Simplex struct. Would that be sufficient?

I think yes. But then there should be a version bump such that I can switch between using the preprocessor symbol or using that accessor function.

tkralphs commented 8 months ago

Yes. First of all I wonder, how this file enters the release archive, because it is not present in the Git master branch.

Releases are not made from master, they are made from stable/x.y. Our versioning system is documented here, although it is admittedly terse.