Problem with cplex solver

258 views
Skip to first unread message

406801643

unread,
Jun 24, 2021, 10:36:04 AM6/24/21
to support, ampl
Hi AMPL Engineers,
    I met a problem when I used cplex to solve problem. The detail as blow. Would do you please help me to tell me why and how to fix this problem? 
   By the way, other solvers have not this problem. Only cplex solver occured this problem. 

ampl: model test.mod;
ampl: option solver cplex;
ampl: solve;

Incorrect usage. Correct command syntax is:
   cplex [-i] [-f <commandfile> | -c "<command1>" "<command2>" ...]
Exiting
Error executing "solve" command:
can't open C:\Users\Surface\AppData\Local\Temp\at3148.sol


Best regards,
Bing Zhang

AMPL Google Group

unread,
Jun 24, 2021, 11:45:12 AM6/24/21
to AMPL Modeling Language
When you specify "option solver cplex;" under Windows, AMPL looks for a program 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;".


--
Robert Fourer
am...@googlegroups.com
{#HS:1552934914-105188#}
Reply all
Reply to author
Forward
0 new messages