LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 05-19-2004, 07:18 PM   #1
paulo
Member
 
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 bugzilla.redhat.com
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 ~/libcwait.so -fpic -xc - <<\EOF
#include <errno.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
pid_t
__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;
}
EOF

and run the program with
LD_PRELOAD=~/libcwait.so LD_ASSUME_KERNEL=2.4.19
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=~/libcwait.so
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
libcwait.so 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 www.blackdown.org 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=~/libcwait.so
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, 02:52 PM   #2
binki
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Rep: Reputation: 0
hi,

I think I don't encounter exactly the same problem but something similar.
My Matlab (Version 6.5.1.199709 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;
mesh(X,Y,Z)

---> 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);
pcolor(X,Y,C)

works wheras this:

pcolor(hadamard(20))
colormap(gray(2))
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, 03:03 PM   #3
paulo
Member
 
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, 03:46 PM   #4
binki
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.

( http://www.mathworks.com/support/tec...html#Section_4 )

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, 04:41 AM   #5
binki
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Rep: Reputation: 0
...now I found a work-around on mathworks.com:
"opengl neverselect"

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


Reply


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 08:00 AM
Fedora Core 3 Post Install Issues symonphoenix Fedora 2 01-25-2005 12:08 PM
fedora core 2 post installation dhrumantgoradia Linux - Hardware 2 12-01-2004 05:23 PM
how long till fedora core 3? redrush Fedora 1 09-28-2004 05:52 AM
i need help for a message post-install with fedora core 1 Filez Fedora - Installation 3 03-30-2004 09:04 AM


All times are GMT -5. The time now is 07:25 PM.

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