Originally posted by: SystemAdmin
If you are unfamiliar with Linux/Unix and Makefiles then I think there is an easier way. CPLEX comes with example code and a Makefile to build them. In your CPLEX installation there should be a directory cplex/examples/x86-64_sles10_4.1/static_pic (in very old version 'sles' maybe 'debian'). Do the following
1. Change to that directory.
2. Run 'make lpex1'. This will compile the lpex1.o object file as well as the lpex1 binary. From the output you can see which flags you need to supply for compilation.
3. Do this for each version you have.
4. Adjust your own build process accordingly.
What may be even easier is to copy cplex/examples/x86-64_sles10_4.1/static_pic/Makefile to your own Makefile (in the directory where x.c is). The only things you need to change are
1. Replace the string "lpex1" by "x" (so that the x.c source file is compiled into the "x" binary.
2. Change the two assignments
CPLEXDIR = ../../.. CONCERTDIR = ../../../../concert
into (replacing /path/to/COS with the respective CPLEX installation directory)
CPLEXDIR = /path/to/COS/cplex CONCERTDIR = /path/to/COS/concert
3. Run 'make x'
4. Optionally delete everything that is not needed from the copied Makefile.
Note that the example Makefile has also rules to build C++ and Java examples.
If you run into further troubles with that then please specify
-
which version of CPLEX causes the trouble,
-
where that version is installed,
-
what exactly are the error messages you see.
#CPLEXOptimizers#DecisionOptimization