chappjc/MATLAB

mex_FORTRAN_win64.xml

Opened this issue · 2 comments

Dear chappjc,

Could you give me an example of xml configration file for mex, when compiling Fortran Source Code using gfortran? Thank you!

Best Wishes,
JohnnySG

Getting x86_64-w64-mingw32-gfortran to compile Fortran source is not difficult. The trick is getting it to link with the C shared libraries (libmx.dll, libmex.dll, libmat.dll). The way compilers export symbols are often very different and there is the added challenge of the C-Fortran difference. Intel Fortran has a Windows configuration (ifortran), so it's not impossible, but Intel designed their compiler to operate with Microsoft-generated libraries. So, the GNU Fortran outputs may be incompatible. It will probably take some experimentation with the gfortran switches.