How to include compiler diagnostic warnings in mex fortran files?

1 次查看(过去 30 天)

My problem is the following:
I use an old fortran code for numerical integration, which is called through a computational routine of a mex Function.
I have tested the fortran code externally, using a main fortran file, via Visual Studio. Because the code is old, the only way that I can compile and run it successfully is if I enable /warn:[no]interfaces option of the ifort compiler.
Now, I am trying to "attach" this fortran code to a mexFunction. The getaway function works fine and the standard mex compilation is successfull. But, when I run the mex64 output function, MATLAB craches unexpectedly. Thus, I think that I somehow need to incorporate the /warn:[no]interfaces flag in standard mex compilation. I tried using COMPFLAGS='$COMPFLAGS /warn:[no]interfaces' but there was no such option.
I would appreciate any suggestions. Thanks in advance

  6 个评论
dpb
dpb 2023-9-21
编辑:dpb 2023-9-21
Add the `/warn:[no]interfaces` flag to the `CXXFLAGS` variable. The modified line should look something like this:
CXXFLAGS="$CXXFLAGS -warn:[no]interfaces"
No. The line should be
CXXFLAGS="$CXXFLAGS -warn:nointerfaces"
The [] simply indicate an optional state; they are not part of the switch value.
However, <the Intel doc says> that 'nointerfaces' is the default state anyways...
dpb
dpb 2023-9-21
OBTW, @James Tursa is the Fortran mex guru; post your Fortran code calling sequence including enough to tell what are all data types and your gateway routine; odds are good that he would take a look at it and find any problems there.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fortran with MATLAB 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by