I have an extensive set of Mex functions which I use in Linux and Windows. The build environment uses GNU Make file which are run from a shell command line (In Windows I use Cygwin as my shell). The build process involves compilation into object files, packing object files into static libraries and linking objects and libraries into Mex executables. I use arguments to the make file to control the type of build (debugging or optimized, with or without GPU, etc.), where for each build configuration the objects, library and executable files are place in separate directories.
I recently installed Matlab version R2016a and I would like to try to build my Mex software with the MinGW compiler. Before I start making the changes, I would like to check a few issues, regarding using the Mex/MinGW compiler on Windows:
1. Do object files created using the MinGW compiler have the extension of '.obj' or '.o'?
2. Which tool should I use to create static libraries of MinGW-generated objects? I have used the 'lib' program that comes with Microsoft Visual C++ when working with that compiler, but I am not sure that it will work correctly with MinGW. I have the 'ar' program which comes with Cygwin, and I wonder if MinGW comes with its own librarian program.
3. What is the file extension of Mex executables created with MinGW? Is it the same as for executable created with Visual C/C++/?
4. According to the documentation (<http://cens.ioc.ee/local/man/matlab/techdoc/apiref/themexscript.html)>: "On Windows, the options file is written in the Perl script language. The options file, mexopts.bat, is searched for in the following directories: the current directory first, then the same directory as mex.bat." I searched could not find any mexopts.bat in my Matlab file tree. Where can I find a default options file?
5. Is it possible to specify which compiler to use (Visual C/C++ or MinGW) in the mexopts.bat file? Which Perl statements should I use for that?
Thank you very much,