For Matlab I create a MEX-file wrapper. The compilation is all fine, I use either MSVC or MinGW as a compiler, and CMake for finding the Matlab installation and generating the build files.
On my local machine this works like a charm. I now want to be able to compile the MEX-file wrapper on my CI nodes. Preferably, I'd have a free version and rather slim version of Matlab to compile the MEX-file wrapper. Ideally, in a Windows Docker container.
Is the Matlab Compiler Runtime (MCR) sufficient to compile MEX-file wrappers? Or is there another way to compile mex files without using non-free Matlab software (free in the sense of free of charge, not as in free speech)?
Matlab Compiler does not compile MEX-files. mex
does that, and it relies on a C compiler to do so.
Matlab Runtime (which is free like coasters at a bar) will run software compiled by Matlab Compiler (which is not free in any sense of the word). The purpose of this is to deploy an application using the Matlab programming language that can be run by users without the need to own full blown Matlab. It's a bit like LabView and MaxMSP which have similar features.
If you wish to setup CI/CD with Matlab code that runs MEX-files, you can try GitHub Actions (also free like coasters at a bar). This is a collection of runners maintained and supported by the MathWorks for this very purpose. In my opinion, this is actually much easier to deal with than using Docker.