Error in cplex options

63 views
Skip to first unread message

yacj...@gmail.com

unread,
Jun 14, 2023, 4:03:30 PM6/14/23
to AMPL Modeling Language
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 <commandfile> | -c "<command1>" "<command2>" ...]
Exiting
Error at _cmdno 4 executing "solve" command

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

AMPL Google Group

unread,
Jun 14, 2023, 4:52:44 PM6/14/23
to AMPL Modeling Language
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 <commandfile> | -c "<command1>" "<command2>" ...]

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".


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2273741480-117834#}
Reply all
Reply to author
Forward
0 new messages