Building Liquid State Machine on Centos 4 64-bit

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-1.4.2.0/jre –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

:%s/\/usr\/local\/matlab/\/opt\/matlab\/ins/g

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/libgcc_s.so.1: version `GCC_4.2.0’ not found (required by /usr/lib64/libstdc++.so.6).

The solution to seems to be to move the libgcc_s.so.1 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.

mv libgcc_s.so.1 libgcc_s.so.1.orig

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: