PDA

View Full Version : Problem with Matlab on 64-bit Fedora7



pavka
1st November 2007, 01:30 PM
I've been trying to get Matlab to work on 64-bit Fedora7 for several hours, with no luck. Any help will be appreciated...
In short:

It's the "Student version", which says does not support 64-bit Linux. There's however an option to install it as 32-bit, which I used (had to rename a couple of directories too, but finally the installer started and installed stuff). Then there were problems with SELinux, which I seem to have solved.
I also changed JRE from the one that comes with Fedora to the SUN version. Each of these was a bit of an improvement.

The situation now is as follows:
from the command line, the command "matlab" starts the application, and a flash screen literally "flashes" for a part of a second and disappears. In the console, I get an "EDU>>" prompt. If I try to start the help application from it, it complains that "Java is not available". But, "which java" says:
/usr/bin/java

Also, in the matlab console window there's this error:

/usr/share/themes/Glossy/gtk-2.0/gtkrc:35: error: lexical error or unexpected token, expected valid token

The graphic interface doesn't start at all... What could be the problem?

Harald
1st November 2007, 02:01 PM
What gtk version is installed on your machine? There might be an issue with 32bit application trying to access gtk lib if thats only 64 bit installed. It is possible that you need to install the 32bit gtk lib. Unfortunately yum will only resolve the 64bit dependencies, so you might have some manual work to get all required packages installed properly.

pavka
1st November 2007, 02:16 PM
[root@localhost ~]# yum -y info gtk+
Installed Packages
Name : gtk+
Arch : x86_64
Epoch : 1
Version: 1.2.10
Release: 57.fc7
Size : 2.3 M
Repo : installed
Summary: The GIMP ToolKit

Description:
The gtk+ package contains the GIMP ToolKit (GTK+), a library for
creating graphical user interfaces for the X Window System. GTK+ was
originally written for the GIMP (GNU Image Manipulation Program) image
processing program, but is now used by several other programs as
well.


Name : gtk+
Arch : i386
Epoch : 1
Version: 1.2.10
Release: 57.fc7
Size : 2.3 M
Repo : installed
Summary: The GIMP ToolKit

Description:
The gtk+ package contains the GIMP ToolKit (GTK+), a library for
creating graphical user interfaces for the X Window System. GTK+ was
originally written for the GIMP (GNU Image Manipulation Program) image
processing program, but is now used by several other programs as
well.

Seems both 32 and 64-bit version are installed...
Might be another problem (how did both end up installed? It seems to be true of a pile of other packages too - do I have a more general problem?)

mwette
1st November 2007, 02:56 PM
One approach to dealing with this might be to edit the startup "matlab" script to
execute "ldd" in front of the matlab binary. This will list the libraries that are
being bound.

Also, if matlab uses JNI then maybe you need to be running the 32bit version
of java. What does "java -version" say?

pavka
1st November 2007, 03:15 PM
This is what I get:


[root@localhost ~]# java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-b05, mixed mode)

A.Serbinski
1st November 2007, 03:19 PM
1) Use the 32bit version of Java,
2) if "which java" shows /usr/bin/java, then matlab may be picking up the wrong java as well. You need to add "/usr/java/latest/bin" to your PATH variable *BEFORE* /usr/bin, ie, PATH=/usr/java/latest/bin:$PATH

pavka
1st November 2007, 03:31 PM
Wouldn't that make all other applications use 32-bit java then?
Is there any way I can make only Matlab use another version?
And how do I install a 32-bit version as well as the existing one - just run the 32-bit RPM?

mwette
2nd November 2007, 02:02 PM
Wouldn't that make all other applications use 32-bit java then?
Is there any way I can make only Matlab use another version?
And how do I install a 32-bit version as well as the existing one - just run the 32-bit RPM?

You could modify the "matlab" command, a shell script, to use java from where
you want. If PATH does it, then just add somethling like

PATH=/usr/java/latest/bin:${PATH}
export PATH

near the top of the "matlab" script.

pavka
5th November 2007, 03:40 AM
OK, I managed to get it working at last...
Here's the story:

- according to Matlab support, "Student version" is not supported on 64-bit Linux
- however, there's a switch to install it on 64-Linux (go figure...) as a 32-bit application: ./install_unix.sh -glnx86
- the above installs it, then crashes when it reaches the activation part; the application itself does not work, producing no error messages (none I could find anyway - neither in the console, nor in /var/log/messages )
- apparently, the problem lies in the fact that - although installed as "glnx86" (which apparently stands for 32-bit Linux), it keeps looking for stuff in directories called glnxa64, which is the "system architecture" variable
- this, I guess, could be solved by hard-coding "glnx86" in the ~installdir/bin/matlab script, which I didn't try
- I solved it in a more brutal way - checked all directories (there's quite a few of them) and symlinked directories in the way it was looking for them:
-- where a directory is called glnx86: "ln -s glnx86 glnxa64"
-- where a directory is called i386: "ln -s i386 amd64"

Now it works. Whether there will be further problems arising from this solution, I don't know... Hope not.