I'm trying to get started with YALMIP, which is a Matlab interface to optimization solvers such as CPLEX. I have an objective function obj
and constraints cons
, and I've plugged them into Yalmip...
options=sdpsettings('solver','Cplex'); %windows needs uppercase 'Cplex' and unix is ok with 'cplex' or 'Cplex'
solvesdp(cons,obj,options); %prints 'Warning: Solver not found'
In the above code, solvesdp
prints Warning: Solver not found. The .m
containing obj
, cons
, and the calls to Yalmip works on my friend's computer, and we're stumped about why it's not working on my computer.
Here are the setup steps for CPLEX and Yalmip that I did on my Ubuntu 12.04 machine with Matlab R2012b:
- Installed IBM CPLEX here:
/home/user/ibm/ILOG/CPLEX_Studio125/cplex
- Installed Yalmip here:
home/user/yalmip
- Added CPLEX and Yalmip to my Matlab path (and confirmed that all directories exist):
addpath(genpath('/home/user/yalmip'))
addpath(genpath('/home/user/ibm/ILOG/CPLEX_Studio125/cplex/matlab'))
addpath(genpath('/home/user/ibm/ILOG/CPLEX_Studio125/cplex/examples/src/matlab'))
Below, I explain how I've tried to diagnose the problem. It's apparent that Matlab can see CPLEX, Matlab can see Yalmip, but Yalmip can't see CPLEX.
Confirmed that Yalmip and CPLEX are in my matlab path:
MATLAB> path
/home/user/ibm/ILOG/CPLEX_Studio125/cplex/examples/src/matlab
/home/user/ibm/ILOG/CPLEX_Studio125/cplex/matlab
/home/forrest/ibm/ILOG/CPLEX_Studio125/cplex/matlab/help
/home/forrest/ibm/ILOG/CPLEX_Studio125/cplex/matlab/help/helpsearch
/home/forrest/ibm/ILOG/CPLEX_Studio125/cplex/matlab/help/topics
/home/user/yalmip
/home/user/yalmip/demos
/home/user/yalmip/extras
/home/user/yalmip/modules
/home/user/yalmip/modules/bilevel
/home/user/yalmip/modules/global
/home/user/yalmip/modules/moment
/home/user/yalmip/modules/parametric
/home/user/yalmip/modules/robust
/home/user/yalmip/modules/sos
/home/user/yalmip/operators
/home/user/yalmip/solvers
...
To verify that Matlab can indeed find CPLEX, I ran help cplexlp
. It gave valid output:
MATLAB> help cplexlp
cplexlp
Solve linear programming problems.
x = cplexlp(f,Aineq,bineq) solves the linear programming problem min f*x such that Aineq*x <= bineq.
...
Also, which cplex
gives this output: /home/user/ibm/ILOG/CPLEX_Studio125/cplex/matlab/@Cplex/Cplex.p
And which yalmip
gives this output: /home/user/yalmip/extras/yalmip.m
I ran yalmiptest
on the Matlab command prompt. The output verifies that Matlab can find Yalmip, but Yalmip can't find CPLEX:
MATLAB> yalmiptest
+++++++++++++++++++++++++++++++++++++++++++++++
| Searching for installed solvers |
+++++++++++++++++++++++++++++++++++++++++++++++
| Solver| Version/module| Status|
+++++++++++++++++++++++++++++++++++++++++++++++
| LINPROG| | found|
| QUADPROG| | found|
| LMILAB| | found|
| FMINCON| geometric| found|
| FMINCON| standard| found|
| FMINSEARCH| | found|
| BNB| | found|
| BINTPROG| | found|
| CUTSDP| | found|
| BMIBNB| | found|
| KKTQP| | found|
| NONE| | found|
| LSQNONNEG| | found|
| LSQLIN| | found|
| GUROBI| GUROBI| not found|
| GUROBI| MEX| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| IBM| not found|
| CPLEX| CPLEXINT| not found|
| CBC| | not found|
| GLPK| GLPKMEX-CC| not found|
I also looked around the IBM forums for answers to this. A friend pointed me to this post in the IBM forums about diagnosing CPLEX/Yalmip, but the post is more Windows-focused and it didn't really solve my problem.
More details:
- Yalmip version 2012-09-26
- CPLEX version 12.5