How to compile mex files using gcc and makefiles

조회 수: 13 (최근 30일)
Bene Wilde
Bene Wilde 2016년 5월 2일
답변: Dave Behera 2016년 5월 3일
I want to compile C++ code to mex files with gcc using makefiles. Which options do I have to pass to the compiler for the compiled file to work with Matlab?
How do I choose between "-largeArrayDims" and "-compatibleArrayDims"?
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 5월 2일
The only reason to use compatibleArrayDims now is if you are stuck using a pretty old release or you are stuck having to interface a 32 bit program that you cannot update.

댓글을 달려면 로그인하십시오.

답변 (1개)

Dave Behera
Dave Behera 2016년 5월 3일
According to the documentation at
-compatibleArrayDims — Uses the MATLAB Version 7.2 array-handling API, which limits arrays to 2^31-1 elements. Default option. -largeArrayDims — Uses the MATLAB large-array-handling API. This API handles arrays with more than 2^31-1 elements. Must use this option when calling LAPACK or BLAS functions.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by