Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  UnsatisfiedLinkError Linux

    Posted 07/13/12 12:19 PM

    Originally posted by: GeoffGross


    I am attempting to setup a simple CPLEX model on a Linux machine which has CPLEX successfully installed (I assume since I am able to run CPLEX without any licensing errors). However, when I try to create the IloCplex instance I get an "UnsatisfiedLinkError". I do pass what I believe to be the correct VM argument to the java program: "-Djava.library.path=/opt/ibm/ILOG/CPLEX_Studio124/cplex/bin/x86_sles10_4.1", however I still get this error.

    I do not know where to go from here to diagnose the issue. Any suggestions would be appreciated.

    Thanks.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: UnsatisfiedLinkError Linux

    Posted 07/13/12 04:35 PM

    Originally posted by: SystemAdmin


    Depending on how comfortable you are with console tools you could use 'strace -e trace=open' on your Java process to see what files java actually attempts to open.
    Other things to check:
    1. Does directory /opt/ibm/ILOG/CPLEX_Studio124/cplex/bin/x86_sles10_4.1 contain a file libcplex124.so that is accessible to you?
    2. You are pointing the JVM to a directory with a 32bit library. This may not work if the JVM expects a 64bit library. Do things work better if you replace 'x86_sles10_4.1' in the path by 'x86-64_sles10_4.1'?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: UnsatisfiedLinkError Linux

    Posted 07/15/12 03:35 PM

    Originally posted by: GeoffGross


    I attempted to execute the program+strace, but there is no 'open()' line that seems to indicate an attempt to open a file in /opt/ibm/ILOG/....

    The file libcplex124.so does exist in the specified folder and I am executing the program with root privileges.

    I do not have folder 'x86-64_sles10_4.1' but I am using a 32bit java version.

    Do you have any other suggestions?
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: UnsatisfiedLinkError Linux

    Posted 07/15/12 04:34 PM

    Originally posted by: SystemAdmin


    Two things to note here:
    1. The JVM is multi-threaded and may not open the file in the main thread/process.
    2. The JVM may first check for existence of the file using stat() or something else.
    Here is what I usually do to trace what Java does (there may be better way):
    rm javalog.*
    strace -o javalog -ff java <arguments to java>
    grep libcplex javalog.*
    

    This shows what files the JVM tries to access when searching for libcplex124.so. It also shows the return values for stat() and open().
    Do you see anything suspicious there?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: UnsatisfiedLinkError Linux

    Posted 07/15/12 07:19 PM

    Originally posted by: GeoffGross


    This helped me notice it was searching for libcplex124.so in many incorrect locations, but not /opt/ibm/ILOG/CPLEX_Studio124/cplex/bin/x86_sles10_4.1.

    The problem was that I was placing the VM argument after the jar call when explicitly writing it out. This doesn't however explain what happened to the VM argument when compiling with Eclipse in Windows (the argument was on the correct project to address Paul's point).

    Thanks for everyone's help.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: UnsatisfiedLinkError Linux

    Posted 07/15/12 05:10 PM

    Originally posted by: SystemAdmin


    No idea if this applies to your case, but I recently had an email exchange with someone who had similar symptoms. He was using an IDE (Netbeans), and passing the VM argument through a project setting within the IDE. The problem turned out to be that the CPLEX code was in a different project from the main program (a GUI), and he had the VM argument in the properties of the CPLEX project but not in the main project.

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization