[Cmpl] Fwd: Error connecting to CPLEX

Mike Steglich mike.steglich at berlin.de
Sun Nov 23 12:59:18 EST 2014


Please move cplex1260.dll into Cmpl/Frameworks. Then it should work. This issues depend on the search path. The folder Cmpl\bin\Cplex is not in the search path and the DLL cannot be found.



> Am 23.11.2014 um 18:49 schrieb Indrajit Sen Gupta <indrajitsg at gmail.com>:
> 
> Hi Mike,
>  
> This example is from your manual:
>  
> --------------------------------------------------------------
> %arg -solver cbc
> parameters:
>  c[] := (1,2,3);
>  b[] := (15,20);
>  A[,] := ((5.6, 7.7, 10.5),
>    (9.8, 4.2, 11.1));
>  
> variables:
>  x[defset(c[])] : real[0..];
>  
> objectives:
>  c[]T * x[] -> max;
> constraints:
>  A[,] * x[] <= b[];
>  
> --------------------------------------------------------------
>  
> Regards,
> Indrajit
>  
> 
>> On Sun, Nov 23, 2014 at 10:40 PM, Mike Steglich <mike.steglich at th-wildau.de> wrote:
>> Hi Indrajit,
>> 
>> Could try to solve it with Cbc and could you also send your model so that I can check it?
>> 
>> Cheers,
>> 
>> Mike
>> 
>> 
>> 
>>> Am 23.11.2014 um 18:06 schrieb Indrajit Sen Gupta <indrajitsg at gmail.com>:
>>> 
>> 
>>> Hi Mike,
>>>  
>>> I did as you said. Here is what I did after installing Cmpl in C:\Program Files (x86)\.
>>>  
>>> 1. Copied the CPLEX folder containing cplex.exe and cplex1260.dll inside \Cmpl\bin\
>>> 2. In cmpl.opt, I put: CplexFileName = CPLEX/cplex.exe
>>>  
>>> I no longer get "can not connect the solver message". What I get is:
>>>  
>>> ----------------------------------------------------------------------------------------
>>> Cmpl: cmpl prob04.cmpl
>>> CMPL model generation - running
>>> CMPL version: 1.10.0
>>> Authors: Thomas Schleiff, Mike Steglich
>>> Distributed under the GPLv3
>>> create model instance ...
>>> write model instance ...
>>> CMPL model generation - finished
>>> Solver - running
>>> Error (interfaces):  cplex failed - exit code ☺
>>> ----------------------------------------------------------------------------------------
>>>  
>>> Regards,
>>> Indrajit
>>>  
>>> 
>>>> On Sun, Nov 23, 2014 at 3:43 PM, Mike Steglich <mike.steglich at berlin.de> wrote:
>>>> Hi Indrajit,
>>>> 
>>>> Please install Cmpl in c:\program files\Cmpl (for win32) or in c:\program files (x86)\Cmpl (under win64) and use the .bat files (coliop.bat, cmplShell.bat, cmpl.bat) in the root of the Cmpl installation folder. I would like to suggest to use either Coliop for having a simple UI or CmplShell.bat to use Cmpl on the command line. All of these simple scripts set the environment for Cmpl. The intention was to prevent that a Cmpl user has to set a couple of environment variables on his/her own and not to change the original windows setting.
>>>> 
>>>> If you use the Cmpl binary or the Coliop jar file directly then it fails as we have seen for your problems to invoke Cplex an Scip. 
>>>> 
>>>> Please take a look at the installation hints at coliop.org/download.html or in the manual.
>>>> 
>>>> Thanks,
>>>> 
>>>> Mike
>>>> 
>>>> 
>>>> 
>>>>> Am 23.11.2014 um 03:23 schrieb Indrajit Sen Gupta <indrajitsg at gmail.com>:
>>>>> 
>>>> 
>>>>> Hi Mike,
>>>>>  
>>>>> Here is something that I noticed when executing a CMPL problem with the default options. The first 27 lines of output that comes out:
>>>>>  
>>>>> ---------------------------------------------------------------------------------------------------
>>>>> Cmpl: cmpl prob04.cmpl
>>>>> CMPL model generation - running
>>>>> CMPL version: 1.10.0
>>>>> Authors: Thomas Schleiff, Mike Steglich
>>>>> Distributed under the GPLv3
>>>>> create model instance ...
>>>>> write model instance ...
>>>>> CMPL model generation - finished
>>>>> Solver - running
>>>>> Welcome to the CBC MILP Solver
>>>>> Version: 2.8.8
>>>>> Build Date: Dec 21 2013
>>>>> Revision Number: 1998
>>>>> command line - C:\Program Files (x86)\Cmpl\bin\..\Thirdparty\CBC\cbc prob04.mps max solve gsolu prob04.gsol (default strategy 1)
>>>>> At line 2 NAME          prob04.cmpl
>>>>> At line 3 ROWS
>>>>> At line 7 COLUMNS
>>>>> At line 16 RHS
>>>>> At line 18 RANGES
>>>>> At line 19 BOUNDS
>>>>> At line 23 ENDATA
>>>>> Problem prob04.cmpl has 2 rows, 3 columns and 6 elements
>>>>> ---------------------------------------------------------------------------------------------------
>>>>>  
>>>>> Notice the line 19 which starts of with: command line - C:\Program File (x86) ....
>>>>>  
>>>>> Here is my question. I did not install CMPL in Program Files, instead in D:\DPF\CMPL. So why should the command line start with C:\... Any thoughts.
>>>>>  
>>>>> Regards,
>>>>> Indrajit
>>>>>  
>>>>> 
>>>>>> On Sun, Nov 23, 2014 at 12:07 AM, Indrajit Sen Gupta <indrajitsg at gmail.com> wrote:
>>>>>> Hi Mike,
>>>>>>  
>>>>>> You are right. I will stick with CBC. All this started when I tried to connect to CPLEX. SCIP was just another optimizer that I downloaded to figure out why this problem is happening.
>>>>>>  
>>>>>> Thanks for your help anyway.
>>>>>>  
>>>>>> Regards,
>>>>>> Indrajit
>>>>>>  
>>>>>> 
>>>>>>> On Sun, Nov 23, 2014 at 12:00 AM, Mike Steglich <mike.steglich at berlin.de> wrote:
>>>>>>> Hi Indraji,
>>>>>>> 
>>>>>>> I'm not sure why scip is not working with Cmpl on your system with a setting that seems fine.  It sounds a bit like Murphy's Law. The hardcore workarround  is to copy all scip files into Cmpl/bin and remove the path in the scip entry in cmpl.opt.
>>>>>>> 
>>>>>>> Why don't you use Cbc? The performance is similar to Scip.
>>>>>>> 
>>>>>>> Cheers,
>>>>>>> 
>>>>>>> Mike
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>> Am 22.11.2014 um 19:07 schrieb Indrajit Sen Gupta <indrajitsg at gmail.com>:
>>>>>>>> 
>>>>>>> 
>>>>>>>> Hi Mike,
>>>>>>>>  
>>>>>>>> SCIP works out of the box. I am using command line for all purposes. But here is the funny thing. I exported the problem from CMPL to MPS format and ran it through SCIP and got a sub optimal solution!!! I am not familiar with SCIP - just read the mps file and entered optimize. Its actually a small text book problem and the results shouldn't be different.
>>>>>>>>  
>>>>>>>> Regards,
>>>>>>>> Indrajit
>>>>>>>>  
>>>>>>>> 
>>>>>>>>> On Sat, Nov 22, 2014 at 11:12 PM, Mike Steglich <mike.steglich at th-wildau.de> wrote:
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>> Anfang der weitergeleiteten Nachricht:
>>>>>>>>>> 
>>>>>>>>>> Von: Mike Steglich <mike.steglich at th-wildau.de>
>>>>>>>>>> Betreff: Aw: [Cmpl] Error connecting to CPLEX
>>>>>>>>>> Datum: 22. November 2014 18:42:16 MEZ
>>>>>>>>>> An: Indrajit Sen Gupta <indrajitsg at gmail.com>
>>>>>>>>>> 
>>>>>>>>>> Hi Indrajit,
>>>>>>>>>> 
>>>>>>>>>> Framework is still in the (temporary) search path if you use Coliop.bat or cmplShell.bat. Does scip work out of the box w/o Cmpl?  
>>>>>>>>>> 
>>>>>>>>>> Cheers,
>>>>>>>>>> 
>>>>>>>>>> Mike
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>> Am 22.11.2014 um 18:36 schrieb Indrajit Sen Gupta <indrajitsg at gmail.com>:
>>>>>>>>>>> 
>>>>>>>>>>> Still no luck. :( Copied all the dlls and lib files to the Frameworks folder. I made sure that Frameworks is in search path. Am giving up for tonight.
>>>>>>>>>>>  
>>>>>>>>>>> Regards,
>>>>>>>>>>> Indrajit
>>>>>>>>>>>  
>>>>>>>>>>> 
>>>>>>>>>>>> On Sat, Nov 22, 2014 at 10:45 PM, Mike Steglich <mike.steglich at th-wildau.de> wrote:
>>>>>>>>>>>> The entry ScipFileName = ../Thirdparty/scip/scip-3.1.0.win.x86.msvc.opt.spx.ld.exe is fine.  
>>>>>>>>>>>> 
>>>>>>>>>>>> As mentioned before, please move the required libs (scip-3.1.0.win.x86.msvc.opt.spx.ld.dll and scip-3.1.0.win.x86.msvc.opt.spx.ld.lib)  into Cmpl/Frameworks …  
>>>>>>>>>>>> 
>>>>>>>>>>>>> Am 22.11.2014 um 18:08 schrieb Indrajit Sen Gupta <indrajitsg at gmail.com>:
>>>>>>>>>>>>> 
>>>>>>>>>>>>> These are the three files that I have in /Thirdparty/SCIP/
>>>>>>>>>>>>>  
>>>>>>>>>>>>> scip-3.1.0.win.x86.msvc.opt.spx.ld.dll
>>>>>>>>>>>>> scip-3.1.0.win.x86.msvc.opt.spx.ld.exe
>>>>>>>>>>>>> scip-3.1.0.win.x86.msvc.opt.spx.ld.lib
>>>>>>>>>>>>>  
>>>>>>>>>>>>> And this is the line in /bin/cmpl.opt
>>>>>>>>>>>>>  
>>>>>>>>>>>>> ScipFileName = ../Thirdparty/SCIP/scip-3.1.0.win.x86.msvc.opt.spx.ld.exe
>>>>>>>>>>>>>  
>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>> Indrajit
>>>>>>>>>>>>>  
>>>>>>>>>>>>>  
>>>>>>>>>>>>> 
>>>>>>>>>>>>>> On Sat, Nov 22, 2014 at 10:20 PM, Mike Steglich <mike.steglich at th-wildau.de> wrote:
>>>>>>>>>>>>>> The following entries are working on my Windows test system:
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> CbcPath = ../Thirdparty/CBC/
>>>>>>>>>>>>>> GlpkPath =  ../Thirdparty/GLPK/
>>>>>>>>>>>>>> ScipFileName = ../Thirdparty/scip/scip.exe
>>>>>>>>>>>>>> CplexFileName = 
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> It works as expected when I include the CMPL header entry %arg -solver scip in my model.
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Please copy the required DLLs into CMPL/Frameworks or in another folder that is in the search path.
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> This should work similar for Cplex.
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Cheers,
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Mike
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Am 22.11.2014 um 16:41 schrieb Indrajit Sen Gupta <indrajitsg at gmail.com>:
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> I tried all of the above and some more - but none worked.
>>>>>>>>>>>>>>>  
>>>>>>>>>>>>>>> I tried putting ../../ before the path to filename. So the full path would look like: ../../AMPL/ampl/cplex.exe
>>>>>>>>>>>>>>>  
>>>>>>>>>>>>>>> I even copied cplex.exe and cplex1260.dll into a folder under Thirdparty and tried running it with filename path as: ../Thirdparty/CPLEX/cplex.exe
>>>>>>>>>>>>>>>  
>>>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>>> Indrajit
>>>>>>>>>>>>>>>  
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> On Sat, Nov 22, 2014 at 3:02 PM, Mike Steglich <mike.steglich at th-wildau.de> wrote:
>>>>>>>>>>>>>>>> Hi Indrajit,
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> It is unfortunately not possible to use drive letters to specify where Cplex is located.  Furthermore please use / instead of \. e.g. /DPF/Ampl/ampl/cplex.exe.
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> Cheers,
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> Mike
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> > Am 22.11.2014 um 09:29 schrieb Kamil Figiela <kfigiela at agh.edu.pl>:
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>> > Probably it should say:
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>> > CplexFileName = D:\DPF\AMPL\ampl\cplex.exe
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>> > Best,
>>>>>>>>>>>>>>>> > Kamil
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>> >> Wiadomość napisana przez Indrajit Sen Gupta <indrajitsg at gmail.com> w dniu 22 lis 2014, o godz. 05:56:
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> Hi Mike,
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> I have a CPLEX demo version which came with AMPL demo version. I tried to use this solver with the option:
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> %arg -solver cplex
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> and with the following line in cmpl.opt file:
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> CplexFileName = D:\DPF\AMPL\ampl\
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> This is the path to the folder where cplex.exe is located. When I try to execute a model it says
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> Error (interfaces): can not connect the solver: Cplex ->
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> Any idea why this is happening?
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> Regards,
>>>>>>>>>>>>>>>> >> Indrajit
>>>>>>>>>>>>>>>> >>
>>>>>>>>>>>>>>>> >> _______________________________________________
>>>>>>>>>>>>>>>> >> Cmpl mailing list
>>>>>>>>>>>>>>>> >> Cmpl at list.coin-or.org
>>>>>>>>>>>>>>>> >> http://list.coin-or.org/mailman/listinfo/cmpl
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>> >
>>>>>>>>>>>>>>>> > _______________________________________________
>>>>>>>>>>>>>>>> > Cmpl mailing list
>>>>>>>>>>>>>>>> > Cmpl at list.coin-or.org
>>>>>>>>>>>>>>>> > http://list.coin-or.org/mailman/listinfo/cmpl
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> Cmpl mailing list
>>>>>>>>>>>>>>> Cmpl at list.coin-or.org
>>>>>>>>>>>>>>> http://list.coin-or.org/mailman/listinfo/cmpl
>>>>>>>>>>>>> 
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> Cmpl mailing list
>>>>>>>>>>>>> Cmpl at list.coin-or.org
>>>>>>>>>>>>> http://list.coin-or.org/mailman/listinfo/cmpl
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> _______________________________________________
>>>>>>>>> Cmpl mailing list
>>>>>>>>> Cmpl at list.coin-or.org
>>>>>>>>> http://list.coin-or.org/mailman/listinfo/cmpl
>>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> Cmpl mailing list
>>>>>>>> Cmpl at list.coin-or.org
>>>>>>>> http://list.coin-or.org/mailman/listinfo/cmpl
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cmpl/attachments/20141123/b596f80b/attachment-0001.html>


More information about the Cmpl mailing list