[Lemon-user] Additional Information: Undefined symbols for architecture x86_64- error (trying to solve MIP with Glpk and/or CPLEX)

Alpár Jüttner alpar at cs.elte.hu
Sat Oct 27 13:32:18 CEST 2012


Hi,

The point is that you should also link CPLEX/GLPK when compiling your
own code. Something like

g++ -O2 Test.cc -lemon -lglpk

or

g++ -O2 Test.cc -lemon /Users/stephan/CodeLibraries/ilog/cplex124/cplex/lib/x86-64_darwin9_gcc4.0/static_pic/libcplex.a

I hope this help.

Regards,
Alpar

On Sat, 2012-10-27 at 22:12 +1300, Stephan Hassold wrote:
> Hello,
> sorry for the spam, but this problem doesn't let me sleep and I have
> tried a couple of different things.
> 1. I suspected it to be the 64 bit OS, so I installed a Ubuntu 32 bit
> virtual machine, but even there the simple LP problems fail with
> basically the same error.
> 2. I have also tried to compile in the terminal instead of using
> codelite, but that does not change anything.
> 3.  I downloaded the latest version from the development branch...
> 
> 
> Here is the cmake command I used:
> 
> 
> cmake  -DGLPK_INCLUDE_DIR=/usr/local/include
> -DGLPK_LIBRARY=/usr/local/lib/libglpk.a
> -DCPLEX_INCLUDE_DIR=/Users/stephan/CodeLibraries/ilog/cplex124/cplex/include/ -DCPLEX_LIBRARY=/Users/stephan/CodeLibraries/ilog/cplex124/cplex/lib/x86-64_darwin9_gcc4.0/static_pic/libcplex.a ..
> 
> 
> "make check" returns that 100% of the tests were successful.
> 
> 
> However, after running 'make install' I tried to compile the simple
> mip- demo from the lemon tutorial and it comes back with the same
> error. The compile command is: g++ -O2 Test.cc -lemon ... I tried to
> use both glpk and Cplex but neither works.
> 
> 
> I ran out of ideas and would really appreciate any help and
> suggestions!
> 
> 
> Thanks a lot!
> 
> 
> stephan
> 
> 
> 
> On 26 October 2012 17:42, <lemon-user-request at lemon.cs.elte.hu> wrote:
>         Send Lemon-user mailing list submissions to
>                 lemon-user at lemon.cs.elte.hu
>         
>         To subscribe or unsubscribe via the World Wide Web, visit
>                 http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>         or, via email, send a message with subject or body 'help' to
>                 lemon-user-request at lemon.cs.elte.hu
>         
>         You can reach the person managing the list at
>                 lemon-user-owner at lemon.cs.elte.hu
>         
>         When replying, please edit your Subject line so it is more
>         specific
>         than "Re: Contents of Lemon-user digest..."
>         
>         
>         Today's Topics:
>         
>            1. Undefined symbols for architecture x86_64- error
>         (Stephan Hassold)
>         
>         
>         ----------------------------------------------------------------------
>         
>         Message: 1
>         Date: Fri, 26 Oct 2012 17:41:34 +1300
>         From: Stephan Hassold <s.hassold at auckland.ac.nz>
>         Subject: [Lemon-user] Undefined symbols for architecture
>         x86_64- error
>         To: lemon-user at lemon.cs.elte.hu
>         Message-ID:
>         
>         <CAN7qaTSJ9xXU5OopvAd=g6KOgRmfAuJyVwFm5MwST-n8jXhxzA at mail.gmail.com>
>         Content-Type: text/plain; charset="utf-8"
>         
>         Hi there,
>         
>         I was trying to run some code before, but the compiler returns
>         Undefined
>         symbols for architecture x86_64- error. The complete error is
>         below.
>         I have tried both the standard mip solver as well as cplex,
>         but both return
>         the same.
>         
>         I could not find anything helpful on the internet. The only
>         related issue
>         was found in this thread (
>         http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14802585)
>         but he is not using Lemon.
>         
>         My system is Mac Os Mountain lion. The compiler
>         is i686-apple-darwin11-llvm-g++-4.2 and I am using Lemon 1.2.3
>         in the
>         latest Codelite release.
>         
>         I'd appreciate any suggestions and help!!
>         
>         Thanks!!
>         Regards,
>         Stephan
>         
>         ERROR MESSAGE:
>         
>         Undefined symbols for architecture x86_64:
>           "_CPXbaropt", referenced from:
>               lemon::CplexLp::solveBarrier()     in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgbds", referenced from:
>               virtual thunk to
>         lemon::CplexBase::_setColUpperBound(int, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setColUpperBound(int, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               virtual thunk to
>         lemon::CplexBase::_setColLowerBound(int, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setColLowerBound(int, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgcoef", referenced from:
>               virtual thunk to lemon::CplexBase::_setCoeff(int, int,
>         double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setCoeff(int, int, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgcoeflist", referenced from:
>               lemon::CplexBase::_setColCoeffs(int,
>         lemon::LpBase::ExprIterator,
>         lemon::LpBase::ExprIterator)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setRowCoeffs(int,
>         lemon::LpBase::ExprIterator,
>         lemon::LpBase::ExprIterator)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_addRow(double,
>         lemon::LpBase::ExprIterator,
>         lemon::LpBase::ExprIterator, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgcolname", referenced from:
>               virtual thunk to lemon::CplexBase::_setColName(int,
>         std::basic_string<char, std::char_traits<char>,
>         std::allocator<char> >
>         const&)in libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setColName(int,
>         std::basic_string<char,
>         std::char_traits<char>, std::allocator<char> > const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgctype", referenced from:
>               lemon::CplexMip::_setColType(int,
>         lemon::MipSolver::ColTypes)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgobj", referenced from:
>               virtual thunk to lemon::CplexBase::_setObjCoeff(int,
>         double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setObjCoeff(int, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>         
>         lemon::CplexBase::_setObjCoeffs(lemon::LpBase::ExprIterator,
>         lemon::LpBase::ExprIterator)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgobjsen", referenced from:
>               virtual thunk to
>         lemon::CplexBase::_setSense(lemon::LpBase::Sense)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setSense(lemon::LpBase::Sense)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgprobtype", referenced from:
>               lemon::CplexMip::CplexMip(lemon::CplexEnv const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexMip::CplexMip(lemon::CplexEnv const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexMip::CplexMip()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexMip::CplexMip()in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgrhs", referenced from:
>               lemon::CplexBase::_set_row_bounds(int, double, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgrngval", referenced from:
>               lemon::CplexBase::_set_row_bounds(int, double, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgrowname", referenced from:
>               virtual thunk to lemon::CplexBase::_setRowName(int,
>         std::basic_string<char, std::char_traits<char>,
>         std::allocator<char> >
>         const&)in libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setRowName(int,
>         std::basic_string<char,
>         std::char_traits<char>, std::allocator<char> > const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXchgsense", referenced from:
>               lemon::CplexBase::_set_row_bounds(int, double, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXcloneprob", referenced from:
>               lemon::CplexBase::CplexBase(lemon::CplexBase const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::CplexBase(lemon::CplexBase const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXcloseCPLEX", referenced from:
>               lemon::CplexEnv::~CplexEnv()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexEnv::~CplexEnv()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::~CplexBase()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::~CplexBase()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::~CplexBase()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::CplexBase(lemon::CplexEnv const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::CplexBase(lemon::CplexEnv const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               ...
>           "_CPXcreateprob", referenced from:
>               virtual thunk to lemon::CplexBase::_clear()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_clear()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::CplexBase(lemon::CplexEnv const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::CplexBase(lemon::CplexEnv const&)in
>         libemon.a(lemon_libemon_la-cplex.o)
>                lemon::CplexBase::CplexBase()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::CplexBase()in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXdelcols", referenced from:
>               virtual thunk to lemon::CplexBase::_eraseCol(int)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_eraseCol(int) in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXdelrows", referenced from:
>               virtual thunk to lemon::CplexBase::_eraseRow(int)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_eraseRow(int) in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXdualopt", referenced from:
>               lemon::CplexLp::solveDual()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXfreeprob", referenced from:
>               virtual thunk to lemon::CplexBase::_clear()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_clear()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::~CplexBase()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::~CplexBase()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::~CplexBase()in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetbase", referenced from:
>               lemon::CplexLp::_getColStatus(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::_getRowStatus(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetcoef", referenced from:
>               virtual thunk to lemon::CplexBase::_getCoeff(int, int)
>         constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getCoeff(int, int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetcolindex", referenced from:
>               virtual thunk to
>         lemon::CplexBase::_colByName(std::basic_string<char,
>         std::char_traits<char>, std::allocator<char> > const&) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_colByName(std::basic_string<char,
>         std::char_traits<char>, std::allocator<char> > const&) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetcolname", referenced from:
>               lemon::CplexBase::_getColName(int,
>         std::basic_string<char,
>         std::char_traits<char>, std::allocator<char> >&) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetcols", referenced from:
>               lemon::CplexBase::_getColCoeffs(int,
>         lemon::LpBase::InsertIterator)
>         constin libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetctype", referenced from:
>               lemon::CplexMip::_getColType(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgeterrorstring", referenced from:
>               lemon::CplexEnv::LicenseError::LicenseError(int)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexEnv::LicenseError::LicenseError(int)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexEnv::CplexEnv()in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetlb", referenced from:
>               virtual thunk to
>         lemon::CplexBase::_getColLowerBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getColLowerBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetnumcols", referenced from:
>               lemon::CplexLp::_getPrimalRay(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::_getColStatus(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>         
>         lemon::CplexBase::_getObjCoeffs(lemon::LpBase::InsertIterator)
>         constin libemon.a(lemon_libemon_la-cplex.o)
>               virtual thunk to lemon::CplexBase::_addCol()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_addCol()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetnumrows", referenced from:
>               lemon::CplexLp::_getRowStatus(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_addRow(double,
>         lemon::LpBase::ExprIterator,
>         lemon::LpBase::ExprIterator, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               virtual thunk to lemon::CplexBase::_addRow()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_addRow()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetobj", referenced from:
>               virtual thunk to lemon::CplexBase::_getObjCoeff(int)
>         constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getObjCoeff(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>         
>         lemon::CplexBase::_getObjCoeffs(lemon::LpBase::InsertIterator)
>         constin libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetobjsen", referenced from:
>               virtual thunk to lemon::CplexBase::_getSense() constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getSense() constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetobjval", referenced from:
>               lemon::CplexMip::_getSolValue() constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::_getPrimalValue() constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetpi", referenced from:
>               lemon::CplexLp::_getDual(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetray", referenced from:
>               lemon::CplexLp::_getPrimalRay(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetrhs", referenced from:
>               virtual thunk to
>         lemon::CplexBase::_getRowLowerBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getRowLowerBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setRowUpperBound(int, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getRowUpperBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetrngval", referenced from:
>               lemon::CplexBase::_getRowUpperBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetrowindex", referenced from:
>               virtual thunk to
>         lemon::CplexBase::_rowByName(std::basic_string<char,
>         std::char_traits<char>, std::allocator<char> > const&) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_rowByName(std::basic_string<char,
>         std::char_traits<char>, std::allocator<char> > const&) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetrowname", referenced from:
>               lemon::CplexBase::_getRowName(int,
>         std::basic_string<char,
>         std::char_traits<char>, std::allocator<char> >&) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetrows", referenced from:
>               lemon::CplexBase::_getRowCoeffs(int,
>         lemon::LpBase::InsertIterator)
>         constin libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetsense", referenced from:
>               lemon::CplexLp::_getRowStatus(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               virtual thunk to
>         lemon::CplexBase::_getRowLowerBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getRowLowerBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_setRowUpperBound(int, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getRowUpperBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetstat", referenced from:
>               lemon::CplexMip::_getType() constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::_getDualType() constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::_getPrimalType() constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::convertStatus(int)  in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::solveBarrier()     in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::solveDual()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::solvePrimal()     in
>         libemon.a(lemon_libemon_la-cplex.o)
>               ...
>           "_CPXgetub", referenced from:
>               virtual thunk to
>         lemon::CplexBase::_getColUpperBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_getColUpperBound(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXgetx", referenced from:
>               lemon::CplexMip::_getSol(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::_getPrimal(int) constin
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXlpopt", referenced from:
>               lemon::CplexLp::_solve()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXmipopt", referenced from:
>               lemon::CplexMip::_solve()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXnewcols", referenced from:
>               virtual thunk to lemon::CplexBase::_addCol()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_addCol()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXnewrows", referenced from:
>               lemon::CplexBase::_addRow(double,
>         lemon::LpBase::ExprIterator,
>         lemon::LpBase::ExprIterator, double)in
>         libemon.a(lemon_libemon_la-cplex.o)
>               virtual thunk to lemon::CplexBase::_addRow()in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexBase::_addRow()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXopenCPLEX", referenced from:
>               lemon::CplexEnv::CplexEnv()in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXprimopt", referenced from:
>               lemon::CplexLp::solvePrimal()     in
>         libemon.a(lemon_libemon_la-cplex.o)
>           "_CPXsetintparam", referenced from:
>               lemon::CplexBase::_applyMessageLevel()     in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexMip::_solve()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::solveBarrier()     in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::solveDual()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::solvePrimal()     in
>         libemon.a(lemon_libemon_la-cplex.o)
>               lemon::CplexLp::_solve()    in
>         libemon.a(lemon_libemon_la-cplex.o)
>         ld: symbol(s) not found for architecture x86_64
>         collect2: ld returned 1 exit status
>         make[1]: *** [Release/Thesis] Error 1
>         make[1]: Leaving directory `/Users/***'
>         make: *** [All] Error 2
>         make: Leaving directory `/Users/*****'
>         ----------Build Ended----------
>         0 errors, 0 warnings
>         -------------- next part --------------
>         An HTML attachment was scrubbed...
>         URL:
>         http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20121026/03ca3616/attachment.htm
>         
>         ------------------------------
>         
>         _______________________________________________
>         Lemon-user mailing list
>         Lemon-user at lemon.cs.elte.hu
>         http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>         
>         
>         End of Lemon-user Digest, Vol 58, Issue 3
>         *****************************************
> 
> 
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user





More information about the Lemon-user mailing list