Filter löschen
Filter löschen

How to include compiler diagnostic warnings in mex fortran files?

1 Ansicht (letzte 30 Tage)
Dimitrios Patsatzis
Dimitrios Patsatzis am 10 Mai 2023
Kommentiert: dpb am 21 Sep. 2023

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 Kommentare
dpb
dpb am 21 Sep. 2023
Bearbeitet: dpb am 21 Sep. 2023
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 am 21 Sep. 2023
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Fortran with MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by