« Latex Presentation Fonts | Main | Paper: Improving the Presentation and Interpretation of Online Ratings Data with Model-Based Figures »

CoinOr CLOP for Matlab

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.

TrackBack

TrackBack URL for this entry:
https://www.stanford.edu/~dgleich/cgi-bin/mt/mt-tb.cgi/19

Comments (1)

Johan Löfberg:

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

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on March 4, 2009 10:15 PM.

The previous post in this blog was Latex Presentation Fonts.

The next post in this blog is Paper: Improving the Presentation and Interpretation of Online Ratings Data with Model-Based Figures.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.34