installing CPLEX

230 views
Skip to first unread message

Farid Rezvani

unread,
Aug 25, 2014, 4:28:00 PM8/25/14
to yal...@googlegroups.com
Hello,
I installed "cplex_studio126" but why I can't use CPLEX solver?

thanks in advance

Farid Rezvani

unread,
Aug 25, 2014, 4:34:32 PM8/25/14
to yal...@googlegroups.com
excuse me, and the same thing for MOSEK.


Johan Löfberg

unread,
Aug 26, 2014, 1:56:24 AM8/26/14
to yal...@googlegroups.com
Sounds like you haven't set your path in MATLAB to point at the respective toolboxes.

Farid Rezvani

unread,
Aug 26, 2014, 2:26:13 AM8/26/14
to yal...@googlegroups.com
should YALMIP,OPTITOOLBOX, MOSEC and CPLEX be in one folder?
I have Matlab R2012, and every time I open it, I have to set oath for yalmip.

also I set OPTI Toolbox, ande CPLEX and MOSEC seperately, how should I activate cple and mosec?

BARON:           Not Available  
BONMIN
:          Available      v1.7.4
CBC
:             Available      v2.8.8
CLP
:             Available      v1.15.6
CPLEX
:           Not Available  
CSDP
:            Available      v6.2 beta
DSDP
:            Available      v5.8
FILTERSD
:        Available      v1.0
GLPK
:            Available      v4.48
GMATLAB
:         Available      v3.2.2
HYBRJ
:           Available      
IPOPT
:           Available      v3.11.7
LBFGSB
:          Available      v3.0
LEVMAR
:          Available      v2.6 (November 2011)
LIPSOL
:          Available      v0.60
LMDER
:           Available      
LP_SOLVE
:        Available      v5.5.2.0
M1QN3
:           Available      v3.3
MATLAB
:          Available      v6.2.1
MKLTRNLS
:        Available      v11.1 R1
MOSEK
:           Not Available  
MUMPS
:           Available      v4.10.0
NL2SOL
:          Available      v2.3
NLOPT
:           Available      v2.3
NOMAD
:           Available      v3.6.2
OOQP
:            Available      v0.99.22
PSWARM
:          Available      v1.5
QSOPT
:           Available      v080725
SCIP
:            Available      v3.0.2
SEDUMI
:          Not Available

 

Johan Löfberg

unread,
Aug 26, 2014, 2:30:48 AM8/26/14
to
It is entirely arbitrary in which folders you place these toolboxes (well, don't do anything stupid like installing them to win32 or the matlab installation etc).

You either add the paths every time you start matlab, or you edit your pathdef so it is added automatically  every time you start matlab
http://www.mathworks.se/help/matlab/ref/path.html
http://www.mathworks.se/help/matlab/ref/genpath.html
http://www.mathworks.se/help/matlab/ref/pathtool.html

Farid Rezvani

unread,
Aug 26, 2014, 3:44:34 AM8/26/14
to yal...@googlegroups.com
So, what should I do then?
could you please explain me?

Checking    LP Solver Results... Invalid MEX-file 'C:\Users\PC-Rezvani\Desktop\cplex\cplex\matlab\x86_win32\cplexlink1260.mexw32': The specified module could
not be found.


Error in opti_cplex (line 56)
cp
= Cplex('OPTI');


Error in opti/solveOpti>solveLP (line 105)
       
[x,fval,exitflag,info] = opti_cplex([],p.f,p.A,p.rl,p.ru,p.lb,p.ub,[],[],[],p.x0,opts.solverOpts);


Error in opti/solveOpti (line 49)
       
[x,fval,exitflag,info] = solveLP(prob,nl,opts);


Error in opti/solve (line 113)
           
[x,fval,exitflag,info] = solveOpti(optObj,x0);


Error in opti_Install_Test (line 75)
           
[~,fval] = solve(Opt);


Error in opti_Install (line 76)
    opti_Install_Test
(1);

Johan Löfberg

unread,
Aug 26, 2014, 3:48:18 AM8/26/14
to yal...@googlegroups.com
You should add the paths to the toolboxes that you use, either everytime you start matlab, or by adding those paths to the pathdef file which is run every time you start matlab. See the links (or simply go to the menu bar/file/Set path)

The error you show indicates you have installed a 32-bit version of cplex on a 64-bit system. You have to uninstall and install a correct version.
Message has been deleted

Johan Löfberg

unread,
Aug 26, 2014, 4:03:09 AM8/26/14
to yal...@googlegroups.com
What do you get from

>> mexext


Farid Rezvani

unread,
Aug 26, 2014, 4:04:37 AM8/26/14
to yal...@googlegroups.com
my system is 32-bit operating system,x64 based-processor

and I installed: cplex_studio126_pr_win_x86_32

Farid Rezvani

unread,
Aug 26, 2014, 4:08:25 AM8/26/14
to yal...@googlegroups.com
mexw32

Johan Löfberg

unread,
Aug 26, 2014, 4:10:02 AM8/26/14
to yal...@googlegroups.com
Does cplex work?

>> cplexlp(-1,1,6)


Farid Rezvani

unread,
Aug 26, 2014, 4:11:18 AM8/26/14
to yal...@googlegroups.com
unfortunately no,
Error using cplexlp (line 254)

Johan Löfberg

unread,
Aug 26, 2014, 4:21:45 AM8/26/14
to yal...@googlegroups.com
Your setup must be broken somehow, perhaps due to a weird combination of 64bit system, 32bit matlab etc.

Erling D. Andersen

unread,
Aug 26, 2014, 7:33:42 AM8/26/14
to yal...@googlegroups.com
If you want to get MOSEK working then start by running 

   mosekdiag

inside MATLAB. It should tell you about errors.

If you cannot run mosekdiag then you have not installed MOSEK properly. 

Farid Rezvani

unread,
Aug 28, 2014, 3:12:18 AM8/28/14
to yal...@googlegroups.com
thanks Mr. Anderson and Mr. Lofberg.

I've fixed the problem, based on your tips.

now, when I solve a problem, I see this:

Tried aggregator 2 times.
MIQP
Presolve eliminated 131 rows and 9 columns.
MIQP
Presolve modified 1000 coefficients.
Aggregator did 24 substitutions.
Reduced MIQP has 112 rows, 148 columns, and 1159 nonzeros.
Reduced MIQP has 61 binaries, 0 generals, 0 SOSs, and 0 indicators.
Reduced MIQP objective Q matrix has 24 nonzeros.
Presolve time = 0.02 sec. (1.55 ticks)
Probing fixed 0 vars, tightened 24 bounds.
Probing time = 0.00 sec. (0.11 ticks)
Clique table members: 2.
MIP emphasis
: balance optimality and feasibility.
MIP search method
: dynamic search.
Parallel mode: deterministic, using up to 2 threads.
Root relaxation solution time = 0.00 sec. (3.38 ticks)


       
Nodes                                         Cuts/
   
Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap


     
0     0     -565.7803    24                   -565.7803       54        
*     0+    0                         -249.7866     -565.7803       54  126.51%
     
0     0     -516.8956    24     -249.7866      Cuts: 73      227  106.93%
*     0+    0                         -280.4195     -516.8956      227   84.33%
     
0     0     -409.8516    14     -280.4195      Cuts: 75      341   46.16%
*     0+    0                         -307.4849     -409.8516      341   33.29%
     
0     0     -387.1128    14     -307.4849      Cuts: 35      415   25.90%
     
0     0     -381.5096    14     -307.4849   MIRcuts: 20      455   24.07%
     
0     0     -378.6911    15     -307.4849   MIRcuts: 15      496   23.16%
     
0     0     -377.7117    15     -307.4849   MIRcuts: 12      506   22.84%
     
0     0     -374.7442    15     -307.4849    MIRcuts: 5      524   21.87%
     
0     0     -374.2325    18     -307.4849    MIRcuts: 3      533   21.71%
     
0     0     -373.9830    17     -307.4849    MIRcuts: 3      545   21.63%
     
0     0     -373.8785    18     -307.4849    MIRcuts: 2      549   21.59%
*     0+    0                         -307.8347     -373.8785      549   21.45%
     
0     2     -373.8785    18     -307.8347     -373.8785      549   21.45%
Elapsed time = 0.19 sec. (42.12 ticks, tree = 0.01 MB, solutions = 4)
*    23    22      integral     0     -314.1904     -351.8110      729   11.97%
Implied bound cuts applied:  5
Flow cuts applied:  16
Mixed integer rounding cuts applied:  52


Root node processing (before b&c):
 
Real time             =    0.16 sec. (41.82 ticks)
Parallel b&c, 2 threads:
 
Real time             =    0.23 sec. (49.65 ticks)
 
Sync time (average)   =    0.07 sec.
 
Wait time (average)   =    0.00 sec.
                         
------------
Total (root+branch&cut) =    0.39 sec. (91.47 ticks)


ans
=


    yalmiptime
: 1.8680
    solvertime
: 0.5140
          info
: 'Successfully solved (CPLEX-IBM)'
       problem
: 0
 corresponding the high-lighted lines, is this solution correct? gap is not too big??

Thanks in advance 

Johan Löfberg

unread,
Aug 28, 2014, 3:24:53 AM8/28/14
to yal...@googlegroups.com
The problem is trivial, as cplex solves the problem almost immediately.

The gap you see is the gap to the remaining unexplored nodes, but then it terminates with no remaining nodes and the gap then is thus 0.
Reply all
Reply to author
Forward
0 new messages