Linking Cplex in school server

321 views
Skip to first unread message

jshong

unread,
Nov 18, 2013, 2:19:57 PM11/18/13
to yal...@googlegroups.com
Hi. I have a pretty basic question. 
I wonder how to link Cplex in my school server to yalmip. 
I can open matlab 2013b using Xwin 32. It is a UNIX system.
They said they installed Cplex for me. 
But yalmip doesn't recognize Cplex in my school server. 

Could you tell me at least what I should ask IT staff ?
Thanks. 

-JS

Johan Löfberg

unread,
Nov 18, 2013, 2:40:08 PM11/18/13
to yal...@googlegroups.com
The matlab interfaces to cplex supplied by ibm have to visible on MATLABs path, so you need the location of these

Here
 addpath('C:\Program Files\IBM\ILOG\CPLEX_Studio125\cplex\matlab\x64_win64');


jshong

unread,
Nov 18, 2013, 2:57:43 PM11/18/13
to yal...@googlegroups.com
Is matlab\x64_win64 folder same in Linux version as well?

 

Johan Löfberg

unread,
Nov 19, 2013, 12:26:11 AM11/19/13
to yal...@googlegroups.com
Don't know what the directory structure looks like on linux

jshong

unread,
Nov 19, 2013, 12:29:04 AM11/19/13
to yal...@googlegroups.com
Actually, I added the path they told me. 
I checked that ' CPLEX_Studio_Preview1251/cplex/matlab'  is added. 
I typed help cplexlp and checked the message. 
It looks cplex is installed in my school server. 
But, Yalmip can't find cplex. 
Do you have any idea how to fix this? 

Thanks for your help. 

-JS

Johan Löfberg

unread,
Nov 19, 2013, 12:46:40 AM11/19/13
to yal...@googlegroups.com
You have to add the directory where cplexlp etc are located

>> which cplexlp
C:\Program Files\IBM\ILOG\CPLEX_Studio125\cplex\matlab\x64_win64\cplexlp.p

My guess is you should have another level in the directory such as x64_lx or something like that

jshong

unread,
Nov 19, 2013, 1:51:54 AM11/19/13
to yal...@googlegroups.com
Oh, I didn't write it correctly. Sorry.
Definitely, cplexlp is working for sure. 

>> which cplexlp
/opt/ibm/ILOG/CPLEX_Studio_Preview1251/cplex/matlab/cplexlp.p
 
But there is no folder 'cplex/matlab/x64_win64'.
Do you have any idea why x64_win64 folder doesn't exist?
My guess is that they installed Cplex Studio preview edition and it doesn't have x64_win64. 
What do you think?

Johan Löfberg

unread,
Nov 19, 2013, 2:02:03 AM11/19/13
to yal...@googlegroups.com
You just said that the software is installed on a unix server, so why should there be a win64 directory?

jshong

unread,
Nov 19, 2013, 2:21:10 AM11/19/13
to yal...@googlegroups.com
Yes. That was a dumb question. 
I am new to Unix system so I didn't know that. 

I think the main problem is they installed preview (trial) version. 
This is probably because my academic license cannot be used in Unix system. 

Is there any way to link trial version of Cplex to yalmip?
Thanks. 

-JS

Johan Löfberg

unread,
Nov 19, 2013, 4:43:03 AM11/19/13
to yal...@googlegroups.com
If the MATLAB interfaces to cplex are in the path, YALMIP will use them. Nothing more has to be done from YALMIPs point of view. If your installation doesn't have the MATLAB layer, YALMIP cannot be used.

Johan Löfberg

unread,
Nov 19, 2013, 4:49:12 AM11/19/13
to yal...@googlegroups.com
...and academic license is most likely available for unix (they have it for solaris)

However, I don't think they can install that globally, it is intended for your personal computer. Why don't you installl it on your own machine?

jshong

unread,
Nov 19, 2013, 2:46:46 PM11/19/13
to yal...@googlegroups.com
I did install academic version in my PC. 
But I want to solve several MIPs at the same time in UNIX system. 

It is weird that Yalmip doesn't recognize Cplex in preview edition. 
Can you link Cplex in preview edition of ILOG?

Is there any other MIP solver I can install in UNIX system?

I asked my IT staff to install the Gurobi but they told me they can't. (They said they need to set license server, which I don't understand)




Johan Löfberg

unread,
Nov 19, 2013, 2:52:49 PM11/19/13
to yal...@googlegroups.com
YALMIP does not care about the license. All that matters is that the MATLAB interface is on your path

What do you have in the matlab directory you talk about?

dir('/yourpath/CPLEX_Studio_Preview1251/cplex/matlab'


Johan Löfberg

unread,
Nov 19, 2013, 2:53:33 PM11/19/13
to yal...@googlegroups.com
...and I presume you are using the absolutely last version of YALMIP. Old versions do not recognize 12.5.1

jshong

unread,
Nov 19, 2013, 4:56:10 PM11/19/13
to yal...@googlegroups.com
Yes. You were right. I installed older version of yalmip in my Unix account. 

I installed new version of yalmip and checked CPLEX 12.5.1 is linked.

But, I found a weird thing.

I tested my MIP problem with small number of variables. It is solved in my PC with Cplex 12.5. 

But matlab in server simply gives NaN solutions. 

I found the same thing occurs in the other problem in yalmip website. 

I run this both in my PC and server. 

x = sdpvar(5,1);
A = ones(15,5);
b = ones(15,1);

obj = sum(x) + sum((x-3).^4); % 4th order objective
ops = sdpsettings('solver','bnb','bnb.solver','fmincon');
solvesdp([A*x <= b, integer(x)],obj,ops)

My PC gives

* Starting YALMIP integer branch & bound.
* Lower solver   : fmincon-standard
* Upper solver   : rounder
* Max iterations : 300
 
Warning : The continuous relaxation may be nonconvex. This means 
that the branching process is not guaranteed to find a
globally optimal solution, since the lower bound can be
invalid. Hence, do not trust the bound or the gap...
 Node       Upper       Gap(%)      Lower    Open
    1 :    4.050E+02    13.55      3.083E+02   2  Successfully solved 
    2 :    4.050E+02    13.55      3.083E+02   3  Successfully solved 
    3 :    3.410E+02     4.64      3.108E+02   2  Successfully solved 
    4 :    3.410E+02     4.64      3.108E+02   3  Successfully solved 
    5 :    3.410E+02     4.01      3.147E+02   2  Successfully solved 
    6 :    3.410E+02     4.01      3.147E+02   3  Successfully solved 
    7 :    3.410E+02     2.85      3.221E+02   2  Successfully solved 
    8 :    3.410E+02     2.85      3.221E+02   1  Successfully solved 
    9 :    3.410E+02     2.85      3.221E+02   0  Successfully solved 
+   9 Finishing.  Cost: 341

ans = 

    yalmiptime: 0.0440
    solvertime: 0.2700
          info: 'Successfully solved (BNB)'
       problem: 0

>> double(x)

ans =

     0
     0
     0
     1
     0

But server gives

IBM ILOG CPLEX Optimization Studio Preview Edition good for 86 more days.
* Starting YALMIP integer branch & bound.
* Lower solver   : fmincon-standard
* Upper solver   : rounder
* Max iterations : 300
 
Warning : The continuous relaxation may be nonconvex. This means 
that the branching process is not guaranteed to find a
globally optimal solution, since the lower bound can be
invalid. Hence, do not trust the bound or the gap...
 Node       Upper       Gap(%)      Lower    Open

ans = 

    yalmiptime: NaN
    solvertime: NaN
          info: [1x135 char]
       problem: 9

>> double(x)

ans =

   NaN
   NaN
   NaN
   NaN
   NaN

Do you have any idea why this happens?
Thanks. 

-JS

Johan Löfberg

unread,
Nov 20, 2013, 2:23:02 AM11/20/13
to yal...@googlegroups.com
You are solving a nonlinear integer program using the built-in framework bnb with fmincon as local solver, so this has nothing to do with cplex.

fmincon most likely crashed on your server. To see the full crash, use
ops = sdpsettings('solver','bnb','bnb.solver','fmincon','debug',1);


Johan Löfberg

unread,
Nov 20, 2013, 2:24:44 AM11/20/13
to yal...@googlegroups.com
and when you solved the MILP, what was displayed when you ran solvesdp? What was the error code? Was it 9 (Unknown problem in solver) as in the crash above? Turn on the debug flag and report the complete display and error codes etc

jshong

unread,
Nov 20, 2013, 10:05:40 PM11/20/13
to yal...@googlegroups.com
I run my code for MIP and got this.
CPLEX Error  1016: Restricted version.  Problem size limits exceeded.
This is too bad.

When I run this in my PC. It says

Optimize a model with 28882 rows, 4806 columns and 82058 nonzeros
Found heuristic solution: objective 6628.81
Presolve removed 7402 rows and 1301 columns
Presolve time: 0.24s
Presolved: 21480 rows, 3505 columns, 72060 nonzeros
Variable types: 3005 continuous, 500 integer (500 binary)

Is there any other solver which can be used to solve my problem in school server?
I requested Gurobi to be installed but IT staff told me they couldn't.
Thanks. 

-JS

Johan Löfberg

unread,
Nov 21, 2013, 1:57:32 AM11/21/13
to yal...@googlegroups.com
I don't think any of the academic licenses for the commercial solvers (cplex, gurobi,mosek and xpress) can be installed on a server. If you want one of those, you will have to run it on your own machine (I am not sure though, but that is my guess)

Here are the integer solvers supported by YALMIP

jshong

unread,
Nov 21, 2013, 3:30:59 PM11/21/13
to yal...@googlegroups.com
Thanks, Johan. 

It's too bad that academic licenses cannot be installed on a school server. 

I will try non-commercial server. 

Anyway, I really appreciate your help. 

-JS

convex_optimization

unread,
Feb 8, 2016, 4:15:34 PM2/8/16
to YALMIP
i have the same problem. i downloaded the recent version of yalmip, i have cplex 12.5, added the path but yalmip cannot find the cplex.
when i write which cplexlp, i get:

C:\IBM\ILOG\CPLEX_Studio125\cplex\matlab\x86_win32\cplexlp.p

This is how setpath looks like:


Auto Generated Inline Image 1

Johan Löfberg

unread,
Feb 8, 2016, 4:19:32 PM2/8/16
to YALMIP
YALMIP looks for the file cplexlink125 (on windows 64bit cplexlink125.mexw64)

convex_optimization

unread,
Feb 8, 2016, 4:29:03 PM2/8/16
to YALMIP
so, is the cause of error  i should have 64 bit cplex?

Johan Löfberg

unread,
Feb 9, 2016, 2:18:33 AM2/9/16
to YALMIP
We don't know which computer you have. mexext tells you which file ending your binary has, and on a windows systems it would be placed in a directory such as C:\Program Files\IBM\ILOG\CPLEX_Studio1261\cplex\matlab\x64_win64\

Johan Löfberg

unread,
Feb 9, 2016, 2:20:02 AM2/9/16
to YALMIP
from your path it appears you've installed a 32 bit version. I highly doubt you have a 32 bit installation in the year 2016...
Reply all
Reply to author
Forward
0 new messages