Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Make file to run ilog under linux

  • 1.  Make file to run ilog under linux

    Posted Sun March 25, 2012 10:16 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Hello every one i am a windows user and i need to use the linux server of my collge for using ILOg OPL:

    i asked one of my lab friend fr help so he gives me his make file and because i have no experience with linux it took me a long time to run it and filally i could not succeded so i was wonder if you can guide me wher the parameteres neeeded to be change :

    #-------------------------------------------------------------------
    1. ILOG
    #-------------------------------------------------------------------
    SYSTEM = g++
    SYSTEM2 = x86-64_debian4.0_4.1
    LIBFORMAT = static_pic

    1. System/lib-format specific compile/link flags
    CSYSFLAGS = -fPIC -DIL_STD
    LDSYSFLAGS =
    1. Compilation and linking flags enabling Multi-threading
    CMTFLAGS = -DILOUSEMT -D_REENTRANT
    LDMTFLAGS = -lpthread

    1. ******************************* CRT GRID *******************************
    #ILOGDIR = /home/ilog/january-2006
    #CPLEXDIR = $(ILOGDIR)/cplex100
    #SOLVERDIR = $(ILOGDIR)/solver62
    #CONCERTDIR = $(ILOGDIR)/concert22
    #SCHEDULERDIR = $(ILOGDIR)/scheduler62
    1. *************************** END CRT GRID *******************************

    1. ******************************* Collage LSF *******************************
    ILOGDIR = /poly/tools/ILOG-IBM/CP/1.5
    SOLVERDIR = $(ILOGDIR)/solver67
    CONCERTDIR = $(ILOGDIR)/concert29
    #ILOGDIR = /poly/tools/ILOG-CPLEX/CP/14
    #SOLVERDIR = $(ILOGDIR)/solver66
    #CONCERTDIR = $(ILOGDIR)/concert26
    #SCHEDULERDIR = $(ILOGDIR)/scheduler66
    1. *************************** END POLY LSF *******************************
    SOLVERINCDIR = $(SOLVERDIR)/include
    CONCERTINCDIR = $(CONCERTDIR)/include
    #SCHEDULERINCDIR = $(SCHEDULERDIR)/include

    SOLVERLIBDIR = $(SOLVERDIR)/lib/$(SYSTEM2)/$(LIBFORMAT)
    CONCERTLIBDIR = $(CONCERTDIR)/lib/$(SYSTEM2)/$(LIBFORMAT)
    #SCHEDULERLIBDIR = $(SCHEDULERDIR)/lib/$(SYSTEM2)/$(LIBFORMAT)
    #ILOGCFLAGS = $(CSYSFLAGS) -I$(CPLEXINCDIR) -I$(SOLVERINCDIR) -I$(CONCERTINCDIR) -I$(SCHEDULERINCDIR)
    ILOGCFLAGS = $(CSYSFLAGS) -I$(SOLVERINCDIR) -I$(CONCERTINCDIR)

    SOLVERLDFLAGS = -L$(SOLVERLIBDIR) -lsolver
    #SCHEDULERLDFLAGS = -L$(SCHEDULERLIBDIR) -lschedule
    SOLVERDEBUGLDFLAGS = -lilsolverdebug -lildebug
    CONCERTLDFLAGS = -L$(CONCERTLIBDIR) -lconcert
    1. placer -lconcert en dernier !!!!
    #ILOGLDFLAGS = $(LDSYSFLAGS) $(SCHEDULERLDFLAGS) $(CPLEXLDFLAGS) $(SOLVERLDFLAGS) $(CONCERTLDFLAGS)
    ILOGLDFLAGS = $(LDSYSFLAGS) $(SOLVERLDFLAGS) $(CONCERTLDFLAGS)

    #-------------------------------------------------------------------
    1. ETP : configuration
    #-------------------------------------------------------------------
    #PROJDIR = /home/sophied/ETP/code_etp/etp_050208
    PROJDIR = .
    PROJNAME= ETP
    VERSION = 0.1

    #GLOBDIR = /home/quosseca/EmploiDuTemps/Globales
    DATADIR = ${PROJDIR}
    DOCDIR = ${PROJDIR}
    BINDIR = ${PROJDIR}
    OBJDIR = ${BINDIR}
    MAKDIR = ${PROJDIR}
    ARCHDIR = ${PROJDIR}
    SRCDIR = ${PROJDIR} #${PROJDIR}/generic ${PROJDIR}/LatinSquare
    HDRDIR = ${SRCDIR} ${GLOBDIR}
    INCDIR = ${HDRDIR}
    LIBDIR = ${GLOBDIR}

    1. COMPILATION
    CC = /usr/bin/g++

    DBFLAGS = -O4
    #DBFLAGS = -ggdb

    CFLAGS = ${ILOGCFLAGS} ${OPTFLAGS} ${DBFLAGS}
    LDFLAGS = ${ILOGLDFLAGS}
    #LDFLAGS = -lm -lsocket -lnsl -lilcfloat -lc -linput -loutput -lschedulingtool

    1. Archive maintainer
    2. AR = CC -ar
    3. RL = ranlib
    EXEC = ls
    SUFFIX = cpp cc
    HDRSUFFIX = h

    #-------------------------------------------------------------------
    1. ETP : constantes
    #-------------------------------------------------------------------

    VPATH = ${SRCDIR} ${HDRDIR} ${OBJDIR}

    INCDIR_OPTION = ${INCDIR:%=-I%}
    HDRDIR_OPTION = ${HDRDIR:%=-I%}
    LIBDIR_OPTION = ${LIBDIR:%=-L%}

    SRCFILES_WITH_PATH = ${foreach dir, ${SRCDIR}, ${foreach suff, ${SUFFIX}, ${wildcard ${dir}/*.${suff}}}}
    HDRFILES_WITH_PATH = ${foreach dir, ${HDRDIR}, ${foreach suff, ${HDRSUFFIX}, ${wildcard ${dir}/*.${suff}}}}

    SRCFILES = ${notdir ${SRCFILES_WITH_PATH}}
    OBJECTS = ${addsuffix .o, ${basename ${SRCFILES}}}
    1. variables for output
    MSG = "\# "

    default: libbase.a
    #-------------------------------------------------------------------
    1. ETP : rules
    #-------------------------------------------------------------------
    1. main target
    libbase.a : ${OBJECTS}
    @echo
    @echo ${MSG}Building library
    @echo
    ar rc libbase.a ${OBJECTS:%=${OBJDIR}/%}
    ranlib libbase.a
    #${SOLVERLIBDIR}/libsolver.a ${CONCERTLIBDIR}/libconcert.a
    #-------------------------------------------------------------------
    1. implicit rules
    #-------------------------------------------------------------------
    .SUFFIXES: .o .cpp
    .cpp.o :
    @echo
    @echo ${MSG}Generating $@
    @echo
    ${CC} ${CFLAGS} ${INCDIR_OPTION} -c $< -o ${OBJDIR}/$@

    #-------------------------------------------------------------------
    1. clean rules
    #-------------------------------------------------------------------
    clean :
    rm -f *.o *~ *.txt libbase.a
    thanks in advance
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Make file to run ilog under linux

    Posted Mon March 26, 2012 03:30 AM

    Originally posted by: SystemAdmin


    Hello.

    This looks like a makefile, it seems to be using quite old version of ILOG CP. One the first glance, I don't see anything wrong with it. What exactly is the problem?

    For developing applications using CP libraries it is recommended to start with makefiles provided together with examples. I recommend to have a look there.

    Best regards, Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Make file to run ilog under linux

    Posted Mon March 26, 2012 10:14 AM

    Originally posted by: UMQX_Olfat_ELMahi


    Thanks for replay it gives me the following errors :

    1. Generating MyOpl.o

    /usr/bin/g++ -fPIC -DIL_STD -I/poly/tools/ILOG-IBM/CP/1.5/solver67/include -I/po ly/tools/ILOG-IBM/CP/1.5/concert29/include -O4 -I. -c MyOpl.cpp -o ./MyOpl.o
    MyOpl.cpp:18:26: error: ilopl/iloopl.h: No such file or directory
    In file included from MyOpl.cpp:22:
    ReadData1.h:6: error: expected class-name before â{â token
    ReadData1.h:8: error: expected â)â before â&â token
    In file included from MyOpl.cpp:23:
    ReadData2.h:6: error: expected class-name before â{â token
    ReadData2.h:25: error: expected â)â before â&â token
    MyOpl.cpp: In function âint main(int, char**)â:
    MyOpl.cpp:45: error: âofstreamâ was not declared in this scope
    MyOpl.cpp:45: error: expected â;â before âResultsâ
    MyOpl.cpp:46: error: expected â;â before âResults2â
    MyOpl.cpp:47: error: âResultsâ was not declared in this scope
    MyOpl.cpp:48: error: âResults2â was not declared in this scope
    MyOpl.cpp:50: error: âIloEnvâ was not declared in this scope
    MyOpl.cpp:50: error: expected â;â before âenvâ
    MyOpl.cpp:55: error: âIloOplErrorHandlerâ was not declared in this scope
    MyOpl.cpp:55: error: expected â;â before âhandlerâ
    MyOpl.cpp:57: error: âIloOplModelSourceâ was not declared in this scope
    MyOpl.cpp:57: error: expected â;â before âmodelSourceâ
    MyOpl.cpp:58: error: âIloOplSettingsâ was not declared in this scope
    MyOpl.cpp:58: error: expected â;â before âsettingsâ
    MyOpl.cpp:59: error: âIloOplModelDefinitionâ was not declared in this scope
    MyOpl.cpp:59: error: expected â;â before âdefâ
    MyOpl.cpp:60: error: âIloCPâ was not declared in this scope
    MyOpl.cpp:60: error: expected â;â before âcpâ
    MyOpl.cpp:61: error: âIloOplModelâ was not declared in this scope
    MyOpl.cpp:61: error: expected â;â before âoplâ
    MyOpl.cpp:62: error: âenvâ was not declared in this scope
    MyOpl.cpp:63: error: âIloOplDataSourceâ was not declared in this scope
    MyOpl.cpp:63: error: expected â;â before âdataSourceâ
    MyOpl.cpp:64: error: âoplâ was not declared in this scope
    MyOpl.cpp:64: error: âdataSourceâ was not declared in this scope
    MyOpl.cpp:66: error: âcpâ was not declared in this scope
    MyOpl.cpp:69: error: âIloIntMapâ was not declared in this scope
    MyOpl.cpp:69: error: expected â;â before âxâ
    MyOpl.cpp:70: error: âIloIntRangeâ was not declared in this scope
    MyOpl.cpp:70: error: expected â;â before âs1â
    MyOpl.cpp:71: error: âIloIntRangeIteratorâ was not declared in this scope
    MyOpl.cpp:71: error: expected â;â before âit1â
    MyOpl.cpp:71: error: âit1â was not declared in this scope
    MyOpl.cpp:72: error: âxâ was not declared in this scope
    MyOpl.cpp:75: error: âIloIntervalVarMapâ was not declared in this scope
    MyOpl.cpp:75: error: expected â;â before âx1â
    MyOpl.cpp:76: error: expected â;â before âs11â
    MyOpl.cpp:77: error: expected â;â before âit1â
    MyOpl.cpp:77: error: âit1â was not declared in this scope
    MyOpl.cpp:78: error: âIloIntervalVarâ was not declared in this scope
    MyOpl.cpp:78: error: expected â;â before âoneTripâ
    MyOpl.cpp:79: error: âoneTripâ was not declared in this scope
    MyOpl.cpp:85: error: expected â;â before âx2â
    MyOpl.cpp:86: error: expected â;â before âs12â
    MyOpl.cpp:87: error: expected â;â before âit1â
    MyOpl.cpp:87: error: âit1â was not declared in this scope
    MyOpl.cpp:88: error: âIloIntervalVarâ was not declared in this scope
    MyOpl.cpp:88: error: expected â;â before âoneTripâ
    MyOpl.cpp:89: error: âoneTripâ was not declared in this scope
    MyOpl.cpp:95: error: expected â;â before âx3â
    MyOpl.cpp:96: error: expected â;â before âx5â
    MyOpl.cpp:97: error: expected â;â before âx6â
    MyOpl.cpp:98: error: expected â;â before âx7â
    MyOpl.cpp:99: error: expected â;â before âs13â
    MyOpl.cpp:100: error: expected â;â before âit1â
    MyOpl.cpp:100: error: âit1â was not declared in this scope
    MyOpl.cpp:101: error: âIloIntervalVarâ was not declared in this scope
    MyOpl.cpp:101: error: expected â;â before âoneTripâ
    MyOpl.cpp:102: error: âoneTripâ was not declared in this scope
    MyOpl.cpp:107: error: âx5â was not declared in this scope
    MyOpl.cpp:113: error: âx6â was not declared in this scope
    MyOpl.cpp:119: error: âx7â was not declared in this scope
    MyOpl.cpp:126: error: expected â;â before âx4â
    MyOpl.cpp:127: error: expected â;â before âs15â
    MyOpl.cpp:128: error: expected â;â before âit1â
    MyOpl.cpp:128: error: âit1â was not declared in this scope
    MyOpl.cpp:129: error: âIloIntervalVarâ was not declared in this scope
    MyOpl.cpp:129: error: expected â;â before âoneTripâ
    MyOpl.cpp:130: error: âoneTripâ was not declared in this scope
    MyOpl.cpp:136: error: expected â;â before âx8â
    MyOpl.cpp:137: error: expected â;â before âx10â
    MyOpl.cpp:138: error: expected â;â before âs14â
    MyOpl.cpp:139: error: expected â;â before âit1â
    MyOpl.cpp:139: error: âit1â was not declared in this scope
    MyOpl.cpp:140: error: âIloIntervalVarâ was not declared in this scope
    MyOpl.cpp:140: error: expected â;â before âoneTripâ
    MyOpl.cpp:141: error: âoneTripâ was not declared in this scope
    MyOpl.cpp:146: error: âx10â was not declared in this scope
    MyOpl.cpp:153: error: expected â;â before âx9â
    MyOpl.cpp:154: error: expected â;â before âs16â
    MyOpl.cpp:155: error: expected â;â before âit1â
    MyOpl.cpp:155: error: âit1â was not declared in this scope
    MyOpl.cpp:156: error: âIloIntervalVarâ was not declared in this scope
    MyOpl.cpp:156: error: expected â;â before âoneTripâ
    MyOpl.cpp:157: error: âoneTripâ was not declared in this scope
    MyOpl.cpp:163: error: âcoutâ was not declared in this scope
    MyOpl.cpp:163: error: âendlâ was not declared in this scope
    MyOpl.cpp:181: error: expected â;â before âenv2â
    MyOpl.cpp:186: error: expected â;â before âhandler2â
    MyOpl.cpp:188: error: expected â;â before âmodelSource2â
    MyOpl.cpp:189: error: expected â;â before âsettings2â
    MyOpl.cpp:190: error: expected â;â before âdef2â
    MyOpl.cpp:191: error: expected â;â before âcp2â
    MyOpl.cpp:192: error: expected â;â before âopl2â
    MyOpl.cpp:193: error: âenv2â was not declared in this scope
    MyOpl.cpp:195: error: expected â;â before âdataSource2â
    MyOpl.cpp:196: error: âopl2â was not declared in this scope
    MyOpl.cpp:196: error: âdataSource2â was not declared in this scope
    MyOpl.cpp:198: error: âcp2â was not declared in this scope
    MyOpl.cpp:210: error: expected type-specifier before âIloOplExceptionâ
    MyOpl.cpp:210: error: expected â)â before â&â token
    MyOpl.cpp:210: error: expected â{â before â&â token
    MyOpl.cpp:210: error: âeâ was not declared in this scope
    MyOpl.cpp:210: error: expected â;â before â)â token
    MyOpl.cpp:212: error: expected primary-expression before âcatchâ
    MyOpl.cpp:212: error: expected â;â before âcatchâ
    MyOpl.cpp:216: error: expected primary-expression before âcatchâ
    MyOpl.cpp:216: error: expected â;â before âcatchâ
    MyOpl.cpp:220: error: âenv2â was not declared in this scope
    MyOpl.cpp:227: error: expected type-specifier before âIloOplExceptionâ
    MyOpl.cpp:227: error: expected â)â before â&â token
    MyOpl.cpp:227: error: expected â{â before â&â token
    MyOpl.cpp:227: error: âeâ was not declared in this scope
    MyOpl.cpp:227: error: expected â;â before â)â token
    MyOpl.cpp:229: error: expected primary-expression before âcatchâ
    MyOpl.cpp:229: error: expected â;â before âcatchâ
    MyOpl.cpp:233: error: expected primary-expression before âcatchâ
    MyOpl.cpp:233: error: expected â;â before âcatchâ
    MyOpl.cpp:239: error: âenvâ was not declared in this scope
    MyOpl.cpp:240: error: âcoutâ was not declared in this scope
    MyOpl.cpp:240: error: âendlâ was not declared in this scope
    make: *** http://MyOpl.o Error 1

    and could you tell me where i can find the examples in which directory
    thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: Make file to run ilog under linux

    Posted Mon March 26, 2012 11:03 AM

    Originally posted by: UMQX_Olfat_ELMahi


    Also i have more then one version on the server when i choosed the one with opl6.3 name on it and used its makefile after modifying the path it gives me the following error
    g++ -fPIC -DIL_STD -O1 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/carseq.cpp -c

    g++ -fPIC -DIL_STD -O1 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT carseq.o -o carseq -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86-64_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86-64_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86-64_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    /usr/bin/ld: skipping incompatible /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86-64_debian4.0_4.1/static_pic/libopl.a when searching for -lopl
    /usr/bin/ld: skipping incompatible /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86-64_debian4.0_4.1/static_pic/libopl.a when searching for -lopl
    /usr/bin/ld: cannot find -lopl
    collect2: ld returned 1 exit status
    make: *** carseq Error 1

    i need just a guide where to look

    Thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: Make file to run ilog under linux

    Posted Mon March 26, 2012 11:49 AM

    Originally posted by: SystemAdmin


    This time it seems that you're trying to use 64bit libraries on 32bit server.
    To compile the example you need to replace "x86-64_debian4.0_4.1" by "x86_debian4.0_4.1" in your paths. If you don't have x86_debian4.0_4.1 then you have wrong installation (64bit installation on 32bit server).

    However note that as I explained in my previous message, you will need CP Optimizer anyway because you're using IloIntervalVar.

    Best, Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 6.  Re: Make file to run ilog under linux

    Posted Mon March 26, 2012 12:25 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Thanks alot your comments were really helpfull to guide me. however i have another Question sorry:
    although i am working on 64x server but i thought of trying the 32 file anyway under the OPL_Development_Studio directory:
    but it give me the following error:
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-striment_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/includpoly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-striment_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/includustomdatasource.o -o customdatasource -L/poly/tools/ILOG-IBM/OPL_Development_Stument_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/ponel -ldblnkdyn -lilog -ldl -lpthread
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/cutstock.cpp -c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT cutstock.o -o cutstock -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/cutstock_change.cpp -c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT cutstock_change.o -o cutstock_change -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/iterators.cpp -c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT iterators.o -o iterators -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/mulprod.cpp -c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT mulprod.o -o mulprod -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/mulprod_main.cpp -c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT mulprod_main.o -o mulprod_main -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/oplrunsample.cpp -c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT oplrunsample.o -o oplrunsample -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/steelmill.cpp -c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT steelmill.o -o steelmill -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT /poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/examples/opl_interfaces/cpp/src/warehouse.cpp -c
    g++ -fPIC -DIL_STD -O3 -fstrict-aliasing -fomit-frame-pointer -minline-all-stringops -finline-functions -finline-limit=1500 -DNDEBUG -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -I/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/include -DILOUSEMT -D_REENTRANT warehouse.o -o warehouse -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lopl -liljs -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/lib/x86_debian4.0_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/OPL_Development_Studio/6.3/bin/x86_debian4.0_4.1 -lcplex121 -ldbkernel -ldblnkdyn -lilog -ldl -lpthread
    ./carseq
    ./carseq: error while loading shared libraries: libcplex121.so: cannot open shared object file: No such file or directory
    make: *** execute Error 127

    what i understand i that it ddid works with some examples but the last one carseq i will now start running my own code but i though of asking why this exact error what does it mean.

    i hope i am not annoying with my questions and thanks for your help.

    Thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 7.  Re: Make file to run ilog under linux

    Posted Mon March 26, 2012 02:14 PM

    Originally posted by: SystemAdmin


    There's one more thing: you have to setup LD_LIBRARY_PATH environment variable as described for example here in the documentation for CPLEX Studio 12.4:

    doc/html/en-US/OPL_Studio/usroplexamples/topics/opl_examples_interfaces_how.html

    Depending on your shell you can use: setenv or export commands for that.

    Using 32 bit libraries on 64 bit Linux server is usually OK, although it is not recommended neither supported. In this case, make sure that (1) you use -m32 flag for gcc in order to compile to 32 bits, (2) your system has standard 32 bits core libraries installed (such as libc) and (3) if you use Java, your JAVA_HOME must point to 32 bit Java installation.

    Best, Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 8.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 12:00 AM

    Originally posted by: UMQX_Olfat_ELMahi


    Thanks alot the program is running fine now and i did test the demo examples.

    one final Question to make sure i am in the correct direction.

    my progrm consists of more than one cpp file each attached to its own .h file excepl the one contain the main.
    in the makefile file i added the directory contains the .h files as the last variable in the CFLag like this:
    CFLAGS = oldVales -I /userdata/users/me/CPOPL

    and i am not sure should i add the cpp files or only the one contain the main block
    Thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 9.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 04:38 AM

    Originally posted by: SystemAdmin


    Hello.

    Yes, it is right to add -I flag for the directory containing your own .h files.

    For multiple .cpp files, they are usually compiled one by one into .o files and then linked together into executable. Assuming that there are two source files file1.cpp and file2.cpp in subdirectory foo and that final executable should have name "executable", the usual way to do it in a makefile is:
    
    file1.o: foo/file1.cpp $(CCC) $(CFLAGS) foo/file1.cpp -c file2.o: foo/file2.cpp $(CCC) $(CFLAGS) foo/file2.cpp -c executable: file1.o file2.o $(CCC) $(CFLAGS) file1.o file2.o -o executable $(LDFLAGS)
    

    Note that there must be tab character, not spaces, at the beginning of indented lines.

    Best, Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 10.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 12:20 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Thats was very helping thanks:
    now i am a little confused on other thing :
    as i can see in the CPLEX_Studio_Academic12 Directory there is :
    cpoptimizer And opl : as i can see all the scheduling exampples are under the cpoptimizer directory but now i need to use the IloOplDataSourceBaseI class should i add the opl dependancies or it will not work anyway ??

    Thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 11.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 01:13 PM

    Originally posted by: SystemAdmin


    Hello.

    Basically, you should use the same settings they are in opl/examples/opl_interfaces/cpp/foo/static_pic/makefile. It already includes paths for OPL, CP Optimizer and CPLEX, both for includes and for libraries. You don't need to add CP Optimizer again.

    Best, Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 12.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 01:54 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Thanks
    i though of sending you my log file and my make fie maybe you can see where i went wrong:

    //MakeFile
    SYSTEM = x86-64_sles10_4.1
    LIBFORMAT = static_pic
    CCC = g++

    STUDIODIR = /poly/tools/ILOG-IBM/CPLEX_Studio_Academic124
    CONCERTDIR = $(STUDIODIR)/concert
    CPLEXDIR = $(STUDIODIR)/cplex
    OPTDIR = $(STUDIODIR)/cpoptimizer
    OPLDIR = $(STUDIODIR)/opl
    ICUDIR=$(OPLDIR)
    CPLEXNAME=cplex124

    CFLAGS = -DIL_STD -O -DNDEBUG \
    -I$(OPTDIR )/include \
    -I$(CONCERTDIR)/include \
    -fPIC -fstrict-aliasing \
    -pedantic -Wall -fexceptions -Wno-long-long -ffloat-store -m64 -DILOUSEMT -D_REENTRANT -DILM_REENTRANT \
    -I /userdata/users/olibr/CPOPL\
    -I$(OPLDIR)/include \
    -I$(CPLEXDIR)/include \
    LDFLAGS = -L/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/cpoptimizer/lib/x86-64_sles10_4.1/static_pic \
    -lcp \
    -L$(CPLEXDIR)/lib/x86-64_sles10_4.1/static_pic \
    -lcplex \
    -L$(CONCERTDIR)/lib/x86-64_sles10_4.1/static_pic \
    -lconcert -lpthread \
    -L$(OPLDIR)/lib/$(SYSTEM)/$(LIBFORMAT) \
    -lopl -liljs -loplnl1\
    -L$(CPLEXDIR)/lib/$(SYSTEM)/$(LIBFORMAT) \
    -lilocplex -lcp -lconcert \
    -L$(CPLEXDIR)/bin/$(SYSTEM) \
    -l$(CPLEXNAME) \
    -ldbkernel -ldblnkdyn -lilog -ldl \
    -L$(ICUDIR)/bin/$(SYSTEM) \
    -licuuc -licui18n -licuio -licudata
    JAVA_HOME = /poly/tools/java/jdk1.6.0_18
    JAVA = $(JAVA_HOME)/bin/java
    JAVAC = $(JAVA_HOME)/bin/javac
    JAVAFLAGS = -d64

    CPCLASSPATH = $(OPTDIR )/lib/ILOG.CP.jar
    LIBRARYPATH = $(OPTDIR )/bin/x86-64_sles10_4.1:$(CPLEXDIR)/bin/x86-64_sles10_4.1
    CPPEXDIR = /userdata/users/olibr/CPOPL

    CPLEXNAME=cplex124

    all: cpp

    cpp: MyOpl ReadData1

    execute: execute_cpp execute_java

    clean:
    rm -f MyOpl linklist ReadData1
    FORCE:

    $(JAVAC):
    @echo "####################################"
    @echo "Error: cannot find the javac command"
    @echo "Please ensure that JAVA_HOME is set correctly"
    @echo "Currently, JAVA_HOME = $(JAVA_HOME)"
    @exit 1
    ReadData1.o: $(CPPEXDIR)/ReadData1.cpp
    $(CCC) $(CFLAGS) $(CPPEXDIR)/ReadData1.cpp -c
    MyOpl.o: $(CPPEXDIR)/MyOpl.cpp
    $(CCC) $(CFLAGS) $(CPPEXDIR)/MyOpl.cpp -c

    exec: MyOpl.o linklist.o ReadData1.o ReadData2.o
    $(CCC) $(CFLAGS) MyOpl.o ReadData1.o -o exec $(LDFLAGS)

    MyOpl.run: MyOpl FORCE
    ./MyOpl
    execute_cpp: MyOpl.run linklist.run ReadData1.run ReadData2.run

    //Logfile
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 13.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 01:58 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Log file

    cc MyOpl.o -o MyOpl
    MyOpl.o: In function `global constructors keyed to MyOpl.cpp':
    MyOpl.cpp:(.text+0xc): undefined reference to `std::ios_base::Init::Init()'
    MyOpl.cpp:(.text+0x21): undefined reference to `std::ios_base::Init::~Init()'
    MyOpl.o: In function `main':
    MyOpl.cpp:(.text+0x50): undefined reference to `std::ios_base::ios_base()'
    MyOpl.cpp:(.text+0x57): undefined reference to `vtable for std::basic_ios<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0xb6): undefined reference to `VTT for std::basic_ofstream<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0xee): undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
    MyOpl.cpp:(.text+0xfc): undefined reference to `vtable for std::basic_ofstream<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0x121): undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf()'
    MyOpl.cpp:(.text+0x139): undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
    MyOpl.cpp:(.text+0x14b): undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf()'
    MyOpl.cpp:(.text+0x16d): undefined reference to `std::basic_ios<char, std::char_traits<char> >::~basic_ios()'
    MyOpl.cpp:(.text+0x191): undefined reference to `std::ios_base::ios_base()'
    MyOpl.cpp:(.text+0x198): undefined reference to `vtable for std::basic_ios<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0x221): undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
    MyOpl.cpp:(.text+0x22f): undefined reference to `vtable for std::basic_ofstream<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0x254): undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf()'
    MyOpl.cpp:(.text+0x26c): undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
    MyOpl.cpp:(.text+0x27e): undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf()'
    MyOpl.cpp:(.text+0x2a0): undefined reference to `std::basic_ios<char, std::char_traits<char> >::~basic_ios()'
    MyOpl.cpp:(.text+0x2c0): undefined reference to `std::ios_base::ios_base()'
    MyOpl.cpp:(.text+0x2c7): undefined reference to `vtable for std::basic_ios<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0x350): undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
    MyOpl.cpp:(.text+0x35e): undefined reference to `vtable for std::basic_ofstream<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0x383): undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf()'
    MyOpl.cpp:(.text+0x39b): undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
    MyOpl.cpp:(.text+0x3ad): undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf()'
    MyOpl.cpp:(.text+0x3cf): undefined reference to `std::basic_ios<char, std::char_traits<char> >::~basic_ios()'
    MyOpl.cpp:(.text+0x3e8): undefined reference to `std::ios_base::ios_base()'
    MyOpl.cpp:(.text+0x3ef): undefined reference to `vtable for std::basic_ios<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0x478): undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)'
    MyOpl.cpp:(.text+0x486): undefined reference to `vtable for std::basic_ofstream<char, std::char_traits<char> >'
    MyOpl.cpp:(.text+0x4ab): undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf()'
    .
    .
    .
    collect2: ld returned 1 exit status
    make: *** MyOpl Error 1

    its all linking problems.
    Thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 14.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 02:04 PM

    Originally posted by: SystemAdmin


    It seems that you're trying to build executable MyOpl, but in the makefile the name of the executable file is "exec". In this case makefile is using default rules to build the program and therefore it doesn't use the necessary link flags defined in LDFLAGS. What arguments did you use to run make? It should be "make exec".

    Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 15.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 02:17 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Thanks for your very Quick Guides and sorry if my mistakes seemed very elementary:
    now when i used make exec it gives me errors like it can not fined the cp.h file and so on. like it can not find the includes so as a second step i commented the last three lines in the makefile but this caused the problem to return back to the previous errors. did i missed one of the flages?

    Thanks
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 16.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 02:20 PM

    Originally posted by: UMQX_Olfat_ELMahi


    to be more clear the errors are :
    g++ -DIL_STD -O -DNDEBUG -I/include -I/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/concert/include -fPIC -fstrict-aliasing -pedantic -Wall -fexceptions -Wno-long-long -ffloat-store -m64 -DILOUSEMT -D_REENTRANT -DILM_REENTRANT -I /userdata/users/olibr/CPOPL\ -O1 /userdata/users/olibr/CPOPL/ReadData1.cpp -c
    /userdata/users/olibr/CPOPL/ReadData1.cpp:1:21: error: ilcp/cp.h: No such file or directory
    /userdata/users/olibr/CPOPL/ReadData1.cpp:2:26: error: ilopl/iloopl.h: No such file or directory
    In file included from /userdata/users/olibr/CPOPL/ReadData1.cpp:9:
    /userdata/users/olibr/CPOPL/ReadData1.h:6: error: expected class-name before â{â token
    /userdata/users/olibr/CPOPL/ReadData1.h:8: error: expected â)â before â&â token
    /userdata/users/olibr/CPOPL/ReadData1.cpp:13: error: expected â)â before â&â token
    /userdata/users/olibr/CPOPL/ReadData1.cpp: In member function âvoid MyData::read() constâ:
    /userdata/users/olibr/CPOPL/ReadData1.cpp:21: error: âifstreamâ was not declared in this scope
    /userdata/users/olibr/CPOPL/ReadData1.cpp:21: error: expected â;â before âMPEG4Fileâ
    /userdata/users/olibr/CPOPL/ReadData1.cpp:22: error: expected â;â before âVOIPFileâ
    /userdata/users/olibr/CPOPL/ReadData1.cpp:25: error: âIloOplDataHandlerâ was not declared in this scope
    /userdata/users/olibr/CPOPL/ReadData1.cpp:25: error: expected â;â before âhandlerâ
    /userdata/users/olibr/CPOPL/ReadData1.cpp:27: error: âhandlerâ was not declared in this scope
    /userdata/users/olibr/CPOPL/ReadData1.cpp:37: error: âVOIPFileâ was not declared in this scope
    /userdata/users/olibr/CPOPL/ReadData1.cpp:50: error: âstringâ was not declared in this scope
    /userdata/users/olibr/CPOPL/ReadData1.cpp:50: error: expected â;â before â_MpegTypeâ
    /userdata/users/olibr/CPOPL/ReadData1.cpp:54: error: âMPEG4Fileâ was not declared in this scope
    /userdata/users/olibr/CPOPL/ReadData1.cpp:56: error: â_MpegTypeâ was not declared in this scope
    make: *** http://ReadData1.o Error 1
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 17.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 02:36 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Thanks i did found the problem for this one :)
    now when i use make exec it display :
    $ make exec
    g++ -DIL_STD -O -DNDEBUG -I/include -I/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/concert/include -fPIC -fstrict-aliasing -pedantic -Wall -fexceptions -Wno-long-long -ffloat-store -m64 -DILOUSEMT -D_REENTRANT -DILM_REENTRANT -I /userdata/users/olibr/CPOPL -O1 -I/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/opl/include -I/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/cplex/include ReadData1.o MyOpl.o -o exec -L/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/cpoptimizer/lib/x86-64_sles10_4.1/static_pic -lcp -L/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/cplex/lib/x86-64_sles10_4.1/static_pic -lcplex -L/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/concert/lib/x86-64_sles10_4.1/static_pic -lconcert -lpthread -L/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/opl/lib/x86-64_sles10_4.1/static_pic -lopl -liljs -loplnl1 -L/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/cplex/lib/x86-64_sles10_4.1/static_pic -lilocplex -lcp -lconcert -L/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/cplex/bin/x86-64_sles10_4.1 -lcplex124 -ldbkernel -ldblnkdyn -lilog -ldl -L/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/opl/bin/x86-64_sles10_4.1 -licuuc -licui18n -licuio -licudata

    then stop for a while then the curser apera again but when try to run it i got :
    $ ./exec
    ./exec: error while loading shared libraries: liboplnl1.so.12: cannot open shared object file: No such file or directory
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 18.  Re: Make file to run ilog under linux

    Posted Wed March 28, 2012 03:56 PM

    Originally posted by: SystemAdmin


    Alright, we are almost there. Did you setup your LD_LIBRARY_PATH environment variable as I mentioned earlier? Depending on your shell, you can use setenv (for csh for example) or export (for bash) command to set this variable. It should point to the directory where liboplnl1.so.12 file is. I believe it is /poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/opl/bin/x86-64_sles10_4.1.

    Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 19.  Re: Make file to run ilog under linux

    Posted Thu March 29, 2012 11:06 AM

    Originally posted by: UMQX_Olfat_ELMahi


    Hello Again

    i took me a while because i have to contact to my Admin to add the env because i am not allowed to but after he told me that he added this line to my profile
    .bashrc
    exportLD_LBRARY_PATH=$LD_LIBRARY_PATH:/poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/opl/bin/x86-64_sles10_4.1

    the program still gives me the same error ??
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 20.  Re: Make file to run ilog under linux

    Posted Thu March 29, 2012 11:29 AM

    Originally posted by: SystemAdmin


    I'm not sure whether isn't just typo in your message, but there's a space missing between export and LD_LIBRARY_PATH. Also, it is LD_LIBRARY_PATH, not LD_LBRARY_PATH.

    The missing files, are they really in /poly/tools/ILOG-IBM/CPLEX_Studio_Academic124/opl/bin/x86-64_sles10_4.1?

    Note that since the variable is set in your .bashrc and not your .profile, it will work only if you run the program from bash. Are you sure you're using bash shell and not something else? Commands in your .bashrc are executed when bash starts, so if you started your bash before the change then the variable was not set.

    Maybe you cannot edit your .bashrc but you can still change those variables on the command line. Just run bash and do "echo $LD_LIBRARY_PATH" to see current value of the variable and "export LD_LIBRARY_PATH=somevalue" to set it to something else. Note also that if you run multiple shells at once, each of them can have different value of LD_LIBRARY_PATH.

    Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 21.  Re: Make file to run ilog under linux

    Posted Mon March 26, 2012 11:14 AM

    Originally posted by: SystemAdmin


    The compiler can't find file ilopl/ilopl.h. This seems to be the reason of all following errors. Also, from the supplied paths it seems that you're trying to use Solver 6.7 for compilation, however the file you're compiling is using IloIntervalVar class. This class is used by CP Optimizer, not by CP Solver.

    So, first of all, please make sure that CP Optimizer is installed on your Linux server. Note that for academic use you can get it for free as described here:
    http://www.ibm.com/developerworks/forums/thread.jspa?threadID=319345&tstart=0

    Then, in your installation, go into the following directory:

    opl/examples/opl_interfaces/cpp/x86_sles10_4.1/static_pic

    In case of 64 bit installation, instead of "x86_sles10_4.1" there will be "x86-64_sles10_4.1". Inside this directory you will find a makefile for C++ OPL delivered examples. Using this makefile, you can compile and execute those examples by running "make execute" in that directory (of cause, only if you have write rights in that directory).

    You can use this makefile as a start for your own makefile. Note that if you move it somewhere else then you will have to change OPLDIR so that it points to opl directory inside your installation. You may also need to set your JAVA_HOME.

    I hope it helps, Petr
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 22.  Re: Make file to run ilog under linux

    Posted Thu March 29, 2012 12:05 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Really Thanks you supported me allong the way and i finally did it

    Thanks Agarin
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 23.  Re: Make file to run ilog under linux

    Posted Fri March 06, 2015 01:48 AM

    Originally posted by: Vahan Yian


    How did you end up fixing it?

    I get the same error when i make the examples of the opl_interface.

    ./carseq: error while loading shared libraries: liboplnl1.so.12: cannot open shared object file: No such file or directory
    make: *** [execute] Error 127
     

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 24.  Re: Make file to run ilog under linux

    Posted Fri March 06, 2015 02:34 AM

    Originally posted by: Vahan Yian


    make sure you have LD_LIBRARY_PATH set to ......./ibm/ILOG/CPLEX_Studio1261/opl/bin/x86-64_linux/

    make sure you export it : export LD_LIBRARY_PATH
     

    #DecisionOptimization
    #OPLusingCPOptimizer