Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* MATLAB under Linux/Alpha ?
@ 1997-11-17  5:00 Heinrich Rebehn
  1997-11-17  5:00 ` Allan B MacIsaac
  1997-11-23  5:00 ` Michal Jaegermann
  0 siblings, 2 replies; 4+ messages in thread
From: Heinrich Rebehn @ 1997-11-17  5:00 UTC (permalink / raw)



Hi,

has anybody succeeded in running DEC-UNIX MATLAB under
Linux/Alpha?


Heinrich Rebehn

University of Bremen
Physics / Electrical and Electronics Engineering
- Department of Telecommunications -

E-mail: mailto:rebehn@comm.uni-bremen.de
Phone : +49/421/218-4664
Fax   :            -3341



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MATLAB under Linux/Alpha ?
  1997-11-17  5:00 Heinrich Rebehn
@ 1997-11-17  5:00 ` Allan B MacIsaac
  1997-11-23  5:00 ` Michal Jaegermann
  1 sibling, 0 replies; 4+ messages in thread
From: Allan B MacIsaac @ 1997-11-17  5:00 UTC (permalink / raw)



Heinrich Rebehn (rebehn@comm.uni-bremen.de) wrote:
: Hi,

: has anybody succeeded in running DEC-UNIX MATLAB under
: Linux/Alpha?


: Heinrich Rebehn

I've been playing with trying to do this off and on for about a
month.  I can get it to install off the CD, but it "Segmentation
fault"s  when I start it.  I get the same result using a stock RedHat
4.2 + kernels 2.1.54-2.1.64 and using a RedHat Mustang (4.9.1) with kernel
2.1.64 (Using  shared libraries from a similar machine running DU
4.0.)

I'm not an expert so I haven't really made much headway in figuring
out what is killing matlab.  It gets to the point where its check the
license, prints out that I have a valid license (for two more weeks
anyway), brings up it's initial X-Window then Seg Faults.  If I get
more time I may look at it more closely using strace.  Let me know if you 
make any progress.

By the way the Digital unix version of Maple V R4, works quit well
under Linux/Alpha.


A.B.

-- 
Dr. Allan B. MacIsaac                 There once was an old man from Esser,
Dept. of Applied Math                 Whose knowledge grew lesser and lesser.
University of Western Ontario         It at last grew so small,
London, Ontario, Canada               That now he's a College Professor.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MATLAB under Linux/Alpha ?
  1997-11-17  5:00 Heinrich Rebehn
  1997-11-17  5:00 ` Allan B MacIsaac
@ 1997-11-23  5:00 ` Michal Jaegermann
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Jaegermann @ 1997-11-23  5:00 UTC (permalink / raw)



Heinrich Rebehn (rebehn@comm.uni-bremen.de) wrote:

: has anybody succeeded in running DEC-UNIX MATLAB under
: Linux/Alpha?

Octave works (ftp://ftp.che.wisc.edu/pub/octave) although
an interface is more spartan.

  --mj




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MATLAB under Linux/Alpha ?
@ 1998-05-11  4:00 Allan B MacIsaac
  0 siblings, 0 replies; 4+ messages in thread
From: Allan B MacIsaac @ 1998-05-11  4:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7200 bytes --]


I was recently able to get the Digital Unix 4.0 version of matlab 5.1 (and 
MapleV R5 and Netscape 4.05) to run under Linux.  The key was a patch 
provided by Richard Henderson to help someone who wanted to run the
SPEC benchmark suite compiled under Digital Unix on his Alpha running 
Linux.  Below is a long account of the details, which  I provided to 
The Mathworks Inc.  After I clean this stuff up, perhaps I'll send a note for
inclusion into Alpha FAQ.  


How to install the Digital Unix 4.0 Version of Matlab under Alpha/Linux


1. Requirements

	a.  You must have legal access to the shared libraries of
	    Digital Unix 4.0 or higher.  Copy /sbin/loader from 
	    Digital Unix to /sbin/loader on the Linux system.
	    Copy the contents of /usr/shlib from the Digital Unix 
	    machine to /usr/shlib on the Linux system.  Copy the 
	    file  /etc/svc.conf from the DU machine to the Linux
	    system.  Now you don't really need all the libraries,
	    but I haven't got Matlab installed on a newer DEC 
	    Unix box so I can't check which ones it really uses.


	b. You must have a legal license for Matlab.


	c. You must have a newer version of the Linux kernel, with the 
           following patch, provided by Richard Henderson.  I used kernel
	   2.1.99, and I'm not sure what kernel version the patch was
	   meant to apply to, but it doesn't apply directly to 2.1.99.
	   This fix ignores a problem in the DEC libraries (I think)

	   In people terms you need to delete the following two lines
	   from the function do_sigreturn in the file 
	   /usr/src/linux/arch/alpha/kernel/signal.c

       if (__get_user(ps, &frame->sc.sc_ps) || ps != 8)
               goto give_sigsegv;

	   In my  2.1.99 they were at lines 287-288.



--- signal.c.orig       Fri May  1 14:55:29 1998
+++ signal.c    Fri May  1 14:55:59 1998
@@ -301,8 +301,6 @@ do_sigreturn(struct sigframe *frame, str
        /* Verify that it's a good sigcontext before using it */
        if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
                goto give_sigsegv;
-       if (__get_user(ps, &frame->sc.sc_ps) || ps != 8)
-               goto give_sigsegv;
        if (__get_user(set.sig[0], &frame->sc.sc_mask)
            || (_NSIG_WORDS > 1
                && __copy_from_user(&set.sig[1], &frame->extramask,


2. Funny stuff

	a. The installation script for Matlab (and Maple V R5 and many
	   packages) uses uname to detect the architecture of the system
	   the script is being run on.  Like most vendors when uname
	   returns Linux, they assume x86.  Since Linux now runs on
	   Alpha's, Sun's, SGI's, Mac's both M68 and PPC, ARM, etc. 
	   this will hopefully change soon.  In the mean time we need to 
	   work around this assumption.  For the Alpha,  the work
           around I use is to replace /bin/uname temporarily with the 
	   simple sh script below.  One could get fancy and create a 
	   script that really mimics the DEC Unix uname, but this 
	   works


	                #!/bin/sh
			echo OSF1

	   So you should do this as root

	   mv /bin/uname  /bin/uname_real
	   cat >/bin/uname
 	   #!/bin/sh
           echo OSF1
	   ^D
(This means hold down the control key and type D.)

	  O.K. now your uname should just return OSF1 and nothing
	  else.  and we're ready to follow the install instructions 
	  in the Installation Guide for UNIX that The Math Works sent
          you when you paid them their well earned money.  (No joke I 
	  think Matlab is worth every penny)
 
3. By the book.

	a.  Mount the CD 
		mount -t is09660 /dev/cdrom /cdrom
	b. cd /usr/local
	c. mkdir matlab5
	d. cd matlab5
	e. put your license in this directory (/usr/local/matlab5)
	f. run the install script  /cdrom/install -i

	   I've found that the -i is required.  It tells matlab to 
	   "Ignore the check for disk-space when running setup"
	   I haven't explored the problem in detail, but it is a
	   minor thing.

	g. Follow the on screen instructions as detailed in your manual


4.  Finishing up

	a.  The work around with uname has to be undone.
	    mv /bin/uname_real /bin/uname

	b.  Matlab also checks to see what architecture it is  being 
	    run on when it starts.  It still uses uname, but since the
	    scripts are now editable (is this a word?), we can fix them 
	    directly.  There are three files we need to edit:

		$(MATLAB)/etc/util/arch.sh
		$(MATLAB)/install/arch.sh
		$(MATLAB)/bin/util/arch.sh

	    The files in the version of Matlab I have are all the same
	    so the fix is the same for all of these files.


	In these files there are the lines 

                Linux)
	           Arch="lnx86"
		   ;;

	These three lines need to be replaced by 


	        Linux)
 		    case `uname -m` in
                           # A DEC Alpha running Linux
                    "alpha")
                	Arch="alpha"
                        ;;

                           # a Sun Sparc running linux 
		           # I doubt if this is correct.
                           # I don't have a sparc to test it out
                    "sparc")

			   #�this is the SunOS matlab test.
			   # Linux should have a cleaner way
		        if [ -d /dev/pts ]; then
                            Arch="sol2"
                        else
                            Arch="sun4"
                        fi
                        ;;

                           # the Linux/x86 case  --586 Pentium maybe
                     "i586")
                        Arch="lnx86"
                        ;;

                           # the Linux/x86 case --486
                     "i486")
                        Arch="lnx86"
                        ;;

                           # the Linux/x86 case  --386
                     "i386")
                        Arch="lnx86"
                        ;;
                           # currently do not support any other platforms
                          *)
	                Arch="`/bin/arch`"
                        ;;
                    esac
		    ;;

	I've only checked to see that this works for Linux/Alpha.  The
	Sun case is most likely wrong.  

	Matlab also checks to see if the version number of your OS is 
	high enough to run the version of Matlab you have.  This is 
	the script  oscheck.sh in the $(MATLAB)/bin/util directory.
	This script will tell you that your operating system is not
	supported, but matlab will run anyway, so I didn't bother to
	patch this script.



5.  You're all done.


6. Other things.

	a.  I did this using a DEMO license graciously provided by
	Peter Trogos at The Math Works.  I make no guarantee that it
	will work for anyone else.  Also I did not install the license 
	manager.  When I get my real license I will do that and
	update this note.  I suspect that some combination of the 
	Linux/Intel and Digital Unix procedure will work.

-- 
Dr. Allan B. MacIsaac                 There once was an old man from Esser,
Dept. of Applied Math                 Whose knowledge grew lesser and lesser.
University of Western Ontario         It at last grew so small,
London, Ontario, Canada               That he knew nothing at all,
N6A 5B7                               And now he's a College Professor.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-05-11  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-05-11  4:00 MATLAB under Linux/Alpha ? Allan B MacIsaac
  -- strict thread matches above, loose matches on Subject: below --
1997-11-17  5:00 Heinrich Rebehn
1997-11-17  5:00 ` Allan B MacIsaac
1997-11-23  5:00 ` Michal Jaegermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox