Building Liquid State Machine on Centos 4 64-bit

12 November, 2008

download the lsm toolbox from here:

unpack it to your working directory

Before trying to build the lsm toolbox you need to check that you have access to the gcc4 compiler from within your working environment, you can check this by:

$gcc -v

Which should return something similar to this

Using built-in specs.

Target: x86_64-redhat-linux

Configured with: ../configure –prefix=/usr –mandir=/usr/share/man –infodir=/usr/share/info –enable-shared –enable-threads=posix –enable-checking=release –with-system-zlib –enable-__cxa_atexit –disable-libunwind-exceptions –with-gxx-include-dir=/usr/include/c++/3.4.3 –enable-libgcj-multifile –enable-languages=c,c++,java,f95 –enable-java-awt=gtk –disable-dssi –with-java-home=/usr/lib/jvm/java-1.4.2-gcj- –with-cpu=generic –host=x86_64-redhat-linux

Thread model: posix

gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)

Should you not have the gcc4 complier installed you need to install the package gcc4-4.1.2-14.EL4 and usually create a sim link in your ~/bin folder to ensure that the version 4 compiler will be picked up first.

cd ~/bin
ln -s /usr/bin/gcc4 gcc
export PATH=/home/<username>/bin:$PATH

Now that the build environment is sorted out its onto the actual process of building the lsm toolbox. So, edit the Makefile in lsm/csim/src change the default build rule to

default: version.i filepermissions csim.mexga64 install.m

The default build rule should be around line 135 in the Makefile. Depending on where matlab is installed the file paths which are hardcoded in the build file may need to be changed. In this example using the vim regular_expression to change the path from /usr/local/matlab to /opt/matlab/ins


Now move to the csim directory and run the make command as normal.

Should an error similiar to the quote below occur,

Invalid MEX-file ‘/home/<username>/<working directory>/lsm/csim/csim.mexa64′: /opt/matlab_sp3_64/ins/bin/glnxa64/../../sys/os/glnxa64/ version `GCC_4.2.0’ not found (required by /usr/lib64/

The solution to seems to be to move the file out of the way so that matlab will use the system one first. The file can be moved via the normal unix command ‘mv’ as shown below.


Building bzr on RHEL AS 4

13 September, 2008

In order to use the bzr distributed version control system on Redhat Enterprise Linux 4 (RHEL) you first have to build python 2.4+ (and some additional modules) as RHEL shipped with 2.3.* of python which isn’t supported by bzr. In this article I will be building python 2.4.5 and the addional modules required for bzr 1.6.1 into a folder in my home directory so as not upset any of the applications that rely on the RHEL supported version of python. So lets get started;

First get python 2.4.5 using wget as the downloader

patrickd tmp $ wget -c

Now lets use tar to decompress it.

patrickd tmp $ tar xfjv Python-2.4.5.tar.bz2

[  …………….  ]

Enter the directory that tar just decompressed it to and configure it, so that it will be installed into the directory ‘/home/patrickd/apps/python’

patrickd Python-2.4.5 $ cd Python-2.4.5

patrickd Python-2.4.5 $ ./configure –prefix=/home/patrickd/apps/python

checking MACHDEP… linux2
checking for –without-gcc… no

[ ……… ]

creating Setup
creating Setup.local
creating Makefile

Once, python is configured. It is time to build it using the ‘make’ command, then create the directory that we intend to install python to and then finally install python into the preconfigured directory.

patrickd Python-2.4.5 $ mkdir -p /home/patrickd/apps/python

patrickd Python-2.4.5 $ make

[  ……  ]

patrickd Python-2.4.5 $ make install

[ ……  ]

After python has been installed, it now time to setup some environment variables. That will enable the new 2.4 version of python to be used as the default python rather than the redhat compilied version of python.

patrickd Python-2.4.5 $ export PATH=$HOME/apps/python/bin:$PATH

patrickd Python-2.4.5 $ export PYTHONPATH=/home/patrickd/apps/python/lib/python;

Check to make sure that the environment variables are correctly set by calling python and checking the version number.

patrickd Python-2.4.5 $ python -V
Python 2.4.5

Now we need to get some additional python modules that are used by bzr.

patrickd tmp $ wget

patrickd tmp $ wget

patrickd tmp $ wget

As before decompress them,

patrickd tmp $ tar xfzv Pyrex-

patrickd tmp $ tar xfzv cElementTree-1.0.5-20051216.tar.gz

patrickd tmp $ tar xfzv paramiko-1.7.4.tar.gz

Now build and install each of them in turn.

patrickd tmp $ cd Pyrex-

patrickd Pyrex- $ python install

patrickd Pyrex- $ cd ..

patrickd tmp $ cd cElementTree-1.0.5-20051216/

patrickd cElementTree-1.0.5-20051216 $ python install

[ ………… ]

patrickd cElementTree-1.0.5-20051216 $ cd ..

patrickd tmp $ cd paramiko-1.7.4/

patrickd paramiko-1.7.4 $ python install

[ ……… ]

patrickd paramiko-1.7.4 $ cd ..

Finally its time to get the bzr source code and install it into the new 2.4.5 python installation.

patrickd tmp $ wget

patrickd tmp $ tar xfzv bzr-1.6.1.tar.gz

patrickd tmp $ cd bzr-1.6.1

patrickd bzr-1.6.1 $ python install –home /home/patrickd/apps/python/

patrickd bzr-1.6.1 $ cd ~

After building and installing bzr its now time to check that bzr is correctly installed.

patrickd ~ $ bzr version
Bazaar (bzr) 1.6.1
Python interpreter: /home/patrickd/apps/python/bin/python 2.4.5
Python standard library: /home/patrickd/apps/python/lib/python2.4
bzrlib: /home/patrickd/apps/python/lib/python/bzrlib
Bazaar configuration: /home/patrickd/.bazaar
Bazaar log file: /home/patrickd/.bzr.log

Copyright 2005, 2006, 2007, 2008 Canonical Ltd.

bzr comes with ABSOLUTELY NO WARRANTY.  bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Now that you have finished installing bzr, I would suggest your next point of call should be bzr user guide and then the main bzr documentation page.