It looks like you downloaded the CPLEX package from IBM. When you see a message like
Incorrect usage. Correct command syntax is:
cplex [-i] [-f <commandfile> | -c "<command1>" "<command2>" ...]
it means that AMPL did not find the "CPLEX for AMPL" program but instead found the CPLEX Interactive Optimizer, which is a program named "cplex" that is part of IBM's CPLEX distribution. To use the "CPLEX for AMPL" program that is distributed by IBM:
- If there is a "cplexamp" executable in your current directory, specify "option solver cplexamp;" instead of "option solver cplex;".
- If there is a "cplexamp" executable but it is not in the current directory, then specify the path to the executable, for example "option solver '/Applications/CPLEX_Studio_Community2211/cplex/bin/arm64_osx/cplexamp';".
If CPLEX still can't be found or won't run, you can report the problem to AMPL support at https://discuss.ampl.com. Be sure to show the most recent commands you have tried and error messages you have seen, and indicate which platform (operating system and processor type) you are using.
------------------------------
Robert Fourer
------------------------------
Original Message:
Sent: Mon February 26, 2024 02:53 PM
From: Shajida Rahman
Subject: Help with testing a model on AMPL using CPLEX to solve
------------------------------
Shajida Rahman
------------------------------