MATLAB icon indicating copy to clipboard operation
MATLAB copied to clipboard

mex_FORTRAN_win64.xml

Open JohnnySG opened this issue 9 years ago • 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

JohnnySG avatar Oct 30 '15 09:10 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.

chappjc avatar Oct 31 '15 03:10 chappjc

For my own reference if I decide to tackle this, some resources:

http://geco.mines.edu/guide/ifort.html https://gcc.gnu.org/onlinedocs/gfortran/Option-Summary.html https://software.intel.com/sites/default/files/m/f/8/5/8/0/6366-ifort.txt http://www.clawpack.org/doc/fortran_compilers.html https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/269060

chappjc avatar Nov 02 '15 18:11 chappjc