coin-or / Cbc.old

This is a mirror of the subversion repository on COIN-OR
https://projects.coin-or.org/Cbc
Other
88 stars 30 forks source link

[Trac #176] COIN-OR Cbc FTBFS on mips* platforms due to variable name conflict #34

Open s-c-e opened 5 years ago

s-c-e commented 5 years ago

image

When compiling cbc 2.9.8 on Linux mips* platforms, an error will be triggered:

 g++ -DHAVE_CONFIG_H -I. -I. -I../src -I/usr/include/coin -I/usr/include/coin/ -DCOIN_NO_CLP_MESSAGE -DUSE_CBCCONFIG -D_FORTIFY_SOURCE=2 -pipe -Wno-error -fstack-protector-strong --param=ssp-buffer-size=4 -fomit-frame-pointer -O3 -mabi=64 -march=mips64r2 -mtune=loongson3a -fira-loop-pressure -fira-hoist-pressure -ftree-vectorize -specs=/usr/lib/autobuild3/specs/hardened-cc1 -fpermissive -fdeclone-ctor-dtor -ftree-vectorize -DCBC_BUILD -MT CbcBranchDynamic.lo -MD -MP -MF .deps/CbcBranchDynamic.Tpo -c CbcBranchDynamic.cpp  -fPIC -DPIC -o .libs/CbcBranchDynamic.o
CbcModel.hpp:2397:78: error: expected ',' or '...' before numeric constant
     void setMIPStart( const std::vector< std::pair< std::string, double > > &mips ) {
                                                                              ^
CbcModel.hpp: In member function 'void CbcModel::setMIPStart(const std::vector<std::pair<std::basic_string<char>, double> >&)':
CbcModel.hpp:2398:26: error: no match for 'operator=' (operand types are 'std::vector<std::pair<std::basic_string<char>, double> >' and 'int')
        this->mipStart_ = mips;
                          ^

Because of the platform Cbc is built on (tested on mipsel and mips64el) it seems that somewhere ahead of this variable name has a constant definition named 'mips', causing 'mips' here be replaced by a "numeric constant" (it might be 1, representing "True").

This problem prevents Cbc from building on mips* platforms. By replacing the variable name (See our patch: ​https://github.com/AOSC-Dev/aosc-os-abbs/blob/staging/extra-scientific/cbc/autobuild/patches/CbcModel-hpp-fix-mips-variable-constant-conflict.patch) this problem can be resolved. Enclosing it.