[C++] Error building from source to use CPLEX

161 views
Skip to first unread message

Jonás Levy Alfie

unread,
Feb 26, 2019, 2:33:02 PM2/26/19
to or-tools-discuss
Hello! 

I'm quite new to or-tools, I wanted to try building the C++ version from source in order to use CPLEX as third party solver. 
I'm using Ubuntu 18.04, gcc version 6.5.0 20181026 (Ubuntu 6.5.0-2ubuntu1~18.04) 
Also I downloaded or-tools 6.10 

After make third_party I modified Makefile.local adding UNIX_CPLEX_DIR = /opt/ibm/ILOG/CPLEX_Studio126/
When I do make cc I get errors like these; 

./ortools/linear_solver/cplex_interface.cc: In static member function ‘static void operations_research::CplexInterface::MakeRhs(double, double, double&, char&, double&)’:
./ortools/linear_solver/cplex_interface.cc:382:26: error: call of overloaded ‘abs(double&)’ is ambiguous
              (std::abs(ub) == CPX_INFBOUND && std::abs(lb) > CPX_INFBOUND)) {


Any ideas how to solve this? 

Thanks! 

Laurent Perron

unread,
Feb 26, 2019, 4:13:17 PM2/26/19
to or-tools-discuss
std::abs<double>(...)

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonás Levy Alfie

unread,
Feb 26, 2019, 6:16:19 PM2/26/19
to or-tools-discuss
Hi! Thanks for answering. 

I tried that, but returned an error like this;

./ortools/linear_solver/cplex_interface.cc:383:24: error: expected primary-expression before ‘double
              (std::abs<double>(ub) == CPX_INFBOUND && std::abs(lb) > CPX_INFBOUND)) {
                        ^~~~~~

(Note sure if this was the correct way to try it)

Anyway, I tried a bunch of different stuff that didn't work, then tried including the cmath header and that seemed to work :) 
With that, make cc and make test_cc both worked. 

What do you think? Seems like a correct solution? 
Reply all
Reply to author
Forward
0 new messages