If you link dynamically, which is the only option available on Windows, then, the actual machine on which you run should have CPLEX installed. The reason is that while creating the executable, the actual cplex functions are not stored in the executable because these functions are dynamically linked.
On linux platforms, if you create an executable following example makefile provided by CPLEX, you will be able to link statically. This means that all CPLEX functions are copied over into the actual executable itself. This also means that even on a machine that does not have CPLEX installed, this executable will run.
Although there is considerable debate over dll vs static linking (note that static linking on Windows was possible a long time ago (> 10 years ago) but at some point, CPLEX folks decided to only offer their functions as dlls on Windows), it is *generally* held that static linking produces executables that run faster since the extra lookup is eliminated. (In my experience, I have not found significant differences between the same code running on Windows as opposed to Linux).
If you do not have access to a Linux machine, then the option for you would be to install Windows subsystem for Linux (WSL) on a Window machine, and then run the linux application via WSL.
------------------------------
CPLEX User
------------------------------
Original Message:
Sent: Mon January 24, 2022 12:30 PM
From: javier rodrigo
Subject: Running program in PC with no cplex installation
As usual thanks for your knowledge Alex. So, unless you call cplex in the cloud (does it have any academic release or something like that?), for the rest of options you need to have the cplex2010.dll on the machine in order to run it. Is that correct? I haven't found anything in the c_cpp.html that shows how to make a .exe with all dll/libs included but again I am not very knowledgeable in compiler/linker options.
------------------------------
javier rodrigo
Original Message:
Sent: Mon January 24, 2022 02:59 AM
From: ALEX FLEISCHER
Subject: Running program in PC with no cplex installation
Hi
in CPLEX_Studio201\cplex you could read c_cpp.html
Using IBM ILOG CPLEX Optimizers with Microsoft Visual C++
This file describes how to use Microsoft Visual Studio to:- build and run the C and C++ examples delivered with the CPLEX® Optimizers. (See dotnet.html for the C# and VB.NET examples.)
- create a C or C++ project and link the target with CPLEX.
You can either use dll or libs
From Java and Python you can also call OPL models but will need CPLEX in the machine where CPLEX will run. You can run the free Community edition there. Or if you do not intend to instal CPLEX at all on that machine you can call CPLEX in the Cloud.
For instance with oplrunwml you can run an OPL model without installing cplex on your machine
------------------------------
[Alex] [Fleischer]
[EMEA CPLEX Optimization Technical Sales]
[IBM]
Original Message:
Sent: Sat January 22, 2022 03:09 AM
From: javier rodrigo
Subject: Running program in PC with no cplex installation
Hi, I have used the C++ API to make a .exe that runs fine but needs the cplex2010.dll to run in a different PC. I have several questions:
- Is there any way to create a .exe without having to use the file cplex2010.dll separately?
- Is the java API or the python API able to do that?
- Is there any way a web app could make use of a cplex model developed and run it?
I am using the academic version.
thanks
------------------------------
javier rodrigo
------------------------------
#DecisionOptimization