After you have completed the installation and licensing steps, you can verify that everything is working by running one or more of the examples that are provided with the standard distribution.
On a UNIX system, go to the subdirectory examples/<machine>/<libformat>
that matches your particular platform, and in it you will find a file named makefile
. Execute one of the examples, for instance lpex1.c
, by doing
make lpex1
lpex1 -r
# this example takes one argument, either -r
, -c
, or -n
If your interest is in running one of the C++ examples, try
make ilolpex1
ilolpex1 -r
# this is the same as lpex1
and takes the same arguments.
If your interest is in running one of the Java examples, try
make LPex1.class
java -Djava.library.path=../../../bin/<platform>:
-classpath ../../../lib/cplex.jar: LPex1 -r
|
Any of these examples should return an optimal objective function value of 202.5.
On a Windows machine, you can follow a similar process using the facilities of your compiler interface to compile and then run any of the examples. A project file for each example is provided, in a format for Microsoft Visual C++ 6 and Visual C++ .NET.
If an error occurs during the make
or compile step, then check that you are able to access the compiler and the necessary linker/loader files and system libraries. If an error occurs on the next step, when executing the program created by make
, then the nature of the error message will guide your actions. If the problem is in licensing, consult the ILOG License Manager User's Guide and Reference for further guidance. For Windows users, if the program has trouble locating cplex81.dll
, make sure the DLL is stored either in the current directory or in a directory listed in your PATH
environment variable.
The UNIX makefile
, or Windows project file, contains useful information regarding recommended compiler flags and other settings for compilation and linking.
The source files for the examples and the makefiles provide guidance for how your own application can call CPLEX. The following chapters give more specific information on the necessary header files for compilation, and how to link CPLEX and Concert Technology library files into your application.