Decision Optimization

Decision Optimization

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

 View Only
  • 1.  linking error on OSX

    Posted Fri July 22, 2016 08:43 AM

    Originally posted by: Marc Brisson


    Hi,

     

    on OSX I am unable to run a CP java program that I build successfully in IntelliJ IDEA

     

    when I execute I get errors:

     

    Native code library failed to load: ensure the appropriate library (opl1263.dll/.so) is in your path.
    Exceptions:
    no opl1263 in java.library.path
    no opl_lang_wrap_cpp in java.library.path
    no opl_core_wrap_cpp_java1263 in java.library.path
    no opl_core_wrap_cpp in java.library.path
    no cp_oaas1263 in java.library.path
    no cp_oaas in java.library.path
    /Users/marcbrisson/dev/optimization/OptimizationLibrary/libs/libcp_wrap_cpp_java1263.jnilib: dlopen(/Users/marcbrisson/dev/optimization/OptimizationLibrary/libs/libcp_wrap_cpp_java1263.jnilib, 1): Library not loaded: /Users/cplexadmin/jenkins/agent-svcplexdev38/workspace/distrib-branch12.6.3/label/x64-osx.svcplexdev38/bin/x86-64_osx/static_pic/libcplex1263.jnilib
      Referenced from: /Users/marcbrisson/dev/optimization/OptimizationLibrary/libs/libcp_wrap_cpp_java1263.jnilib
      Reason: image not found
    no cp_wrap_cpp in java.library.path
    no concert_wrap_cpp_java1263 in java.library.path
    no concert_wrap_cpp in java.library.path

    ...

     

     

    as you can see libcp_wrap_cpp_java1263.jnilib  is in my java.library.path folder just beside cplex and windows libraries

    j1014741MBP:libs marcbrisson$ pwd

    /Users/marcbrisson/dev/optimization/OptimizationLibrary/libs

    j1014741MBP:libs marcbrisson$ ls

    ILOG.CP.dll            cplex1263.dll            libcplex1263.jnilib

    cp_wrap_cpp_java1263.dll    libcp_wrap_cpp_java1263.jnilib    ojdbc7.jar

     

    this is frustrating because I have the exact same configuration for CPLEX and it runs without any issues.

    any ideas?

     

    Thanks

     

     

     


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: linking error on OSX

    Posted Mon July 25, 2016 10:06 AM

    Originally posted by: ChrisBr


    Hello Marc,

    Did you check your DYLD_LIBRARY_PATH?
    You might have a look at

    here and here

    I hope that helps,

    Chris.


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: linking error on OSX

    Posted Mon August 08, 2016 11:25 AM

    Originally posted by: Marc Brisson


    Hi 

    DYLD_LIBRARY_PATH  was in fact the issue.  Surprisingly on OSX  setting this variable a value doesn't necessarily  propagate in the terminal.  Maybe a problem with SIP.

    now CPLEX doesn't need DYLD_LIBRARY_PATH. It works simply with -Djava.library.path .  At some point cp and cplex should be package the same way.

    Marc

     

     

     

     

     

     


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: linking error on OSX

    Posted Wed April 19, 2017 04:09 AM

    Originally posted by: Guiyu


    Hi,

    I'm struggling with the same issue. 

    I followed the instructions about "Configuring the Eclipse Java IDE to use CPLEX libraries"( the below link). And I can run example java program.

    http://www-01.ibm.com/support/docview.wss?uid=swg21449776

     

     But when I tried to use cp optimizer, i.e. IloCP cp = new ilog.cp.IloCP(); , I got the same error as yours:

    Native code library failed to load: ensure the appropriate library (opl1271.dll/.so) is in your path.

    Exceptions:

    no opl1271 in java.library.path

    no opl_lang_wrap_cpp in java.library.path

    no opl_core_wrap_cpp_java1271 in java.library.path

    no opl_core_wrap_cpp in java.library.path

    no cp_oaas1271 in java.library.path

    no cp_oaas in java.library.path

    /Users/jiangg/Applications/IBM/ILOG/CPLEX_Studio1271/lib/libcp_wrap_cpp_java1271.jnilib: dlopen(/Users/jiangg/Applications/IBM/ILOG/CPLEX_Studio1271/lib/libcp_wrap_cpp_java1271.jnilib, 1): Library not loaded: /nfs/home/cplexadmin/jenkins/agent-optbld30x/workspace/distrib-master/label/x64-osx.optbld30x/bin/x86-64_osx/static_pic/libcplex1271.jnilib

      Referenced from: /Users/jiangg/Applications/IBM/ILOG/CPLEX_Studio1271/lib/libcp_wrap_cpp_java1271.jnilib

      Reason: image not found

    no cp_wrap_cpp in java.library.path

    no concert_wrap_cpp_java1271 in java.library.path

    no concert_wrap_cpp in java.library.path

     

    I set up the env variables:

    export CLASSPATH=$CLASSPATH:(my_path)/CPLEX_Studio1271/cpoptimizer/lib/ILOG.CP.jar

    export LIBRARYPATH=$LIBRARYPATH:(my_path)/CPLEX_Studio1271/cplex/bin/x86-64_osx/:(my_path)/CPLEX_Studio1271/cpoptimizer/bin/x86-64_osx/

    export DYLD_LIBRARY_PATH=(my_path)/CPLEX_Studio1271/cplex/bin/x86-64_osx/:(my_path)/CPLEX_Studio1271/cpoptimizer/bin/x86-64_osx/

    But the error is not fixed.

     


    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: linking error on OSX

    Posted Wed April 19, 2017 04:51 AM

    Originally posted by: Guiyu


    I can use CP optimizer on eclipse now, according to https://www.ibm.com/developerworks/community/forums/html/topic?id=83b7da44-14cd-4949-93fd-b968945cd7e0&ps=25

     

    It set DYLD_LIBRARY_PATH in eclipse --> run configuration --> environment with appropriate path.

     

    Besides, I don't understand why "set DYLD_LIBRARY_PATH via export" does not work when run java program in command line.

     


    #CPOptimizer
    #DecisionOptimization