Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Native code library failed to load

    Posted 04/13/12 05:26 AM

    Originally posted by: SongYang


    Caused by: java.lang.RuntimeException: Native code library failed to load: ensure the appropriate library (opl124.dll/.so) is in your path.

    This is the error message. I have already include the library but it still can not find these dlls. Could you please help me to fix it.
    Thanks a lot.

    Below is my .sh file
    #!/bin/bash
    #=================== eb.sh =====================

    #PBS -l mem=6000mb,nodes=1:ppn=1,walltime=23:30:00
    #PBS -m abe -M user@tudelft.nl
    #PBS -o eb_${PBS_JOBID}.o
    #PBS -e eb_${PBS_JOBID}.e
    #PBS -V

    cd ${PBS_O_WORKDIR}
    LD_LIBRARY_PATH=/home/syang/data/ILOG/CPLEX_Studio_Academic124/opl/bin/x86_win32/
    export LD_LIBRARY_PATH
    export ILOG_LICENSE_FILE=/home/syang/data/ilm/access.ilm

    java -Djava.library.path=/home/syang/data/ILOG/CPLEX_Studio_Academic124/opl/bin/x86_win32 -jar /home/syang/data/TestServer/TestCplex.jar &> /home/syang/data/TestServer/outConsole.txt

    #================================================

    This is my Java program which can normally run on my computer, but it has errors in the cluster.

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package testserver;
    import ilog.concert.*;
    import ilog.cplex.*;
    import ilog.opl.*;
    import java.io.*;

    /**
    *
    * @author songyang
    */
    public class TestServer {

    public static void main(String[] args) {
    try
    {
    IloOplFactory.setDebugMode(true);
    IloOplFactory oplF = new IloOplFactory();

    IloOplErrorHandler errHandler = oplF.createOplErrorHandler(System.out);
    IloOplSettings settings = oplF.createOplSettings(errHandler);

    IloOplModelSource modelSource = oplF.createOplModelSource("/home/syang/data/TestServer/Java.mod");
    IloOplModelDefinition def = oplF.createOplModelDefinition(modelSource,settings);
    IloCplex cplex = oplF.createCplex();
    IloOplDataSource dataSource= oplF.createOplDataSource("/home/syang/data/TestServer/Java.dat");
    IloOplModel opl = oplF.createOplModel(def, cplex);
    opl.addDataSource(dataSource);

    double objective_result;

    IloOplRunConfiguration rc = oplF.createOplRunConfiguration(opl.getModelDefinition(), opl.makeDataElements());
    rc.getCplex().setOut(null);
    rc.getOplModel().generate();

    double opx;
    if (rc.getCplex().solve())
    {
    objective_result = rc.getOplModel().getCplex().getObjValue();

    System.out.println("The optimum value is:");
    System.out.println(objective_result);
    BufferedWriter bw = new BufferedWriter(new FileWriter("/home/syang/data/TestServer/result111.txt"));
    String str=String.valueOf(objective_result);

    bw.write(str);

    bw.close();

    IloOplDataElements myData;
    //myData= rc.getOplModel().makeDataElements();
    IloOplElement myVariable = rc.getOplModel().getElement("bb");
    double mymap = myVariable.asNum();

    IloOplElement yrVariable=rc.getOplModel().getElement("aa");
    IloNumMap array=yrVariable.asNumMap();
    double aa=array.getSub(1).get(1);
    System.out.println("myDecVarible = " + mymap);
    System.out.println("array variable"+aa);

    }
    else
    {
    System.out.println("No solution!");
    System.out.flush();
    }
    //opx=map.get(1);

    //System.out.println(opx);
    rc.end();
    rc = null;
    }catch( Exception e) {

    e.printStackTrace();
    }
    // TODO code application logic here
    }

    }
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Native code library failed to load

    Posted 04/25/12 04:46 AM

    Originally posted by: SystemAdmin


    Hello,
    I see that your model is being solved by the CPLEX engine and that you subsequently posted several other questions on the CPLEX forums. Did you clear out the issue you mention here ?
    Philippe
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Native code library failed to load

    Posted 04/25/12 04:48 AM

    Originally posted by: SongYang


    Yes, thanks. The problem is solved.
    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Native code library failed to load

    Posted 05/06/12 12:09 PM

    Originally posted by: gustavokambara


    Could you please tell me how you solved the problem?

    Thanks.
    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Native code library failed to load

    Posted 09/13/12 04:37 PM

    Originally posted by: singhxp


    For anyone who is deploying app on WebSphere application server can create LD_LIBRARY_PATH under Application servers > server1 > Process definition > Environment Entries.

    This should pick up the .so objects
    #CPOptimizer
    #DecisionOptimization