Decision Optimization

 View Only
  • 1.  C++

    Posted Thu July 17, 2008 01:59 PM

    Originally posted by: SystemAdmin


    [Almada-Lobo said:]

    Hi,

    I'm not able to compile a C++ warehouse.cpp example through the available makefile. I'm getting the following error:

    CC -pto -PIC -xtarget=ultra -xarch=v8plusa -DIL_STD -xO4 -DNDEBUG  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -DILOUSEMT -mt  /mit/oplstudio_v5.5/distrib/sun4x_510/opl55/examples/cpp/src/warehouse.cpp -c
    CC: Warning: -xarch=v8plusa is deprecated, use -m32 -xarch=sparcvis instead
    "/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include/ilconcert/ilotuplecollectioni.h", line 688: Warning: IloTupleSetI::sort hides the virtual function IloDiscreteDataCollectionI::sort(long).
    1 Warning(s) detected.
    CC -pto -PIC -xtarget=ultra -xarch=v8plusa -DIL_STD -xO4 -DNDEBUG  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -DILOUSEMT -mt  warehouse.o -o warehouse -L/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/lib/ultrasparc32_9_8/static_pic_mt  -lopl -liljs  -L/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/lib/ultrasparc32_9_8/static_pic_mt  -lilocplex -lcp -lconcert  -L/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/bin/ultrasparc32_9_8  -lcplex110  -ldbkernel -ldblnkdyn -lilog -ldl  -lsocket -lnsl -lm -lsunmath  -mt 
    CC: Warning: -xarch=v8plusa is deprecated, use -m32 -xarch=sparcvis instead
    ./warehouse
    ld.so.1: warehouse: fatal: libcplex110.so: open failed: No such file or directory
    *** Signal 9
    make: Fatal error: Command failed for target `execute'


    Thanks,
    Bernardo
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: C++

    Posted Thu July 17, 2008 02:18 PM

    Originally posted by: SystemAdmin


    [rocarvaj said:]

    [quote author=Almada-Lobo link=topic=418.msg1201#msg1201 date=1216285160]
    Hi,

    I'm not able to compile a C++ warehouse.cpp example through the available makefile. I'm getting the following error:

    CC -pto -PIC -xtarget=ultra -xarch=v8plusa -DIL_STD -xO4 -DNDEBUG  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -DILOUSEMT -mt   /mit/oplstudio_v5.5/distrib/sun4x_510/opl55/examples/cpp/src/warehouse.cpp -c
    CC: Warning: -xarch=v8plusa is deprecated, use -m32 -xarch=sparcvis instead
    "/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include/ilconcert/ilotuplecollectioni.h", line 688: Warning: IloTupleSetI::sort hides the virtual function IloDiscreteDataCollectionI::sort(long).
    1 Warning(s) detected.
    CC -pto -PIC -xtarget=ultra -xarch=v8plusa -DIL_STD -xO4 -DNDEBUG  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -I/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/include  -DILOUSEMT -mt   warehouse.o -o warehouse -L/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/lib/ultrasparc32_9_8/static_pic_mt  -lopl -liljs  -L/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/lib/ultrasparc32_9_8/static_pic_mt  -lilocplex -lcp -lconcert  -L/mit/oplstudio_v5.5/distrib/sun4x_510/opl55/bin/ultrasparc32_9_8  -lcplex110  -ldbkernel -ldblnkdyn -lilog -ldl  -lsocket -lnsl -lm -lsunmath  -mt 
    CC: Warning: -xarch=v8plusa is deprecated, use -m32 -xarch=sparcvis instead
    ./warehouse
    ld.so.1: warehouse: fatal: libcplex110.so: open failed: No such file or directory

    It looks like it's not finding libcplex110.so... Something similar happened to me once.

    *** Signal 9
    make: Fatal error: Command failed for target `execute'

    You can add the path where libcplex110.so is located to [tt]LD_LIBRARY_PATH[/tt]. For example, in my case (have to write this in the command line):
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/ilog/cplex110/bin/x86_rhel4.0_3.4
    export LD_LIBRARY_PATH

    (it should be in the bin/ folder of cplex).

    To make this permanent, you can add the previous two lines to your [tt].bash_profile[/tt].

    Hope this helps!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: C++

    Posted Thu July 17, 2008 02:53 PM

    Originally posted by: SystemAdmin


    [Almada-Lobo said:]

    Thanks Rodolfo. However, in the LDFLAGS of makefile, the path to libcplex110.so is well defined. Anyway, after writing the LD_LIBRARY_PATH is the command line, i get the following error: Bad : modifier in $ (/).
    Do you know how to solve it?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: C++

    Posted Thu July 17, 2008 06:40 PM

    Originally posted by: SystemAdmin


    [Almada-Lobo said:]

    Hi,

    I've managed to add the path where libcplex110.so is located. However, I'm now getting the following error.

    ./warehouse
    *** Signal 6
    make: Fatal error: Command failed for target `execute'

    Thanks, Bernardo
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: C++

    Posted Thu July 17, 2008 07:31 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    I see the same problem if I remove my license.

    You can try to get confirmation that it's a license issue by moving the CPLEX initialization in the first line of the try block in the warehouse example (for some reason, in the OPL 5.5 version of the warehouse example, there's not exception catching for this).


      try {
        IloCplex cplex(env);
            IloOplErrorHandler handler(env,cout);
            std::istringstream in( getModelText() );
            IloOplModelSource modelSource(env,in,"warehouse");


    C++ is available for the development packages of OPL (OPL-CPLEX Development System and OPL-CPLEX-ODM Development System).

    Didier.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: C++

    Posted Thu July 17, 2008 08:07 PM

    Originally posted by: SystemAdmin


    [Almada-Lobo said:]

    Thanks Didier. I've introduced the exception catching lines and I still have the same error. It's not a licence problem since I can run from the command line (oplrun warehouse.mod warehouse.dat) the model and data files.
    Bernardo
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: C++

    Posted Thu July 17, 2008 09:31 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    What's the output of the following commands ?

    ldd warehouse | grep cplex
    (could identify a problem in your LD_LIBRARY_PATH)

    and

    pwd  (when you are in the directory of the binary warehouse)
    (could identify a problem for opening a resource file)


    Out of that, I don't have any clue....
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: C++

    Posted Thu July 17, 2008 10:01 PM

    Originally posted by: SystemAdmin


    [Almada-Lobo said:]

    The output of ldd warehouse | grep cplex is

    libcplex110.so =>        /afs/athena.mit.edu/software/oplstudio_v5.5/distrib/sun4x_510/opl55/bin/ultrasparc64_9_8/libcplex110.so

    The output of pwd is /afs/athena.mit.edu/user/b/a/balobo/Teste.

    So it seems that it is another problem.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: C++

    Posted Thu July 17, 2008 10:53 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]


    libcplex110.so =>        /afs/athena.mit.edu/software/oplstudio_v5.5/distrib/sun4x_510/opl55/bin/ultrasparc64_9_8/libcplex110.so


    Your dll points to ultrasparc64, and you compiled with options pointing to ultrasparc32.

    I guess it's the source of the problem.

    Didier.

    #DecisionOptimization
    #OPLusingCPLEXOptimizer