Compile Octave 3.6.2 for both CentOS 5 and CentOS 6

In the environment at my work, I usually have to compile newer versions of software for our clients to use. At the moment we have both CentOS 5 and CentOS 6 in production and I’d like to have to only compile a program only once and have it work in both.

Here’s what I did for octave/3.6.2:
1) Installed a bunch of dependencies on CentOS 5.8 box that I was missing:

sudo yum install ImageMagick-devel \
 gd-devel \
 glpk-devel \
 suitesparse-devel \
 qrupdate-devel \
 fltk-devel \
 qhull-devel \
 GraphicsMagick-devel \

2) Run the configure script and go! To get it to compile I had to remove the docs and curl section. I read somewhere on the mailing list that the versions of curl and zsh are too low and thus the issues. Last is the disabling of the hdf5, there’s a major version difference between CentOS 5 and 6 and causes octave not to work at all in 6.

tar -xvpf octave-3.6.2.tar.bz2
cd octave-3.6.2
./configure --prefix=/pkg/octave/3.6.2 \
 --without-curl \
 --enable-docs=no \

3) Then the usual make and install:

make -j 2
make install
This entry was posted in software and tagged , , . Bookmark the permalink.

2 Responses to Compile Octave 3.6.2 for both CentOS 5 and CentOS 6

  1. Scott Cokely says:


    Came across this page while struggling with Octave on Centos 5.8. One of the touchiest open-source packages I’ve ever had to deal with … but I *had* to, because our company doesn’t want to buy more Matlab licenses. Therefore: Octave.

    My biggest hassle was dealing with the existing install. I had no control over the RPMs, so I just had to experiment until I finally hit on the winning combo.

    Currently building 3.6.4 using “./configure –disable-curl –enable-docs=no”, but the trick is the LD_LIBRARY_FILE. I’ve got a mix of 32- and 64-bit libraries all over, so I had to define it as: /usr/local/lib64:/usr/local/lib:/lib64:/usr/lib64

    It’s still not perfect; the user is looking for some GUI action. But at least I’ve got a working build as a start point. thanks for your help!

  2. Scott Cokely says:

    Addendum to the previous post: Here’s the total list of env vars to modify:

    LDFLAGS= -L/usr/local/lib64 -L/usr/local/lib
    CPPFLAGS= -I/usr/local/include
    CFLAGS= -I/usr/local/include

    And the configure command:

    ./configure –without-curl –disable-docs

Leave a Reply

Your email address will not be published. Required fields are marked *