Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/17/12 02:42 PM

    Originally posted by: BerkUstun


    I'm currently trying to build a mex file in MATLAB that uses the CPLEX API for C.

    Unfortunately, I am running into the following error when trying to compile my mex file:

    
    -> llvm-gcc-4.2 -O -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2011b.app/extern/lib/maci64/mexFunction.map -o  
    "addcutsmx.mexmaci64"  addcutsmx.o  -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++   Undefined symbols 
    
    for architecture x86_64: 
    "_CPXopenCPLEX", referenced from: _mexFunction in addcutsmx.o 
    "_CPXcreateprob", referenced from: _mexFunction in addcutsmx.o 
    "_CPXchgobjsen", referenced from: _mexFunction in addcutsmx.o 
    "_CPXnewcols", referenced from: _mexFunction in addcutsmx.o 
    "_CPXaddrows", referenced from: _mexFunction in addcutsmx.o 
    "_CPXlpopt", referenced from: _mexFunction in addcutsmx.o 
    "_CPXsolution", referenced from: _mexFunction in addcutsmx.o 
    "_CPXgetbase", referenced from: _mexFunction in addcutsmx.o ld: symbol(s) not found 
    
    for architecture x86_64 collect2: ld returned 1 exit status   mex: link of 
    ' "addcutsmx.mexmaci64"' failed.
    


    Does anyone know what might be happening? I suspect that the error may be related to 32-bit vs. 64-bit architectures.

    I am currently using MATLAB 2011b, CPLEX 12.3 on Mac OSX 10.7.3. My gcc version is i686-apple-darwin11-llvm-gcc-4.2.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/17/12 03:34 PM

    Originally posted by: BerkUstun


    Small update: I just included the "cplexx.h" file and used all the 64-bit API functions. I still run into the same error, except that the functions referenced by the compiler are now
    
    CPXLopenCPLEX
    
    instead of
    
    CPXopenCPLEX
    
    .

    I am included a verbose error message below:

    
    -> mexopts.sh sourced from directory (DIR = $PREF_DIR) FILE = /Users/berk/.matlab/R2011b/mexopts.sh ---------------------------------------------------------------- ->    MATLAB                = /Applications/MATLAB_R2011b.app ->    CC                    = llvm-gcc-4.2 ->    CC flags: CFLAGS             = -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5  -fexceptions -Wall CDEBUGFLAGS        = -g COPTIMFLAGS        = -O2 -DNDEBUG CLIBS              = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++ arguments          =  -DMX_COMPAT_32 ->    CXX                   = llvm-g++-4.2 ->    CXX flags: CXXFLAGS           = -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 CXXDEBUGFLAGS      = -g CXXOPTIMFLAGS      = -O2 -DNDEBUG CXXLIBS            = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++ arguments          =  -DMX_COMPAT_32 ->    FC                    = gfortran ->    FC flags: FFLAGS             = -fexceptions -m64 -fbackslash FDEBUGFLAGS        = -g FOPTIMFLAGS        = -O FLIBS              = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -L -lgfortran -L -lgfortranbegin arguments          =  -DMX_COMPAT_32 ->    LD                    = llvm-gcc-4.2 ->    Link flags: LDFLAGS            = -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2011b.app/extern/lib/maci64/mexFunction.map LDDEBUGFLAGS       = -g LDOPTIMFLAGS       = -O LDEXTENSION        = .mexmaci64 arguments          = ->    LDCXX                 = ->    Link flags: LDCXXFLAGS         = LDCXXDEBUGFLAGS    = LDCXXOPTIMFLAGS    = LDCXXEXTENSION     = arguments          = ----------------------------------------------------------------   -> llvm-gcc-4.2 -c  -I/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/include/ilcplex/ -I/Applications/MATLAB_R2011b.app/extern/include -I/Applications/MATLAB_R2011b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5  -fexceptions -Wall  -DMX_COMPAT_32 -O2 -DNDEBUG  
    "addcutsmx.c"   -> llvm-gcc-4.2 -O -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2011b.app/extern/lib/maci64/mexFunction.map -o  
    "addcutsmx.mexmaci64"  addcutsmx.o  -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++   Undefined symbols 
    
    for architecture x86_64: 
    "_CPXLopenCPLEX", referenced from: _mexFunction in addcutsmx.o 
    "_CPXLcreateprob", referenced from: _mexFunction in addcutsmx.o 
    "_CPXLchgobjsen", referenced from: _mexFunction in addcutsmx.o 
    "_CPXLnewcols", referenced from: _mexFunction in addcutsmx.o 
    "_CPXLaddrows", referenced from: _mexFunction in addcutsmx.o 
    "_CPXLlpopt", referenced from: _mexFunction in addcutsmx.o 
    "_CPXLsolution", referenced from: _mexFunction in addcutsmx.o 
    "_CPXLgetbase", referenced from: _mexFunction in addcutsmx.o ld: symbol(s) not found 
    
    for architecture x86_64 collect2: ld returned 1 exit status   mex: link of 
    ' "addcutsmx.mexmaci64"' failed.
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/18/12 07:39 AM

    Originally posted by: John Cui


    Firstly, I am not sure llvm-gcc-4.2 compiler is valid in MATLAB 2011b, (your env), you need to check it in mathworks' web site.

    Secondly, why not use CPLEX build-in MATLAB interface directly? we have provided CPLEX functions in MATLAB from CPLEX 12.1,
    and we improved it in the latest release CPLEX 12.4.

    Like cplexmilp to solve MILP, cplexmiqcp to solve MIQCP, etc. And also, we have a more powerful Cplex class, which can solve
    all problem type CPLEX supported.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/18/12 07:50 AM

    Originally posted by: SystemAdmin


    I have no idea about MEX files but I think you need to put libcplex.a into the list of libraries you link with?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/18/12 04:59 PM

    Originally posted by: BerkUstun


    Thanks for the answers.

    Daniel - I now added the directory for libcplex.a in my compiler options (i.e. -L/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/lib/x86-64_darwin9_gcc4.0/static_pic). Unfortunately, I'm still getting the same error. Do you typically have to include libraries when using the C API?

    John - I am creating the MEX file to use in a Stochastic Programming solver in MATLAB. The solver is designed for small-scale LPs and has to change LP parameters and re-solve LPs numerous times. I'm currently using CPLEX MATLAB objects, which is great, but too much time is wasted in communicating between MATLAB and CPLEX (around 95% of my solver runtime goes to cplexlink). Also, I'm fairly sure that the compiler works in MATLAB since I can compile other MEX files that are not using the CPLEX API.

    Any ideas or suggestions on what it might be? I'm stumped and willing to try out anything to fix this.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/18/12 07:46 PM

    Originally posted by: John Cui


    OK, "(around 95% of my solver runtime goes to cplexlink)" means the cplexlink function spent 95% time, and other matlab code spend 5%, right?

    I think that is expected, because in cplexlink, we will call CPLEX in C to do the solving.

    John Cui
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/18/12 05:15 PM

    Originally posted by: BerkUstun


    OK so I fixed the issue with some help from Stack Overflow. The problem was that I was not including the library path or the -lcplex option in my compiler command. Previously I was trying to compile using:

    
    mex -v -g -I/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/include/ addcutsmx.c
    


    Instead I should have had:

    
    mex -v -g -I/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/include/ *-L/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/lib/x86-64_darwin9_gcc4.0/static_pic -lcplex* addcutsmx.c
    


    Having said that, I now receive the following compiler error which leaves me more stumped. Here's the current output. Note: I deleted 80% of the 'could not create compact unwind warnings' to make it more readable).

    
    -> mexopts.sh sourced from directory (DIR = $PREF_DIR) FILE = /Users/berk/.matlab/R2011b/mexopts.sh ---------------------------------------------------------------- ->    MATLAB                = /Applications/MATLAB_R2011b.app ->    CC                    = llvm-gcc-4.2 ->    CC flags: CFLAGS             = -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5  -fexceptions CDEBUGFLAGS        = -g COPTIMFLAGS        = -O2 -DNDEBUG CLIBS              = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++ arguments          =  -DMX_COMPAT_32 ->    CXX                   = llvm-g++-4.2 ->    CXX flags: CXXFLAGS           = -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 CXXDEBUGFLAGS      = -g CXXOPTIMFLAGS      = -O2 -DNDEBUG CXXLIBS            = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++ arguments          =  -DMX_COMPAT_32 ->    FC                    = gfortran ->    FC flags: FFLAGS             = -fexceptions -m64 -fbackslash FDEBUGFLAGS        = -g FOPTIMFLAGS        = -O FLIBS              = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -L -lgfortran -L -lgfortranbegin arguments          =  -DMX_COMPAT_32 ->    LD                    = llvm-gcc-4.2 ->    Link flags: LDFLAGS            = -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2011b.app/extern/lib/maci64/mexFunction.map LDDEBUGFLAGS       = -g LDOPTIMFLAGS       = -O LDEXTENSION        = .mexmaci64 arguments          =  -L/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/lib/x86-64_darwin9_gcc4.0/static_pic -lilocplex -lcplex ->    LDCXX                 = ->    Link flags: LDCXXFLAGS         = LDCXXDEBUGFLAGS    = LDCXXOPTIMFLAGS    = LDCXXEXTENSION     = arguments          =  -L/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/lib/x86-64_darwin9_gcc4.0/static_pic -lilocplex -lcplex ----------------------------------------------------------------   -> llvm-gcc-4.2 -c  -I/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/include/ -I/Applications/MATLAB_R2011b.app/extern/include -I/Applications/MATLAB_R2011b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5  -fexceptions  -DMX_COMPAT_32 -g  
    "addcutsmx.c"   -> llvm-gcc-4.2 -g -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2011b.app/extern/lib/maci64/mexFunction.map -o  
    "addcutsmx.mexmaci64"  addcutsmx.o  -L/Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/lib/x86-64_darwin9_gcc4.0/static_pic -lilocplex -lcplex -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++   ld: warning: could not create compact unwind 
    
    for _CPXLmsg: register 12 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetbranchcallbackfunc: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetbranchcallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetbranchnosolncallbackfunc: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetbranchnosolncallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetcutcallbackfunc: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcutcallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for __24b128fce7208c4bccf68befa9b9076f: register 15 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetlazyconstraintcallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXgetlazyconstraintcallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetusercutcallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXgetusercutcallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetnodecallbackfunc: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetnodecallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for __c5723811fcca5fbbff1588ddd880d908: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __70f1de0d2c9906d1963f656e13dd6cea: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetheuristiccallbackfunc: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetheuristiccallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetincumbentcallbackfunc: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetincumbentcallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetsolvecallbackfunc: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetsolvecallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for __5257ed44e9ad341c986d094e51686857: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXsetdeletenodecallbackfunc: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetdeletenodecallbackfunc: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for __582a8a45cde90827a768abd70b975202: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __14f4dc831359fb003b7b57beb12ae871: register 13 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacknodelp: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacknodeinfo: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __6728e81ccc9dc16b4afcba9b78de2363: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __09e8cb673826a368359c631bffca654d: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackseqinfo: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacksosinfo: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackindicatorinfo: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXcutcallbackadd: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXcutcallbackaddlocal: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __4afd05ca975f63284a441d747b20914e: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __3b1ef66d399e094b2489cef5f7295613: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __0e46da06e5bbb02d0c2423ba80f8c6bf: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXbranchcallbackbranchgeneral: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __80c01ad067d2e26ecf1db259ba11501b: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXbranchcallbackbranchbds: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __75ead821388b10b0ab38512424d4da9d: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXbranchcallbackbranchconstraints: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacknodex: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacknodeobjval: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackctype: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackorder: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackpseudocosts: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackincumbent: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacknodeintfeas: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackgloballb: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackglobalub: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacknodelb: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacknodeub: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacklp: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXgetcallbacknodestat: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXgetcallbackbranchconstraints: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for __c91a4028d1e1b72ca3c240764593a208: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXlpopt: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXqpopt: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXprimopt: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXdualopt: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXhybbaropt: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXbaropt: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXhybnetopt: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXNETprimopt: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXmipopt: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _CPXpivotin: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXpivotout: register 14 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXstrongbranch: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXEisort: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for _CPXEinsort: register 3 saved somewhere other that in frame ld: warning: could not create compact unwind 
    
    for __fc58fa73d6f6ef19858551306910f220: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for __2c6b735b0de6d9c12c6f0c7bd7c8bdb3: register saved more than once (might be shrink wrap ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc_dgemm_get_bufs_size: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc_dgemm_get_bufs: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc_dgemm_copyan: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc_dgemm_copyat: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc_dgemm_copybn_1: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc_dgemm_copybt_1: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_serv_cache_info: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_serv_get_cache_size: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc3_dgemm_ker0_pst: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc_dgemm_htn_ker0_pst: register saved more than once (might be shrink wrap) ld: warning: could not create compact unwind 
    
    for _mkl_blas_mc_dgemm_ker0_pst: register saved more than once (might be shrink wrap) Undefined symbols 
    
    for architecture x86_64: 
    "_kCFAllocatorDefault", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_kIOMasterPortDefault", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_IOServiceMatching", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_IOServiceGetMatchingService", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "___CFStringMakeConstantString", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_IORegistryEntryCreateCFProperty", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_CFGetTypeID", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_CFStringGetTypeID", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_CFStringGetCString", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_CFDataGetTypeID", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_CFDataGetLength", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_CFDataGetBytePtr", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_CFRelease", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) 
    "_IOObjectRelease", referenced from: _ilm_fun_000 in libcplex.a(env.o) _ilm_fun_121 in libcplex.a(env.o) _ilm_api_004 in libcplex.a(env.o) ld: symbol(s) not found 
    
    for architecture x86_64 collect2: ld returned 1 exit status   mex: link of 
    ' "addcutsmx.mexmaci64"' failed.
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/19/12 02:22 AM

    Originally posted by: SystemAdmin


    The warnings referring to unwind can be ignored, see here.
    The remaining undefined symbols come from the IOKit etc. I suggest do to the following:
    cd /Users/berk/Applications/IBM/ILOG/CPLEX_Studio_Academic123/cplex/examples/x86-64_darwin9_gcc4.0/static_pic
    make lpex1
    

    This will show you how to build the lpex1 example. While building the example it will display the compile and link commands. Looking at this output you can easily see which flags are required to compile/link a C application that uses CPLEX. Add these flags to your compile/link configuration.
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/18/12 09:09 PM

    Originally posted by: BerkUstun


    Yeap! A more detailed breakdown is as follows: if my code takes 100 hours to run, 95 hours are spent in cplexlink. Interestingly though, when I add up all the CPLEX solution times (using the Solution.time field) that often adds up

    I think it's expected since there is a lot of overhead in calling / transfering the Solution / Start / Model data back and forth between MATLAB and C, so the file I'm writing should be able to get rid of that and speed things up substantially.

    I made some headway in figuring out the Compiler issue. It seems as if the new missing symbols are functions from the CoreFoundation and IO Kit libraries. Does anyone have experience in linking these up on Mac OSX?
    Thanks!

    Berk
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Compiler Errors for a MEX file with the CPLEX C API

    Posted 03/19/12 06:24 PM

    Originally posted by: BerkUstun


    So I finally figured out the issue! For future reference:

    The errors were coming from the fact that the API functions reference missing symbols from the CoreFoundation and IOKit frameworks. These are typically included in XCode 4.2 but were not appropriately linked due to my compiler settings.

    Usually one can include them by using the -framework CoreFoundation and -framework IOKit flags. The mex command in MATLAB does not support this flag so one has to add LDFLAGS='\$LDFLAGS -framework CoreFoundation -framework IOKit' to the compiler command...

    Thank you both for your help!
    #CPLEXOptimizers
    #DecisionOptimization