From nobody@FreeBSD.org  Fri Sep 10 10:08:17 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B861816A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 Sep 2004 10:08:17 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9633243D4C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 Sep 2004 10:08:17 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i8AA8HpS064595
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 Sep 2004 10:08:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i8AA8HOL064594;
	Fri, 10 Sep 2004 10:08:17 GMT
	(envelope-from nobody)
Message-Id: <200409101008.i8AA8HOL064594@www.freebsd.org>
Date: Fri, 10 Sep 2004 10:08:17 GMT
From: Willem van Engen <wvengen@stack.nl>
To: freebsd-gnats-submit@FreeBSD.org
Subject: how to run matlab on 5.2
X-Send-Pr-Version: www-2.3

>Number:         71555
>Category:       docs
>Synopsis:       handbook: changes for how to run matlab on 5.2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 10 10:10:20 GMT 2004
>Closed-Date:    Fri Oct 13 09:11:40 GMT 2006
>Last-Modified:  Fri Oct 13 09:11:40 GMT 2006
>Originator:     Willem van Engen
>Release:        5.2-CURRENT
>Organization:
>Environment:
FreeBSD jeremy 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Wed Jul 21 10:00:48 CEST 2004     root@jeremy:/usr/obj/usr/src/sys/JEREMY  i386
>Description:
Following FreeBSD's handbook procedure to get matlab running doesn't work here on 5.2-CURRENT with linux_base-7.1_7, giving many errors like:
  [: -ne: unary operator expected
both trying to start the license manager and matlab. License manager cannot be run, and matlab doesn't start because of that.

>How-To-Repeat:
on 5.2-CURRENT with linux_base-7.1_7, install matlab using the installer. Follow procedure of FreeBSD's handbook for running it on FreeBSD, try to start the license manager (/usr/local/etc/rc.d/flexlm.sh).
>Fix:
0. Skip the handbook's license manager startup section (sorry guys)
1. brandelf -t Linux the binaries in $MATLABROOT/etc/glnx86
2. Remove scripts $MATLABROOT/etc/lm*
3. Create symlink from glnx86/lm_boot to $MATLABROOT/etc/lm_boot.
4. Create new startup script /usr/local/etc/rc.d/flexlm.sh as shown below
5. chmod +x of script. like handbook says
6. Run `/usr/local/etc/rc.d/flexlm.sh start`

[note: it still needs some su-wrapping for running it as a normal user]
I'm not sure if this is the Right Way (tm) to run it, but at least it works, independently from linux_base version (as it completely bypasses shell scripts and starts the binaries directly).

I'll forward this pr to freebsd-emulation too.

--- begin flexlm.sh ---
#!/bin/sh

# Verified for matlab R12
MATLABROOT=/usr/local/matlab
LICENSE=$MATLABROOT/etc/license.dat

case "$1" in
  start)
    # Now start daemon. Logging is still an issue
    if [ -f $MATLABROOT/etc/glnx86/lmgrd ]; then
      $MATLABROOT/etc/glnx86/lmgrd -c $LICENSE && echo 'MATLAB_lmgrd'
    fi
    ;;
  stop)
    # Quit 'm
    if [ -f $MATLABROOT/etc/glnx86/lmdown ]; then
      $MATLABROOT/etc/glnx86/lmdown -c $LICENSE -q && echo 'MATLAB_lmgrd'
    fi
    ;;
  *)
    echo "Usage: $0 {start|stop}"
    exit 1
    ;;
esac

exit 0
--- end flexlm.sh ---

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: remko 
State-Changed-When: Fri Oct 13 09:10:48 UTC 2006 
State-Changed-Why:  
Hello, 

I am going to close this PR, but first i want to thank you 
for taking the time to report this and thus take the time 
to do so.  The PR is now obsolete (Sadly) because a newer 
version of matlab is already documented now (6.5). 

Thus, closing the PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71555 
>Unformatted:
