Can't run this command [option solver cplex;]

2,836 views
Skip to first unread message

nouh elmitwally

unread,
Sep 5, 2012, 8:17:45 AM9/5/12
to am...@googlegroups.com, 4...@ampl.com
I am struggling running this command in Ubuntu machine ..!

option solver cplexamp; #Is not working with me

Also, only this command is running but in this way;
option solver './cplex';

I think it should working like that:

option solver cplex;

So, I am wondering to know how could I fix this problem, please.

It is really very important to call the command like that [option
solver cplex;] without any quotes or forward slash!


Best wishes,

Noah
_____

Robert Fourer

unread,
Sep 5, 2012, 9:24:20 AM9/5/12
to am...@googlegroups.com
In general, when you specify "option solver cplex", AMPL executes the first
"cplex" that it finds in your current search path. If there is no "cplex"
in any of the directories in your search path, then you get a message like
"Cannot invoke cplex: no such program."

In the special case where "cplex" is in your current directory, then on some
systems you must place "." -- the symbol for the current directory -- in the
search path in order for AMPL to find "cplex" there. If "." is not in your
current directory then you must explicitly write the solver as './cplex'.
This seems to be your situation. If you add "." to your search path then
"option solver cplex" will work. The search path is a system feature (not
part of AMPL) that varies somewhat from one operating system to another, but
it is a standard feature in all systems and so you should have no trouble
finding documentation for changing it.

Versions of CPLEX for AMPL distributed by IBM (and previously ILOG) are
called "cplexamp" and so you have to write "option solver cplexamp" to
access those. The versions supplied by us are called "cplex" however.

Bob Fourer
4...@ampl.com

Paul

unread,
Sep 5, 2012, 6:08:27 PM9/5/12
to am...@googlegroups.com, 4...@ampl.com, nouh....@googlemail.com
As an alternative to Bob's solution, I opened a terminal, changed to /usr/bin, and there ran 'sudo ln -s <path to cplexamp> cplexamp', substituting the actual path to the cplexamp binary for '<path to cplexamp>'.  (I'm using a version supplied by IBM; you might have cplex rather than cplexamp, per Bob's response.)

Paul

Reply all
Reply to author
Forward
0 new messages