[FlopCpp] How to compile examples?

Tim Hultberg Tim.Hultberg at eumetsat.int
Thu Feb 26 12:00:26 EST 2015


With a little experimentation, I was able to compile (and run after setting LD_LIBRARY_PATH) like this:

g++ transport.cpp -I coin-FlopCpp/include/coin/ -L coin-FlopCpp/lib  -lFlopCpp -lOsiClp -lClp -lOsi 

The order of the libraries is important (and you were also using more than needed). The issue here is not really in flopc++, but rather in the rest of coin.

Surely it would be nice to be able to list libs in any order, but I am not sure there is a good solution... perhaps a question for a generic coin mailing list.

Cheers, Tim Hultberg

________________________________________
From: flopcpp-bounces at list.coin-or.org [flopcpp-bounces at list.coin-or.org] On Behalf Of Antonello Lobianco (not reply) [blackhole at lobianco.org]
Sent: 26 February 2015 14:23
To: flopcpp at list.coin-or.org
Subject: [FlopCpp] How to compile examples?

Hello to all.
I just installed FlopC++ in Linux (Ubuntu 14:04 64 bit if that matter) using prefix=/usr in configure.
Running "make test" seems to work without issues.

I am now trying to get a independent manual compilation of the transport.cpp example[1] but I end up with a serie of undefined references from ld.

The command I run to try to compile transport.cpp is:

g++ -I /usr/include/coin transport.cpp -lCoinUtils -lOsi -lClp -lClpSolver -lOsiClp -lOsiCommonTests -lCbc -lCbcSolver -lCgl -lOsiCbc -lFlopCpp -o transport

The output is:
lobianco at lobianco-officeLaptopLatitude:~/temp/flop++$ g++ -I /usr/include/coin transport.cpp -lCoinUtils -lOsi -lClp -lClpSolver -lOsiClp -lOsiCommonTests -lCbc -lCbcSolver -lCgl -lOsiCbc -lFlopCpp -o transport
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpSimplex::deleteRim(int)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpSimplex::setInfeasibilityCost(double)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpSimplex::cleanup(int)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpSimplex::loadProblem(ClpMatrixBase const&, double const*, double const*, double const*, double const*, double const*, double const*)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpPresolve::~ClpPresolve()'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `OsiSolverInterface::reducedCostFix(double, bool)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpSimplex::checkSolutionInternal()'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpModel::times(double, double const*, double*) const'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpSimplex::checkPrimalSolution(double const*, double const*)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpSolve::operator=(ClpSolve const&)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `OsiSolverInterface::getRowNames()'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `OsiRowCut::ub() const'
[...]
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpNodeStuff::zap(int)'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libOsiClp.so: undefined reference to `ClpSimplex::resize(int, int)'
collect2: error: ld returned 1 exit status

Also, I have installed on my system glpk. Is there any significant gain in using glpk vs OsiClp as backend solver engine ? If so, how should I change the compilation command and the c++ source in order to use glpk ?

Many thanks,
  Antonello Lobianco, Laboratoire d'Economie Forestiére, Nancy

[1] https://projects.coin-or.org/svn/FlopC++/stable/1.2/FlopCpp/examples/transport.cpp


--
Antonello Lobianco
Spedito da un indirizzo non presenziato - Sent from an unattended account

Any email message from EUMETSAT is sent in good faith but shall neither be binding nor construed as constituting a commitment by EUMETSAT, except where provided for in a written agreement or contract or if explicitly stated in the email. Please note that any views or opinions presented in this email are solely those of the sender and do not necessarily represent those of EUMETSAT. This message and any attachments are intended for the sole use of the addressee(s) and may contain confidential and privileged information. Any unauthorised use, disclosure, dissemination or distribution (in whole or in part) of its contents is not permitted. If you received this message in error, please notify the sender and delete it from your system.



More information about the FlopCpp mailing list