Cbc with c++ libtorch undefined reference
- Dominant language
- C++
- Stars
- 1k
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
Only use cbc is fine for me。
Only use c++ libtorch fine too。
but when I want use libtorch to do some Heuristic。I link libtorch in cmakelist。Caused:
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::addCol(CoinPackedVectorBase const&, double, double, double, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::CoinParam(std::string, std::string, double, double, double, bool)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiSolverInterface::getObjName(unsigned int) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::setRowName(int, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParamUtils::getCommand(int, char const**, std::string, std::string*)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::getStrParam(OsiStrParam, std::string&) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `ClpModel::setRowName(int, std::string&)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiSolverInterface::getRowNames()'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::CoinParam(std::string, std::string, std::string, bool)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::setColName(int, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::appendKwd(std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::getRowName(int, unsigned int) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::getStrParam(OsiStrParam, std::string&) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::setKwdVal(std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `ClpModel::getRowName(int) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::getColName(int, unsigned int) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParamUtils::lookupParam(std::string, std::vector >&, int*, int*, int*)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinMessageHandler::operator<<(std::string const&)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::addCol(int, int const*, double const*, double, double, double, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `fileCoinReadable(std::string&, std::string const&)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiSolverInterface::setColNames(std::vector >&, int, int, int)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiSolverInterface::dfltRowColName(char, int, unsigned int) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::addRow(CoinPackedVectorBase const&, double, double, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::CoinParam(std::string, std::string, int, int, int, bool)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `fileAbsPath(std::string const&)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParamUtils::printHelp(std::vector >&, int, int, std::string, bool, bool, bool)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::strVal() const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::setStrParam(OsiStrParam, std::string const&)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `ClpModel::getColumnName(int) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::setColName(int, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiSolverInterface::setRowNames(std::vector >&, int, int, int)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::addCol(int, int const*, double const*, double, double, double, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::getColName(int, unsigned int) const'
../bin/libBMILPS.so.0.1.0: undefined reference to `CbcHeuristic::smallBranchAndBound(OsiSolverInterface*, int, double*, double&, double, std::__cxx11::basic_string, std::allocator >) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::addCol(CoinPackedVectorBase const&, double, double, double, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::addRow(CoinPackedVectorBase const&, char, double, double, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::setStrVal(std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::addRow(CoinPackedVectorBase const&, char, double, double, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiSolverInterface::getColNames()'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::getRowName(int, unsigned int) const'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `OsiClpSolverInterface::setRowName(int, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::CoinParam(std::string, std::string, bool)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParamUtils::getStringField(int, char const**, int*)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `ClpModel::setColumnName(int, std::string&)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::addRow(CoinPackedVectorBase const&, double, double, std::string)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `virtual thunk to OsiClpSolverInterface::setStrParam(OsiStrParam, std::string const&)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::CoinParam(std::string, std::string, std::string, int, bool)'
third/Cbc/src/libCbc.so.0.1.0: undefined reference to `CoinParam::kwdVal() const'
collect2: error: ld returned 1 exit status
Can you give me some help?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the CMakeLists configuration that links libtorch, third/Cbc/src/libCbc.so.0.1.0, and ../bin/libBMILPS.so.0.1.0, then inspect the complete linker command and the Cbc/CLP/OSI library dependencies. Reproduce the reported undefined references and verify that the affected C++ target links successfully with the libtorch integration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, pytorch
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100