Why do I get an assertion violation when I port my 32-bit FORTRAN MEX source to a 64-bit MATLAB 7.6 (R2008a) ?

4 views (last 30 days)
I have an existing FORTRAN MEX source code which compiles and works fine on a 32-bit MATLAB. This source also compiles fine on 64-bit MATLAB, but it fails when I try to run it.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
Some legacy FORTRAN code use the following syntax to define the MEXFUNCTION:
SUBROUTINEMEXFUNCTION(NLHS, PLHS, NRHS, PRHS)
INTEGERPLHS(*), PRHS(*)
INTEGERNLHS, NRHS
This might compile and execute on a 32-bit platform, however, the recommended syntax is to use MWPOINTER as shown below (for any platform).
This is essential for the MEX file to execute successfully on a 64-bit platform.
SUBROUTINEMEXFUNCTION(NLHS, PLHS, NRHS, PRHS)
MWPOINTERPLHS(*), PRHS(*)
INTEGERNLHS, NRHS

More Answers (0)

Tags

下载188bet金宝搏


Release

R2008a

Community Treasure Hunt

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

Start Hunting!

Translated by