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:
Which should return something similar to this
Using built-in specs.
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-188.8.131.52/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.
ln -s /usr/bin/gcc4 gcc
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/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