MWRAP(1)

πŸ“¦
version 1.3.5 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– MWRAP πŸ’–

okay bestie, welcome to the mwrap manual page β€” this is the MWRAP manpage, and yes it's a whole moment. sit down, hydrate, let's go 🫢


✨ NAME ✨

mwrap β€” it's an Octave/MATLAB mex generator, no cap πŸ’…


🌸 SYNOPSIS 🌸

mwrap [-mex outputmex] [-m output.m] [-c outputmex.c] [-mb] [-list]
      [-catch] [-i8] [-c99complex] [-cppcomplex] [-gpu] infile1 infile2
      ...

like, that's the whole vibe. flags first, then as many input files as your heart desires πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so mwrap is an interface generation system, and it lives in the same spirit as SWIG or matwrap β€” iykyk. you hand it a set of augmented Octave/MATLAB script files, and it will generate a MEX gateway to the C/C++ function calls you want, plus .m function files to access that gateway. iconic behaviour honestly.

and here's the part that truly slays: the details of converting to and from Octave's or MATLAB's data structures, and of allocating and freeing temporary storage, are hidden from the user. not you doing that. never you. you're welcome bestie 😭✨


πŸ‘‘ OPTIONS πŸ‘‘

  • -mex β€” this one specifies the name of the MEX function that the generated functions will call. and ngl, this name will generally be the same as the prefix for the C/C++ output file name. keep them matching, it's giving coordinated πŸ’…
  • -m β€” specifies the name of the Octave/MATLAB script to be generated.
  • -c β€” specifies the name of the C MEX file to be generated. heads up though: the MEX file may contain stubs corresponding to several different generated files. multitasking queen.
  • -mb β€” this one redirects Octave/MATLAB function output to files named in the input. in this mode, the processor will change Octave/MATLAB function output files whenever it encounters a line beginning with @. and the rules are, okay, listen:
    • if @ occurs alone on a line, the output will be turned off.
    • if the line begins with @function, the line will be treated as the first line of a function, and the m-file name will be deduced from the function name πŸŽ€
    • otherwise, the characters after @ (up to the next set of white space) will be treated as a filename, and mwrap will try to write to that file. periodt.
  • -list β€” prints to the standard output the names of all files that would be generated from redirect output by the -mb flag. a little sneak peek, we love a preview πŸ“
  • -catch β€” surrounds library calls in try/catch blocks in order to intercept C++ exceptions. safety first babes πŸ›Ÿ
  • -i8 β€” converts int, long, uint, ulong types to int64_t, uint64_t. this provides a convenient way to interface with -fdefault-integer-8 and -i8 flags used by Fortran compilers 🧚
  • -c99complex β€” uses the C99 complex floating point types as the default dcomplex and fcomplex types.
  • -cppcomplex β€” uses the C++ complex floating point types as the default dcomplex and fcomplex types.
  • -gpu β€” adds support code for MATLAB gpuArray. we're going to the GPU, bestie πŸ”₯

πŸ’œ AUTHORS πŸ’œ

mwrap is written by David Bindel and Zydrunas Gimbutas β€” legends, honestly πŸ‘‘. and this manual page was written by Nicolas Bourdaud. thank you for your service 🫢


and that's the whole page bestie!! this one's mwrap, version 2012, from the MWRAP(1) era β€” a vintage moment, we love to see it. go generate some gateways, you absolute icon πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from