If you want to run binary modules (MEX), you also need the suse_devel-7.3 package; that is not (yet?) available as suse9.x version. Matlab 14.3 ships with a JDK 1.5 which runs nicely on netbsd-3, so no additional JRE needed. The three Matlab 7 / R14 Unix installation CDROMs. The patches listed below. A few GBytes of diskspace.

If you want to run binary modules (MEX), you also need the suse_devel-7.3 package; that is not (yet?) available as suse9.x version. Matlab 14.3 ships with a JDK 1.5 which runs nicely on netbsd-3, so no additional JRE needed. The three Matlab 7 / R14 Unix installation CDROMs. The patches listed below. A few GBytes of diskspace.

(same as above) to update/install/scripts/arch.sh. Re-zip the contents of the archive

(same as above) to update/install/scripts/arch.sh. Re-zip the contents of the archive

[hf@venediger] /var/tmp # zip -r tar.cmp install_matlab update

[hf@venediger] /var/tmp # zip -r tar.cmp install_matlab update

adding: install_matlab (deflated 77%)

adding: install_matlab (deflated 77%)

adding: update/ (stored 0%)

adding: update/ (stored 0%)

adding: update/install/ (stored 0%)

adding: update/install/ (stored 0%)

adding: update/install/scripts/ (stored 0%)

adding: update/install/scripts/ (stored 0%)

adding: update/install/scripts/abort.sh (deflated 53%)

adding: update/install/scripts/abort.sh (deflated 53%)

adding: update/install/scripts/actualp.sh (deflated 63%)

adding: update/install/scripts/actualp.sh (deflated 63%)

adding: update/install/scripts/arch.sh (deflated 69%)

adding: update/install/scripts/arch.sh (deflated 69%)

adding: update/install/scripts/batch1.sh (deflated 70%)

adding: update/install/scripts/batch1.sh (deflated 70%)

adding: update/install/scripts/batch4.sh (deflated 60%)

adding: update/install/scripts/batch4.sh (deflated 60%)

adding: update/install/scripts/bld_lbin.sh (deflated 75%)

adding: update/install/scripts/bld_lbin.sh (deflated 75%)

adding: update/install/scripts/bld_sbin.sh (deflated 80%)

adding: update/install/scripts/bld_sbin.sh (deflated 80%)

adding: update/install/scripts/center.sh (deflated 55%)

adding: update/install/scripts/center.sh (deflated 55%)

adding: update/install/scripts/cleanup.sh (deflated 42%)

adding: update/install/scripts/cleanup.sh (deflated 42%)

adding: update/install/scripts/clearsc.sh (deflated 41%)

adding: update/install/scripts/clearsc.sh (deflated 41%)

adding: update/install/scripts/cont.sh (deflated 53%)

adding: update/install/scripts/cont.sh (deflated 53%)

adding: update/install/scripts/echon.sh (deflated 39%)

adding: update/install/scripts/echon.sh (deflated 39%)

adding: update/install/scripts/fin.sh (deflated 78%)

adding: update/install/scripts/fin.sh (deflated 78%)

adding: update/install/scripts/genpathdef.sh (deflated 66%)

adding: update/install/scripts/genpathdef.sh (deflated 66%)

adding: update/install/scripts/intro_l.sh (deflated 80%)

adding: update/install/scripts/intro_l.sh (deflated 80%)

adding: update/install/scripts/intro_s.sh (deflated 85%)

adding: update/install/scripts/intro_s.sh (deflated 85%)

adding: update/install/scripts/lm.sh (deflated 81%)

adding: update/install/scripts/lm.sh (deflated 81%)

adding: update/install/scripts/local.sh (deflated 78%)

adding: update/install/scripts/local.sh (deflated 78%)

adding: update/install/scripts/main.sh (deflated 68%)

adding: update/install/scripts/main.sh (deflated 68%)

adding: update/install/scripts/mapname.sh (deflated 54%)

adding: update/install/scripts/mapname.sh (deflated 54%)

adding: update/install/scripts/netruser.sh (deflated 62%)

adding: update/install/scripts/netruser.sh (deflated 62%)

adding: update/install/scripts/oldname.sh (deflated 53%)

adding: update/install/scripts/oldname.sh (deflated 53%)

adding: update/install/scripts/options.sh (deflated 72%)

adding: update/install/scripts/options.sh (deflated 72%)

adding: update/install/scripts/perm.sh (deflated 74%)

adding: update/install/scripts/perm.sh (deflated 74%)

adding: update/install/scripts/ruser.sh (deflated 82%)

adding: update/install/scripts/ruser.sh (deflated 82%)

adding: update/install/scripts/searchp.sh (deflated 47%)

adding: update/install/scripts/searchp.sh (deflated 47%)

adding: update/install/scripts/ucleanpe.sh (deflated 63%)

adding: update/install/scripts/ucleanpe.sh (deflated 63%)

adding: update/install/scripts/update.sh (deflated 70%)

adding: update/install/scripts/update.sh (deflated 70%)

adding: update/install/scripts/util.sh (deflated 70%)

adding: update/install/scripts/util.sh (deflated 70%)

adding: update/install/scripts/verifyp.sh (deflated 78%)

adding: update/install/scripts/verifyp.sh (deflated 78%)

to the same name. Copy to CD1, CD2 and CD3. Rinse and repeat.

to the same name. Copy to CD1, CD2 and CD3. Rinse and repeat.

* And that's about it. Provide a proper license.dat, and you are ready for installation. chdir to the installation directory, call the /path/to/install script from CD1, and click OK a few times.

* And that's about it. Provide a proper license.dat, and you are ready for installation. chdir to the installation directory, call the /path/to/install script from CD1, and click OK a few times.

At the end of the installation, there is a spurious rm -f with empty argument that can safely be ignored. If you find out where it hides, please tell me.

At the end of the installation, there is a spurious rm -f with empty argument that can safely be ignored. If you find out where it hides, please tell me.

* OK, there's still the license manager...

* OK, there's still the license manager...

FlexLM comes with a byzantine set of shell script tools. Of course, there is one more arch.sh to patch, this time under {MATLABHOME}/etc/util/arch.sh. Then create /usr/tmp, preferably as a symlink to /var/tmp, because FlexLM and the MLM backend have that hard-coded for logs, locks, preferences. Make sure you have got a proper license file in place - the procedure is well-documented. After that, you can either start the flexlm daemon from /etc/rc.local by using {MATLABHOME}/etc/rc.lm.glnx86 start|stop, or with the following rc.d script :

FlexLM comes with a byzantine set of shell script tools. Of course, there is one more arch.sh to patch, this time under {MATLABHOME}/etc/util/arch.sh. Then create /usr/tmp, preferably as a symlink to /var/tmp, because FlexLM and the MLM backend have that hard-coded for logs, locks, preferences. Make sure you have got a proper license file in place - the procedure is well-documented. After that, you can either start the flexlm daemon from /etc/rc.local by using {MATLABHOME}/etc/rc.lm.glnx86 start|stop, or with the following rc.d script :

#!/bin/sh

#!/bin/sh

#

#

# $Id$

# $Id$

#

#

# PROVIDE: flexlm

# PROVIDE: flexlm

# REQUIRE: DAEMON

# REQUIRE: DAEMON

. /etc/rc.subr

. /etc/rc.subr

name="flexlm"

name="flexlm"

rcvar=$name

rcvar=$name

flexlm_user="flexlm"

flexlm_user="flexlm"

matlabroot="/path/to/matlabr14"

matlabroot="/path/to/matlabr14"

lm_license="${matlabroot}/etc/license.dat"

lm_license="${matlabroot}/etc/license.dat"

required_files="${lm_license}"

required_files="${lm_license}"

command="${matlabroot}/etc/glnx86/lmgrd"

command="${matlabroot}/etc/glnx86/lmgrd"

command_args="-c ${lm_license} -2 -p -l +/var/log/flexlmlog"

command_args="-c ${lm_license} -2 -p -l +/var/log/flexlmlog"

load_rc_config $name

load_rc_config $name

run_rc_command "$1"

run_rc_command "$1"

-- you need to create a user to run flexlm as, and own the logfile to him.

-- you need to create a user to run flexlm as, and own the logfile to him.

# Other patches

# Other patches

# arch.sh

# arch.sh

For whatever reason there may be, a Matlab 14 installation has three instances of the arch.sh script that works out what platform Matlab is running on:

For whatever reason there may be, a Matlab 14 installation has three instances of the arch.sh script that works out what platform Matlab is running on:

> find . -name arch.sh -print

> find . -name arch.sh -print

./bin/util/arch.sh

./bin/util/arch.sh

./etc/util/arch.sh

./etc/util/arch.sh

./update/install/scripts/arch.sh

./update/install/scripts/arch.sh

And (of course) the one that is sourced by {MATLABROOT}/bin/matlab is the original version which you should replace by e.g. {MATLABROOT}/etc/util/arch.sh once you get tired of adding -glnx86 to every matlab invocation.

And (of course) the one that is sourced by {MATLABROOT}/bin/matlab is the original version which you should replace by e.g. {MATLABROOT}/etc/util/arch.sh once you get tired of adding -glnx86 to every matlab invocation.

# MEX

# MEX

If you want to build binary modules with mex you need to make sure those modules (libraries) are linux libraries since you cannot use native NetBSD libraries with a program running in emulation. Make sure you install the suse_devel package as listed above, and apply this patch to {MATLABROOT}/toolbox/matlab/general/mex.m. It makes sure the mex shell-script (which calls the compiler) is executed by the linux shell.

If you want to build binary modules with mex you need to make sure those modules (libraries) are linux libraries since you cannot use native NetBSD libraries with a program running in emulation. Make sure you install the suse_devel package as listed above, and apply this patch to {MATLABROOT}/toolbox/matlab/general/mex.m. It makes sure the mex shell-script (which calls the compiler) is executed by the linux shell.

[NetBSD ELF](http://www.netbsd.org/Documentation/elf.html) binaries do not normally use LD_LIBRARY_PATH; instead, NetBSD compiles fixed library paths into shared libraries and applications. Nevertheless, non-setuid NetBSD binaries still look at LD_LIBRARY_PATH. The above path apparently confuses complex NetBSD binaries like NEdit, XEmacs, Mozilla, which try to pick up Linux libraries instead of the native ones. As a workaround, unset LD_LIBRARY_PATH before calling the application, either with per-application wrapper scripts, or a generic wrapper script like

[NetBSD ELF](http://www.netbsd.org/Documentation/elf.html) binaries do not normally use LD_LIBRARY_PATH; instead, NetBSD compiles fixed library paths into shared libraries and applications. Nevertheless, non-setuid NetBSD binaries still look at LD_LIBRARY_PATH. The above path apparently confuses complex NetBSD binaries like NEdit, XEmacs, Mozilla, which try to pick up Linux libraries instead of the native ones. As a workaround, unset LD_LIBRARY_PATH before calling the application, either with per-application wrapper scripts, or a generic wrapper script like

The patch avoids the panic; what functionality exactly is missing remains to be seen.

The patch avoids the panic; what functionality exactly is missing remains to be seen.

_Workaround_: The Matlab command opengl software enforces software rendering which is slower than using hardware support - but appears to work, unlike the latter. You still need the kernel patch, though, as any OpenGL operation will panic otherwise.

_Workaround_: The Matlab command opengl software enforces software rendering which is slower than using hardware support - but appears to work, unlike the latter. You still need the kernel patch, though, as any OpenGL operation will panic otherwise.

# Issues left

# Issues left

Why Mathworks duplicate their set of install scripts everywhere and still keep a zipped copy around to drop on top of the installation is beyond me. The diffs above are clean and minimal - it's just that you have to have five instances of each.

Why Mathworks duplicate their set of install scripts everywhere and still keep a zipped copy around to drop on top of the installation is beyond me. The diffs above are clean and minimal - it's just that you have to have five instances of each.