CMake and GNU Octave MEX examples of complied code.
Build:
cmake -B build
cmake --build build
Test:
ctest --test-dir build -V
These examples work on any operating system Octave supports.
On macOS, we have observed the need to use AppleClang with Homebrew-installed Octave.
If Octave was installed via Flatpak on Linux, it can be convenient to first open a sandboxed shell in the Octave Flatpak sandbox:
flatpak run --command=sh org.octave.Octave
The Windows default installation includes development libraries used in these examples. On Windows, use GCC MinGW / MSYS2 as Visual Studio is not compatible with the Octave libraries. Cygwin or WSL can also be used for Octave on Windows.