DEBIAN-MATLAB-MEXHELPER(1)
π DEBIAN-MATLAB-MEXHELPER π
okay bestie, welcome to the debian-matlab-mexhelper manual page β it lives in the User Commands corner of the Debian man-verse and honestly? she's a little legend. sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
debian-matlab-mexhelper β the lil helper that builds Matlab extensions on Debian π«Ά
π¦ SYNOPSIS π¦
debian-matlab-mexhelper [OPTIONS] <package name> <mode>
πΈ DESCRIPTION πΈ
so basically π this is a small helper that makes building and installing MEX extensions for Matlab toolbox packages in Debian binary packages so much easier. and why do we even need her? because β for obvious reasons β these packages literally can't build-depend on Matlab. so instead they have to compile their extensions at installation time, using whatever local Matlab installation is vibing on the machine. it's giving resourceful. π
the helper is kinda flexible like that: she supports custom build, install and clean commands, plus custom source and destination directories. she also deals with moving extensions into library directories and automatically symlinks them into the toolbox directory. no cap. β¨
there are two major modes:
installβ build, install and symlink extensions. super useful inpostinst. π οΈcleanβ remove installed extensions and symlinks. super useful inprerm. π§Ή
the command that builds the extensions gets invoked in the source directory. by default that's /usr/src/matlab/<package name>, but you can override it with the --src-dir option. and any optional install (--install-cmd) and clean (--clean-cmd) commands? yeah, those get invoked in the source directory too. π«
moreover β and this is the iconic part β this helper will also take any installed extensions from a default installation path /usr/share/matlab/site/m/<package name>, move them into /usr/lib/matlab/site/<package name>, and then symlink back to the original location. those locations can be configured with the --m-dir and --mex-dir options respectively. again, this step is optional and only happens if a package actually installs extensions into this location. so if your package doesn't, don't stress, she just skips it. π
π OPTIONS π
one bullet per flag, bestie, let's go:
-hβ print usage summary and option list. the quick lil "hey what do you do" β¨--helpβ print full help. the whole story, no skimping. π--versionβ print version information and exit. iykyk. π--build-cmdβ command to build the extensions in the source directory. π¨--install-cmdβ command to install the extensions after building. π¦--clean-cmdβ command to clean the source tree after installation. > heads up: this is NOT the command that gets executed incleanmode, bestie. don't get it twisted. π--src-dirβ directory with the extension sources. this is also the directory in which build, install and clean commands get invoked. ποΈ--mex-dirβ target directory into which binary extensions get moved. π--m-dirβ target directory in which symlinks to binary extensions get created. π--makeβ set default commands forbuild-cmd(make),install-cmd(make install DESTDIR=$m_dir) andclean-cmd(make distclean) if no specific command has been provided via the respective options. π
π₯ EXAMPLES π₯
the "point me at my sources" era
the following call can be used in a package's postinst script if it comes with a Matlab script build_matlab.m that builds and installs its extension into the desired locations. the --src-dir option is used to point to a non-standard location of the extension sources. β¨
debian-matlab-mexhelper somepackagename install --src-dir /usr/src/dynare-matlab/mex/sources --build-cmd 'matlab -nodesktop -nodisplay -nojvm -r build_matlab'
the "makefile girlies" era
if a package installs extension sources into the standard location and builds its extensions using a Makefile that supports the DESTDIR for installing the built extensions and a distclean target, it is sufficient to run the following. π«Ά
debian-matlab-mexhelper somepackagename install --make
the "difficultpackage" era
otherwise it is also possible to fully customize all the commands. π€
debian-matlab-mexhelper difficultpackage install --build-cmd 'make -C src all toolbox MEXBIN="matlab-mex"' --install-cmd 'make -C src install && find . ! -wholename "./src" -name "*.mex?*" -print0 | xargs -0 -I {} cp -v --parent {} /usr/share/difficultpackage' --clean-cmd 'make -C src distclean toolbox-distclean && find . -name "*.mex?*" -delete'
the "okay actually remove it" era
if a package uses debian-matlab-mexhelper to install extensions into the standard location, it can also be used to remove all MEX extensions and created symlinks when a package is removed from a system. to achieve this, simply put the following call into a package's prerm script. π§Ή
debian-matlab-mexhelper packagename clean
π AUTHOR π
written by Michael Hanke. π (yes, an actual icon.)
π COPYRIGHT π
copyright Β© 2010-2011 Michael Hanke <michael.hanke@gmail.com> π
licensed under GNU General Public License version 3 or later.
this is free software; see the source for copying conditions. there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. π«
and that's the whole page, bestie β debian-matlab-mexhelper version 0.0.21.1, dated April 2026, straight from the Debian User Commands section. go build those extensions, you absolute main character. πβ¨ππ¦πΈπ
π¦ where this page comes from
- ubuntu resolute: matlab-support 0.4 Β· GPL-3.0-or-later
- ubuntu stonking: matlab-support 0.4 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms