Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Errors Running CP Optimizer with Java

    Posted 11/11/11 09:47 PM

    Originally posted by: LuisdelaTorre


    I'm running CPLEX 12.3 on Windows x64. I'm running CPLEX with Eclipse on Java.

    I get the following error:

    Native code library failed to load: ensure the appropriate library
    (opl10.dll/.so) is in your path.
    Exceptions:
    no opl10 in java.library.path
    no opl_lang_wrap_cpp in java.library.path
    no opl_core_wrap_cpp_java10 in java.library.path
    no opl_core_wrap_cpp in java.library.path
    no cp_wrap_cpp_java10 in java.library.path
    no cp_wrap_cpp in java.library.path
    no concert_wrap_cpp_java10 in java.library.path
    no concert_wrap_cpp in java.library.path

    Exception in thread "main" java.lang.ExceptionInInitializerError
    at ilog.concert.cppimpl.IloEnv.<init>(IloEnv.java:49)
    at ilog.concert.IloModelerImpl.<init>(IloModelerImpl.java:34)
    at ilog.cp.IloCP.<init>(IloCP.java:113)
    at ilog.cp.IloCP.<init>(IloCP.java:106)
    at jmetal.util.luis.TestCPOptimizer.runCP(TestCPOptimizer.java:35)
    at jmetal.util.luis.TestCPOptimizer.main(TestCPOptimizer.java:69)
    Caused by: java.lang.RuntimeException: Native code library failed to
    load: ensure the appropriate library (opl10.dll/.so) is in your path.
    Exceptions:
    no opl10 in java.library.path
    no opl_lang_wrap_cpp in java.library.path
    no opl_core_wrap_cpp_java10 in java.library.path
    no opl_core_wrap_cpp in java.library.path
    no cp_wrap_cpp_java10 in java.library.path
    no cp_wrap_cpp in java.library.path
    no concert_wrap_cpp_java10 in java.library.path
    no concert_wrap_cpp in java.library.path

    at ilog.concert.IloJNILoader.loadJNI(IloJNILoader.java:80)
    at ilog.concert.cppimpl.concert_wrapJNI.<clinit>(concert_wrapJNI.java:15)
    ... 6 more
    I've added ILOG.CP.jar, cplex.jar (I'm also using the MIP solver, which I've got working just fine) as external JARs in eclipse. I'm building with -Djava.library.path="C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cpoptimizer\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\opl\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\bin\x64_win64"

    I've installed Visual C++ redistributable.

    I've already looked at this forum post - I don't entirely understand it.

    https://www.ibm.com/developerworks/forums/post!default.jspa?forumID=2066
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Errors Running CP Optimizer with Java

    Posted 11/14/11 04:44 AM

    Originally posted by: rdumeur


    Dear Luis,

    This indeed seems abnormal. Are you actually sure that the eclipse run configuration also specifies the java.library.path correctly?
    I would also suggest that you check that all the dlls are actually in the place where you are expecting them. It could be that the products were not correctly installed or corrupted.
    Finally, I cannot access to the URL that you provided :

    https://www.ibm.com/developerworks/forums/post!default.jspa?forumID=2066

    it points to a blank message-posting page on this forum. Are you sure it is the correct URL?

    Cheers,
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Errors Running CP Optimizer with Java

    Posted 11/16/11 09:21 AM

    Originally posted by: LuisdelaTorre


    Renaud,

    I'm not sure where I got that URL from. The correct one was:

    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14467289

    I'm not sure what all of the dlls (and their correct locations) are that I should be checking.

    Thanks,

    Luis
    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Errors Running CP Optimizer with Java

    Posted 11/16/11 09:23 AM

    Originally posted by: LuisdelaTorre


    Sorry, forgot to confirm that in the eclipse run configuration VM argument, I am including -Djava.library.path="C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cpoptimizer\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\opl\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\bin\x64_win64".
    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Errors Running CP Optimizer with Java

    Posted 11/16/11 10:56 AM

    Originally posted by: rdumeur


    Dear Luis,

    Thanks for the link. I think the reason of your trouble is that the CPO dll actually loads the cplex dll (and does so without recourse to java). So indeed setting the java path is not enough, as explained by C. Doens:

    "Hi Alex,

    Your C:\ILOG\CPOptimizer23\bin\x86_win32\cp_wrap_cpp_java23.dll uses a Cplex DLL delivered in the same repository.
    So could you try to add " C:\ILOG\CPOptimizer23\bin\x86_win32 " to your Path environment variable ?

    Otherwise try to use something like Dependency Walker (http://dependencywalker.com) in order to identify which dependent libraries can't be find.

    Cedric"

    So could you please tell me what happens if you set PATH so as it includes C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\bin\x64_win64 so that the CP dll can load the CPLEX one. This should solve your problem.

    Cheers,
    #CPOptimizer
    #DecisionOptimization


  • 6.  Re: Errors Running CP Optimizer with Java

    Posted 11/16/11 12:48 PM

    Originally posted by: LuisdelaTorre


    I'm not sure which path I should set.

    My Windows user environment variables include

    CPLEX_STUDIO_BINARIES
    C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\opl\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\opl\oplide\;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cpoptimizer\bin\x64_win64

    CPLEX_STUDIO_DIR
    C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123

    PATH
    %CPLEX_STUDIO_BINARIES%

    I've also added environment variable PATH with value

    C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\opl\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\opl\oplide\;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cplex\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio_Academic123\cpoptimizer\bin\x64_win64

    to Environment tab in the run configuration in Eclipse. I get the same errors.

    Thank you!
    #CPOptimizer
    #DecisionOptimization


  • 7.  Re: Errors Running CP Optimizer with Java

    Posted 11/29/11 11:06 AM

    Originally posted by: rdumeur


    Dear Luis,

    First, my apoligies for the late answer. I've reproduced your setup by installing CPLEX studio Academic Initiative 123 on a win64 machine.
    Under eclipse, I have the following run configuration:

    JVM arguments:

    -Djava.library.path=C:\<basedir>\CPLEX_Studio_Academic123\opl\oplide;C:\<installdir>\CPLEX_Studio_Academic123\cplex\bin\x64_win64;C:\<basedir>\CPLEX_Studio_Academic123\cpoptimizer\bin\x64_win64

    env variable

    PATH=C:\<basedir>\CPLEX_Studio_Academic123\cplex\bin\x64_win64

    where <basedir> is the parent of the install directory.
    But I cannot reproduce your problem. Note that if the install dir contains whitespaces, quoting the path for the -D options might be required.
    Did you try that?
    I hope this helps.

    Cheers,
    #CPOptimizer
    #DecisionOptimization