Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Fedora This forum is for the discussion of the Fedora Project.


  Search this Thread
Old 05-19-2004, 06:18 PM   #1
Registered: Oct 2002
Distribution: Fedora Core 2
Posts: 32

Rep: Reputation: 15
MATLAB GUI on Fedora Core 2 fixed? long post.

I upgraded Linux and MATLAB didn't work.
saw errors like:
Warning: Disabling Java support.
But, after much searching and reading this newb got it to work.

if you need to matlab up fast and don't mind text mode only
enter the following at the prompt:
matlab -nojvm
If you like the GUI of matlab and want to undertake the
challenge (for newbies like me) of resurrecting it read on

The errors on attempting to run MATLAB 12.1 student version on Fedora Core2
were really frustrating. I got warnings about GLIBC_2.0 and the Java Runtime Evironment.
Also I had problems with linking the java libraries. Basically, many things that I didn't
fully understand. But, I now have MATLAB working in gui mode and it doesn't keep crashing
when I open new windows and that sort of thing (as others have reported).
I combined the steps from several different postings on users groups (searched:mathworks/LQ/google)

This one was really helpful from Jakub at
posted 11/21/2003 Bug # 110610
<start post>
Try using some less buggy JVM.
Latest Sun JDK should work just fine for example.

Or, as a workaround for the buggy JVM, you can try:

gcc -O2 -shared -o ~/ -fpic -xc - <<\EOF
#include <errno.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
__libc_wait (int *status)
int res;
asm volatile ("pushl %%ebx\n\t"
"movl %2, %%ebx\n\t"
"movl %1, %%eax\n\t"
"int $0x80\n\t"
"popl %%ebx"
: "=a" (res)
: "i" (__NR_wait4), "0" (WAIT_ANY), "c" (status), "d" (0),
"S" (0));
return res;

and run the program with
in environment.
<end post>

I copied and pasted the gcc -02 ...
to EOF
(don't ask me to explain that code I just ran it)
(make sure you are su when you run it, though)
(I think the code makes a file that stops matlab
from choking on not finding the clibrary until after
it knows which java environment is active)

and then typed the following at the prompts:

export LD_PRELOAD=~/
export LD_ASSUME_KERNEL=2.4.19

Then I typed matlab and I was happy to see the GUI load properly,
but sad if I opened a .m file in its editor
MATLAB crashed. This is a big problem.

What Jakub didn't know and poster David Kewley (2/19/04 same thread) did
is that MATLAB 12.X doesn't play nice with Sun Java version 1.4.2. And this file above could be a good fix for RH8 but not for versions that
used most recent versions of Java. When I did just this fix - I got that
crash problem when opening other windows.

So, I was looking at another posting this time from the Mathworks site.
(solution number 1 -1 AFHN) which suggested to get the 1.3 version of Java
from and install that and then have MATLAB link to this version
of JAVA.

ln -s /where-you-install-blackdownjava/j2se/1.3/jre /local-matlab-dir/sys/java/jre

(of course replace the hyphenated directories with your particular directories)

I did not change the environment variable like the rest of that mathworks post said.
do not type this part: (export MATLAB_JAVA=/path-to-blackdown-java/jre)

I guess that I made MATLAB "think" its using an older kernel version (2.4.19) with
a newer Java version (with appropriate C libraries). While, avoiding forcing MATLAB
to use the latest Java version which can crash the MATLAB GUI. delicate program, eh?

I have opened and closed MATLAB several times even logged out and back on and it still works
I think it stuck. now, i just have to make a shell script to run matlab that contains the following three lines and always use that script to run matlab.

export LD_PRELOAD=~/
export LD_ASSUME_KERNEL=2.4.19
matlab -nosplash

good luck, don't give up. I got help from using the search at LQ and other places.
I am a bigger newb than you trust me.
Old 06-17-2004, 01:52 PM   #2
LQ Newbie
Registered: Jun 2004
Posts: 3

Rep: Reputation: 0

I think I don't encounter exactly the same problem but something similar.
My Matlab (Version Release 13 (Service Pack 1)) works o.k. with Fedora Core 2 even with the Java GUI for some simple tasks such as reading in data and producing scatterplots.

But as soon as I try to make a mesh or surf type of plot in crashes completely (java and non-java mode).
I tried the examplary codes from mathworks:

[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;

---> this causes a crash

but for example:

n = 6;
r = (0:n)'/n;
theta = pi*(-n:n)/n;
X = r*cos(theta);
Y = r*sin(theta);
C = r*cos(2*theta);

works wheras this:

axis ij
axis square

causes a horrible crash again.

Now I am rather confused and can't find of a way out anymore - if there are any comments to this I would be extreeemely happy!!!
Old 06-17-2004, 02:03 PM   #3
Registered: Oct 2002
Distribution: Fedora Core 2
Posts: 32

Original Poster
Rep: Reputation: 15
mesh and surf plots I would bet use the java environment (even in non-java mode).
so trying some of the work-arounds I suggested above may help. I wrote that post perhaps too soon. I had a crash the other day re-sizing a plot (alhtouhg it had worked before). The suggested quick fix may not be perfect.

I would try and find out which version of java MATLAB 6.5 uses. Then I would try to get all of those java libraries and follow the instructions in the above post.

Alternatively, are you going to get Matlab 14 soon (through work or school server)? maybe an upgrade would fix the problem.
Old 06-17-2004, 02:46 PM   #4
LQ Newbie
Registered: Jun 2004
Posts: 3

Rep: Reputation: 0
I got a hint from the mathworks forum saying that it might be something with openGL.
trying "opengl info" in matlab causes it to crash - there you go.

( )

but it seems not to be one of the nicest problems one can have. it has something to do with my nvidia graphics card which is not the best friend of Fedora as I learned from several postings....

I'll have to try to fix this thing.
Old 06-18-2004, 03:41 AM   #5
LQ Newbie
Registered: Jun 2004
Posts: 3

Rep: Reputation: 0 I found a work-around on
"opengl neverselect"

its maybe not a clean solution but it seems to work now.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora Core 3 DVD post installation problems NadJ Linux - Software 1 04-18-2005 07:00 AM
Fedora Core 3 Post Install Issues symonphoenix Fedora 2 01-25-2005 11:08 AM
fedora core 2 post installation dhrumantgoradia Linux - Hardware 2 12-01-2004 04:23 PM
how long till fedora core 3? redrush Fedora 1 09-28-2004 04:52 AM
i need help for a message post-install with fedora core 1 Filez Fedora - Installation 3 03-30-2004 08:04 AM > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 12:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration