# \[AMPL 24694\] Error in cplex options

**URL:** <https://discuss.ampl.com/t/ampl-24694-error-in-cplex-options/608>\
**Category:** Google Group Mirror\
**Created:** [June 14, 2023, 8:03pm UTC](https://discuss.ampl.com/t/ampl-24694-error-in-cplex-options/608 "2023-06-14T20:03:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yacj\_gmail.com](https://avatars.discourse-cdn.com/v4/letter/y/d6d6ee/32.png) [@yacj\_gmail.com](https://discuss.ampl.com/u/yacj_gmail.com)\
**Post date:** [June 14, 2023, 8:03pm UTC](https://discuss.ampl.com/t/ampl-24694-error-in-cplex-options/608/1 "2023-06-14T20:03:30Z")

</div>

Greetings, I am trying to run my model using the cplex optimizer, with the following options:

option solver cplex;  
option cplex\_options “mipdisplay=2, outlev=1, mipgap=0.001, timelimit=3600”;  
solve;

When executing I get the following error:

Incorrect usage. Correct command syntax is:  
cplex [-i] [-f | -c “” “” …]  
Exiting  
Error at \_cmdno 4 executing “solve” command

What is this error due to? I attach .mod, .dat and .run files

[VRP2.dat](https://discuss.ampl.com/uploads/short-url/khZvVVIuMVgI77L5IdJagbL5dFs.dat) (3.57 KB)

[VRP.mod](https://discuss.ampl.com/uploads/short-url/sECx0YADgQj7wQQOYD2ILNApIn7.mod) (1.76 KB)

[vrp.run](https://discuss.ampl.com/uploads/short-url/zr07bfxRtC3aech0d99eGegQzy8.run) (294 Bytes)

---

<div class="post-metadata">

**Author:** ![AMPL\_Google\_Group](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@AMPL\_Google\_Group](https://discuss.ampl.com/u/AMPL_Google_Group)\
**Post date:** [June 14, 2023, 8:52pm UTC](https://discuss.ampl.com/t/ampl-24694-error-in-cplex-options/608/2 "2023-06-14T20:52:41Z")

</div>

When you specify “option solver cplex;” under Windows, AMPL looks for a program file named “cplex.exe” – first in the same folder as the AMPL program ampl.exe, and then in your system search path. When you see the message

Incorrect usage. Correct command syntax is:  
cplex [-i] [-f | -c “” “” …]

it means that AMPL did not find our “CPLEX for AMPL” program but instead found the CPLEX Interactive Optimizer, which is a program also named cplex.exe that is part of IBM’s CPLEX distribution.

- If you downloaded cplex.exe from us, then use the Windows search feature to look for other cplex.exe files and rename or delete them.
- If you are trying to use the “CPLEX for AMPL” that is distributed by IBM, specify “option solver cplexamp;” instead of “option solver cplex;”.  
If you are using AMPL under Linux or macOS, the situation is the same except that the CPLEX program file is called “cplex” and the AMPL program file is called “ampl”.
