HOWTO Get Mathematica Running with an AMD64 Linux OS
I’ve been really happy since I switched to Gentoo. I have a rock-stable 64-bit platform with the latest builds of the software I want. It’s quite easy to maintain, and installing it can be a learning experience.
Every once in a while I run across strange fiddly things that I have to do to get things to work right, and Mathematica 5.0 is one of them. While the newer Mathematica versions will likely install fine from what I’ve read, version 5.0 doesn’t seem to want to run after being installed. The solution to get it working is quite simple, though.
Solution 1:
Simply type ‘linux32 mathematica’. What is “linux32″? From the man page:
linux32 changes the personality of command and all its children to return i686 instead of x86_64 in uname -a.
This is useful to fool shell scripts or programs that check for the architecture explicitely into believing
that they run on a true i686 system. In addition it moves the top of stack of the 32bit child processes to
0xc0000000. This is useful to execute some broken applications that break when the stack top is at 4GB. On
the other hand it limits the usable heap memory more than necessary. When –4gb is specified this is not
done.
Solution 2:
When you run mathematica, you’re actually invoking a script that determines your system type using ‘uname’. You can modify that script (and the others associated with it) to recognize x86_64 and automatically pick the correct binaries. To do this, locate the scripts (you have already specified where they reside when you installed it) and edit them. Look for this segment in the script:
[code lang="Bash"]
Linux)
case `uname -m` in
alpha)
SystemIDList="Linux-AXP";;
ia64)
SystemIDList="Linux-IA64";;
i?86)
SystemIDList="Linux";;
*)
SystemIDList="Unknown";;
[/code]
You’ll want to change that to this:
[code lang="Bash"]
Linux)
case `uname -m` in
alpha)
SystemIDList="Linux-AXP";;
ia64)
SystemIDList="Linux-IA64";;
i?86)
SystemIDList="Linux";;
x86_64)
SystemIDList="Linux";;
*)
SystemIDList="Unknown";;
[/code]
You will need to do that for these scripts: MathKernel, Mathematica, math, and mcc. That should do it!