Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Weird behavior in IVF 11.0 Beta

WSinc
New Contributor I
606 Views

This has to do with the interface between modules within a project.

I had a module that started off as a SUBROUTINE, then I decided to change everything (including all the calls to it) as a FUNCTION.

I then started getting messages to the effect that I was invoking a subroutine as a function. In other words, it did not recognize that I had changed the subroutine to a function, even though everything was recompiled.

So I then tried a CLEAN, then rebuilt the project, but kept getting the same messages.

Also restarting IVF did not resolve the problem.

After several hours I finally had to give up and put everything back the way it was....

Is the comparison between subroutine/function interfaces done at COMPILE time or at LINK time? It seems to make more sense to do it at LINK time.

Has this been documented and/or discussed before?

0 Kudos
3 Replies
Steven_L_Intel1
Employee
606 Views

The checking you're talking about is the generated interface checking and is done at compile time. There is no process by which this could be done at link time unless one were to adopt C++ name mangling.

I am astonished that a Build > Clean did not solve the problem as the issue is that the generated modules may not get rebuilt before they are looked at if you simply do a build. A Clean should delete all the generated .mod files and solve the problem.

I will comment that if you had created your own explicit interfaces, by putting the routines in a module for example, you would not see this problem and you'd have better code.

0 Kudos
WSinc
New Contributor I
606 Views

The checking you're talking about is the generated interface checking and is done at compile time. There is no process by which this could be done at link time unless one were to adopt C++ name mangling.

I am astonished that a Build > Clean did not solve the problem as the issue is that the generated modules may not get rebuilt before they are looked at if you simply do a build. A Clean should delete all the generated .mod files and solve the problem.

I will comment that if you had created your own explicit interfaces, by putting the routines in a module for example, you would not see this problem and you'd have better code.

Well, I surmise that there must be some residual info about the interfaces that does not get purged when I do the CLEAN. Maybe by taking some extra steps in ADDITION to that would resolve the problem. Are there files I could simply DELETE AFTER I do the clean, that would have the effect of starting over? Maybe a post-build or pre-build step, for example?

I'm willing to try the MODULE idea, if you have any expository articles you can refer me to. The stuff in the downloaded docs doesn't really cover this issue that well, i.e. explaining th basic concepts..

0 Kudos
Steven_L_Intel1
Employee
606 Views

Any book on Fortran 90 or later would be good. There are a number of them.

If you delete all the __GENMOD.* files (11.0 filenames) in the Debug/Release folder, this should take care of it. That's the ONLY place this information is stored.

0 Kudos
Reply