Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex and solver together

    Posted 02/01/10 02:57 AM

    Originally posted by: sidgalt


    Hey,

    I need to use IloCplex and IloSolver together. Unfortunately, whenever I try to compile them together, I get linking errors full of references to "undefined reference to IloAlgorithmI".

    Any help would be appreciated.

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex and solver together

    Posted 02/01/10 03:05 AM

    Originally posted by: SystemAdmin


    Seems like you are not linking with all required libraries or linking in the wrong order.
    What version/platform do you use?
    What is your linker command line?
    What is the exact error message?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex and solver together

    Posted 02/01/10 03:22 AM

    Originally posted by: sidgalt


    Hey,
    I'm using Debian Lenny 5. Here's the relevant part of the makefile :-

    SOLVERDIR=/com/ilog/solver64.lintel
    CONCERTDIR=$(SOLVERDIR)/../concert24
    CPLEXDIR=/com/ilog/cplex100.lintel/cplex100
     
    EXDIR=$(SOLVERDIR)/examples
    EXSRC=$(EXDIR)/src
    EXINC=$(EXDIR)/include
    EXDATA=$(EXDIR)/data
     
    CPLEXINCDIR   = $(CPLEXDIR)/include
    SOLVERIncDir=$(SOLVERDIR)/include
    CONCERTIncDir=$(CONCERTDIR)/include
     
    DEMODIR=$(SOLVERDIR)/examples
    DEMOSRCDIR=$(DEMODIR)/src
     
    CPLEXLIBDIR   = $(CPLEXDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
    CPLEXBINDIR   = $(CPLEXDIR)/bin/$(BINDIST)
    CPLEXJARDIR   = $(CPLEXDIR)/lib/cplex.jar
     
    CFLAGS=$(CSYSFLAGS) $(OPT) $(OPTIONS) -I$(SOLVERIncDir) -I$(CONCERTIncDir) -I$(EXINC) $(CMTFLAGS) -I$(CPLEXINCDIR)
     
    LDFLAGS=-L$(SOLVERDIR)/lib/$(SYSTEM)/$(LIBFORMAT) -lsolver -lsolverfloat \ 
    -L$(CONCERTDIR)/lib/$(SYSTEM)/$(LIBFORMAT) -lconcert $(LDSYSFLAGS) $(LDMTFLAGS) $(LIBS) -L$(CPLEXLIBDIR) \
    -lilocplex -lcplex
    


    CFLAGS are the include flags and LDFLAGS are the library flags

    Here's part of the error message :
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilocplex.o):(.gnu.linkonce.d._ZTV9IloBoundI+0x48): undefined reference to `IloExtractableI::expandTo(IloModelI*) const'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::removeForAll(IloForAllI const*, IloCplexI::Data*)':
    ilodeflpextr.cpp:(.text+0x976): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloCplexExtractForallOp::applyAnd(void*, IloExtractableI const*, IloExtractableI const*)':
    ilodeflpextr.cpp:(.text+0xbd7): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    ilodeflpextr.cpp:(.text+0xc03): undefined reference to `IloForAllRange::IloForAllRange(IloEnv, IloForAllI*, long, void*, char*)'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloCplexExtractForallOp::apply(void*, IloExtractableI const*, IloExtractableI const*)':
    ilodeflpextr.cpp:(.text+0xc8e): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    ilodeflpextr.cpp:(.text+0xcf4): undefined reference to `IloForAllRange::IloForAllRange(IloEnv, IloForAllI*, long, void*, char*)'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::extractForAll(IloForAllI const*, IloCplexI::Data**)':
    ilodeflpextr.cpp:(.text+0x237f): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::removeConditionalConstraint(IloConditionalConstraintI const*, IloCplexI::Data*)':
    ilodeflpextr.cpp:(.text+0x2907): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::extractConditionalConstraint(IloConditionalConstraintI const*, IloCplexI::Data**)':
    ilodeflpextr.cpp:(.text+0x2edf): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::extractBinaryNumConstraint(IloBinaryNumConstraintI const*, int, int**)':
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cplex and solver together

    Posted 02/01/10 03:31 AM

    Originally posted by: SystemAdmin


    IloExtractableI::expandTo(IloModel*) is defined in libconcert.a and referenced from libilocplex.a.
    Thus -lilocplex should be before -lconcert in the linker argument list. Does it help to put -lconcert
    at the back of the linker command line?
    Or even better, does your compiler/linker support something like '--start-group' and '--end-group'
    and you can wrap all ILOG libraries between that?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Cplex and solver together

    Posted 02/01/10 03:38 AM

    Originally posted by: sidgalt


    >> Does it help to put -lconcert at the back of the linker command line?

    I tried that but it is still failing

    >> does your compiler/linker support something like '--start-group' and '--end-group' and you can wrap all ILOG libraries between that?

    I'm using g++ so I think it does. Could you give an example of how to do that?

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Cplex and solver together

    Posted 02/01/10 03:44 AM

    Originally posted by: sidgalt


    Here's the new error message btw,

    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilocplex.o):(.gnu.linkonce.d._ZTV9IloBoundI+0x48): undefined reference to `IloExtractableI::expandTo(IloModelI*) const'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::removeForAll(IloForAllI const*, IloCplexI::Data*)':
    ilodeflpextr.cpp:(.text+0x976): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloCplexExtractForallOp::applyAnd(void*, IloExtractableI const*, IloExtractableI const*)':
    ilodeflpextr.cpp:(.text+0xbd7): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    ilodeflpextr.cpp:(.text+0xc03): undefined reference to `IloForAllRange::IloForAllRange(IloEnv, IloForAllI*, long, void*, char*)'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloCplexExtractForallOp::apply(void*, IloExtractableI const*, IloExtractableI const*)':
    ilodeflpextr.cpp:(.text+0xc8e): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    ilodeflpextr.cpp:(.text+0xcf4): undefined reference to `IloForAllRange::IloForAllRange(IloEnv, IloForAllI*, long, void*, char*)'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::extractForAll(IloForAllI const*, IloCplexI::Data**)':
    ilodeflpextr.cpp:(.text+0x237f): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::removeConditionalConstraint(IloConditionalConstraintI const*, IloCplexI::Data*)':
    ilodeflpextr.cpp:(.text+0x2907): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::extractConditionalConstraint(IloConditionalConstraintI const*, IloCplexI::Data**)':
    ilodeflpextr.cpp:(.text+0x2edf): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilodeflpextr.o): In function `IloDefaultLPExtractor::extractBinaryNumConstraint(IloBinaryNumConstraintI const*, int, int**)':
    ilodeflpextr.cpp:(.text+0x461a): undefined reference to `IloAlgorithmI::getModelEvaluator()'
    ilodeflpextr.cpp:(.text+0x4645): undefined reference to `IloModelEvaluatorI::hasSubstitutionExpr(IloNumExprI const*) const'
    ilodeflpextr.cpp:(.text+0x4810): undefined reference to `IloModelEvaluatorI::hasSubstitutionExpr(IloNumExprI const*) const'
    ilodeflpextr.cpp:(.text+0x4829): undefined reference to `IloModelEvaluatorI::getSubstitutionAsNumExpr(IloNumExprI const*) const'
    ilodeflpextr.cpp:(.text+0x487f): undefined reference to `IloModelEvaluatorI::getSubstitutionAsNumExpr(IloNumExprI const*) const'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilologicextr.o):(.gnu.linkonce.d._ZTV18IloRangeIndicatorI+0x48): undefined reference to `IloExtractableI::expandTo(IloModelI*) const'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilologicextr.o):(.gnu.linkonce.d._ZTV18IloNumEqIndicatorI+0x48): undefined reference to `IloExtractableI::expandTo(IloModelI*) const'
    /com/ilog/cplex100.lintel/cplex100/lib/x86_rhel4.0_3.4/static_pic/libilocplex.a(ilologicextr.o):(.gnu.linkonce.d._ZTV18IloNumGeIndicatorI+0x48): undefined reference to `IloExtractableI::expandTo(IloModelI*) const'
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Cplex and solver together

    Posted 02/01/10 03:45 AM

    Originally posted by: SystemAdmin


    To use the start/end-group stuff you add '-Wl,--start-group' (note: no blanks) before the first ILOG library and '-Wl,--end-group' after the last ILOG library. The linker will then search all the libraries until it finds no more undefined references.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Cplex and solver together

    Posted 02/01/10 03:59 AM

    Originally posted by: sidgalt


    For some reason it is still giving the same errors as before. Do you know where I could find a sample makefile so I could see where exactly I was going wrong?

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Cplex and solver together

    Posted 02/01/10 04:03 AM

    Originally posted by: SystemAdmin


    Hi!

    You cannot link CPLEX 10.0 to Concert 2.4 since they have different ABI. Always use versions that are aligned to each other. CPLEX 10.0 for instance requires Concert 2.2. That also means that if you need to use CPLEX and Solver in the same binary these two products need to be aligned (from the same release period) as well.

    Robert
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Cplex and solver together

    Posted 02/01/10 04:22 AM

    Originally posted by: sidgalt


    Hey, changing Cplex10 to Cplex10.2 worked

    Thanks a lot
    #CPLEXOptimizers
    #DecisionOptimization