Johan Lofberg wrote a nice function to interface the Clp linear program solver from the CoinOR project with Matlab. He distributes a precompiled version of the Clp Matlab wrapper for windows, but doesn't include one for linux. Nor are there any directions on how to compile here. I managed to get it to compile with Clp-1.9.0. My directions follow. Issue these commands
# Download Clp-1.9.0.tgz wget http://www.coin-or.org/download/source/Clp/Clp-1.9.0.tgz# untar
tar xzvf Clp-1.9.0.tgz# configure and make
cd Clp-1.9.0
./configure
make
make install# get mexclp
wget http://control.ee.ethz.ch/~joloef/mexclp.zip
unzip mexclp.zip# compile in matlab
matlab -nojvm -nodesktop -nodisplay
ldf=['LDFLAGS="\$LDFLAGS -Wl,--rpath -Wl,' pwd '/lib"'];
mex(ldf,'-Iinclude/coin', '-Llib', '-lClp', '-lCoinUtils', 'mexclp.cpp')
After compiling (hopefully successfully!)
>> clp([],[1 2 1],[1 1 1],-1,[],[])ans =
0
-1
0
For Matlab 2008b on Ubuntu 8.10, I found it necessary to install g++-4.1, setup mex with g++-4.1 and run
./configure CXX=g++-4.1 make make install
before everything would work.
Comments (1)
Great to hear. I've updated the info on the YALMIP home-page with a link to this information
http://yalmip.org/pmwiki.php?n=Solvers.CLP
Posted by Johan Löfberg | May 19, 2009 8:38 AM
Posted on May 19, 2009 08:38