How to include compiler diagnostic warnings in mex fortran files?

3 vues (au cours des 30 derniers jours)
Dimitrios Patsatzis
Dimitrios Patsatzis le 10 Mai 2023
Commenté : dpb le 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 commentaires
dpb
dpb le 21 Sep 2023
Modifié(e) : dpb le 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 le 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Fortran with MATLAB dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by