Originally posted by: EdKlotz
>
> I have cplex121 installed on my Linux system. I run the verification of installation successfully. I can execute the examples and the results is right as described on the user's manual.
>
> But in all your documents ILOG provides, I can't find how to run my own problem. Now I am doing it in an inconvenient way, I copy my c++ code to the example "blend.cpp" and use "make blend" "./blend" to get my results. If I create my own myproblem.cpp file, and "make myproblem", the terminal tells me "make: *** No rule to make target `myproblem'. Stop.". So what's the right way of doing it?
>
>
Instead of copying your program to one of the existing examples, try modifying the make file to accommodate your program. Let's have a look at how the Unix make file builds the blend.cpp example:
blend: blend.o
$(CCC) $(CCFLAGS) blend.o -o blend $(CCLNFLAGS)
blend.o: $(EXSRCCPP)/blend.cpp
$(CCC) -c $(CCFLAGS) $(EXSRCCPP)/blend.cpp -o blend.o
So, make a copy of this, and then change all occurrences of "blend"
to "myproblem". Put your myproblem.cpp file in the directory with
the CPLEX examples. "make myproblem" should then work for you. As your
programs become more complex, you will need to modify the make file accordingly,
which means creating the dependencies between each .cpp and .o file.
Also, if you put your program somewhere else, note that the make file uses
relative paths for the CPLEX include files and libraries. If you change the
location of your program, you will need to change the paths of the include
files and libraries.
#CPLEXOptimizers#DecisionOptimization