MATLAB: Does the deployed application MATLAB 7.5 (R2007b) fail with “Floating point exception” on a Linux machine

exceptionfloatingMATLAB Compilerpoint

My development machine runs kernel 2.6.20-1.3002.fc6xen with Fedora Core 6 and my deployment machine has is Fedora Core 4 with kernel 2.6.11-1.1369_FC4smp. I run my application with the following command:
./run_myprog_compiled.sh MCR_TEST2/v77/
------------------------------------------
Setting up environment variables
---
Found MCR Java JRE version: 1.6.0
LD_LIBRARY_PATH is .:MCR_TEST2/v77//runtime/glnxa64:MCR_TEST2/v77//bin/glnxa64:MCR_TEST2/v77//sys/os/glnxa64:MCR_TEST2/v77//sys/java/jre/glnxa64/jre1.6.0/lib/amd64/native_threads:MCR_TEST2/v77//sys/java/jre/glnxa64/jre1.6.0/lib/amd64/server:MCR_TEST2/v77//sys/java/jre/glnxa64/jre1.6.0/lib/amd64/client:MCR_TEST2/v77//sys/java/jre/glnxa64/jre1.6.0/lib/amd64
and I receive the following error:
./run_myprog_compiled.sh: line 40: 26292 Floating point exception./avg_tc_compiled $*

Best Answer

These two machine use different versions of the GLIBC library. The deployment machine (test machine) must have the same (recommended) or a compatible version of GLIBC installed.
Note that a supported GLIBC version should be used on the development machine, The following link contains information on the supported versions:
<http://www.mathworks.com/products/system.shtml/Unix>
Refer to the Related Solution to obtain the current glibc version on a machine:
<http://www.mathworks.com/support/solutions/data/1-18SSE.html?solution=>
A possible reason for this floating point exception are the changes introduced in the ELF .hash section that provides symbols for dynamic linking between the two machines. Please refer the following link for more details on this:
<http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os/RELEASE-NOTES-en_US.html#id324882>
"This new .gnu.hash section, which is produced with the new default --hash-style=gnu option for gcc, serves the same purpose as previous hash sections. It provides, however, an approximately 50% increase in dynamic linking speed. Binaries and libraries produced with the new hashing function are incompatible with older glibc and dynamic linker releases. To use the old-style hashing routines for compatibility with older glibc-based systems, pass the --hash-style=sysv option instead."
The recommended option is to use a compatible glibc on the deployment machine or use an older glibc on the development machine.
A workaround would me to modify the mbuildopts.sh in the preference directory. Please note that this is not tested by the MathWorks and is not a recommended procedure.
The workaround it to replace line 46 of mbuildopts.sh by
RPATH="-Wl,-rpath-link,$TMW_ROOT/bin/$Arch,--hash-style=sysv"
The preferences directory can be found by typing PREDIR in your MATLAB command window.