MXE-MexIFace is a fork of MXE providing a mingw-w64 based GNU environment for
cross-compiling to Windows 64-bit targets. This fork tracks the mxe/master
branch, maintaining Matlab environment compatibility specifically for the MexIFace package.
Because of the Matlab MEX modules are dynamically loaded as shared libraries, they must be linked against an environment compatible with the closed-source Matlab and it's internal libraries. MexIFace targets support of Matlab R2106b+ which is possible using a gcc-4.9.4
toolchain.
- MexIFace documentation The principal package using this environment. Provides an object-oriented cross-platform C++/Matlab MEX interface and build environment.
- GCC standards support
gcc-4.9.4
gives full C++11 and partial C++14 support and can work with Matlab R2016b+ (9.1+)gcc-6.5.0
gives full C++14 and partial C++17 support and can work with Matlab R2018a+ (9.4+)
- Original MXE-README.md
- MXE Project
This environment is deigned to provide a library of open-source libraries compatible with Matlab's built-in environment when compiling Matlab MEX files for Matlab's win64
architecture.
- Matlab Win64 uses the following MXE toolchain options
Therefore, Matlab MEX files for win64
arch should use MXE
target toolchain notation:
MXE_TARGETS := x86_64-w64-mingw32.shared.posix.sjlj
The following packages are included by default in settings.mk
, which can easily be extended as needed.
- pthreads - Required for matlab MEX
- boost - Essential C++ component.
- armadillo - C++ array and linear-algebra library with BLAS/LAPACK integration
- zlib - Common dependency
- googletest - Google's unit test framework
Matlab includes internal BLAS and LAPACK libraries that are compiled with 64-bit integer indexing. These libraries are incompatible with the more common 32-bit integer indexed BLAS/LAPACK libraries such as the default MXE src/blas.mk
and src/lapack.mk
. To enable combined 32-bit and 64-bit support for BLAS and LAPACK, we provide the following MXE packages which are used in-place of standard blas
and lapack
:
- blas_lapack_reference - 32-bit integer BLAS/LAPACK using NetLib reference sources
- blas_lapack_reference_int64 - 64-bit integer reference BLAS/LAPACK NetLib reference sources
These packages modify the default pkg-config
files providing the following .pc
files at usr/x86_64-w64-mingw32.shared.posix.sjlj/lib/pkgconfig/
:
blas-reference.pc
- INT32 NetLib blasblas-reference-int64.pc
- INT64 NetLib BLASlapack-reference.pc
- INT32 NetLib Lapacklapack-reference-int64.pc
- INT64 NetLib Lapack
master
- Environment for Win64 gcc-4.9.x and later based Matlab systems. Suitable for R2016b+ (9.1+)gcc-6.5
- Environment for Win64 gcc-6.x and later based Matlab systems. Suitable for R2018a+ (9.4+).