This tutorial will guide you through the process of building together CPLEX and Concorde. It merges together information from the here and here, applyng minor changes.
Tested on the following system: - Ubuntu 20.04.2 LTS
If you test this instruction to other machines, write me an email and I will update the tutorial.
chmod +x cplex_studio129.linux-x86-64.bin
sudo ./cplex_studio129.linux-x86-64.bin
The sudo
command is necessary to install the software in the default directory /opt/ibm/ILOG/CPLEX_Studio129/
(which I recommend). This tutorial assume that you have used this directory.
Extrct the files
gunzip co031219.tgz
tar xvf co031219.tar
In the file concorde/Makefile.in
change the line
LIBFLAGS = @LIBS@
into
LIBFLAGS = @LIBS@ -lpthread
In the file concorde/TSP/Makefile.in
change the line
LIBFLAGS = @LIBS@
into
LIBFLAGS = @LIBS@ -lpthread -ldl
Create a folder called ./concorde/cplex
and copy in it the following files
cp /opt/ibm/ILOG/CPLEX_Studio129/cplex/include/ilcplex/*h .
cp /opt/ibm/ILOG/CPLEX_Studio129/cplex/lib/x86-64_linux/static_pic/libcplex.a .
build
in the folder concorde
.In the folder build
run
../configure --prefix=/full/path/concorde/build/ --with-cplex=/full/path/concorde/cplex/
Run
make
It will fail, it's okay :) Now we have the file concorde/build/concorde.h
to work on. In concorde.h
use "find and replace" of any text editor to change all *new)
to *NEW)
and all *class)
to *CLASS)
In concorde/LP/lpcplex8.c
replace
#undef CC_CPLEX_DISPLAY
With
#undef CC_CPLEX_DISPLAY
#ifndef CPX_PARAM_FASTMIP
#define CPX_PARAM_FASTMIP 1017
#endif
In concorde/build/
, rename concorde.a
to libconcorde.a
In the folder build
run again
make
In the folder build
run
./TSP/concorde
This should work, printing the help message of Concorde.