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