Ozgu Turgut
Ozgu Turgut

Reputation: 133

Ampl Cplex solve error

Why do I get the following message everytime I try to solve a model with CPLEX:

ampl: option solver Cplex;
ampl: model Anchor_QP.mod;
ampl: solve;

Incorrect usage. Correct command syntax is:
   Cplex
or
   Cplex -f <commandfile>
or
   Cplex -c "<command1>" "<command2>" ... 
Exiting
Error executing "solve" command:
can't open C:\Users\ozgutr\AppData\Local\Temp\at16996.sol

Upvotes: 2

Views: 1803

Answers (3)

Camilla Giuliani
Camilla Giuliani

Reputation: 21

I have AMPL community edition one and I had to activate my license running this command in AMP ide

ampl: shell "amplkey activate --uuid your_license" ;

It also says on the website that you can download the amp.lic file from there and place it manually into your AMPL folder.

Upvotes: 0

Arlita Nurmaya Asri
Arlita Nurmaya Asri

Reputation: 81

you should write "cplex" instead of "Cplex", because AMPL is case sensitive

Upvotes: 0

rkersh
rkersh

Reputation: 4465

The thread here suggests that you should use:

option solver cplexamp;

Instead of:

option solver cplex;

It also says:

Looks like you are running a command-line version of CPLEX rather than CPLEX for AMPL. "cplexamp" is the name of the CPLEX-for-AMPL executable distributed by IBM.

I have not tried this personally, but it makes sense.

Upvotes: 2

Related Questions