- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
recently i suffer the problem of rebuilding everything even when i do nothing with my code
i find the interface is one of reasons, an example like this
module inter !interface itf ! module procedure:: op !end interface contains subroutine op end subroutine op end module inter program main end program main
if without the interface, clicking <build solution> throws the message 'up to date'
but once the module has an interface, visual studio always rebuild the file when i click <build solution>
is there any way avoiding this situation?
it takes me too much time when debugging my project!
i use psxe2017 updta2 and vs2015
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this with your source. A workaround is to remove the "module" keyword from "module procedure" (it is optional in this context.) Looks like a bug in the build system's dependency analyzer.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this with your source. A workaround is to remove the "module" keyword from "module procedure" (it is optional in this context.) Looks like a bug in the build system's dependency analyzer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this with your source. A workaround is to remove the "module" keyword from "module procedure" (it is optional in this context.) Looks like a bug in the build system's dependency analyzer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) wrote:thanks for your suggestion, it works in this context
I can reproduce this with your source. A workaround is to remove the "module" keyword from "module procedure" (it is optional in this context.) Looks like a bug in the build system's dependency analyzer.
but the rebuilding still exists in my project after modification.
i can't find another reason for now
if i find it, i will let you know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also can reproduce this and reported it to Development. I informed them the work around Steve found is only helpful within the small reproducer context and requested help with finding any other possible work around. If you wan to post another reproducer for which the work around is not helpful I will gladly pass that along to Development too. Thank you for the convenient reproducer also.
(Internal tracking id: DPD200419360)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin D (Intel) wrote:
I also can reproduce this and reported it to Development. I informed them the work around Steve found is only helpful within the small reproducer context and requested help with finding any other possible work around. If you wan to post another reproducer for which the work around is not helpful I will gladly pass that along to Development too. Thank you for the convenient reproducer also.
(Internal tracking id: DPD200419360)
when i restart vs, the rebuild disappear
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) wrote:
I can reproduce this with your source. A workaround is to remove the "module" keyword from "module procedure" (it is optional in this context.) Looks like a bug in the build system's dependency analyzer.
when i restart vs, the rebuild disappear
and i want know what's the difference between the <module procedure> and <procedure>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In a module, contained subroutines and functions do not require an interface.
In your example case, your "interface" is simply a redeclaration for a subroutine. In your actual program, you may have multiple different subroutines (i.e. as for generic interface), or you simply wish to rename the interface.
Try placing into a separate module (and compilation unit) and use the only and => to remap the names. You may also need to specify a dependency in the solution such that the contains module is built first. IOW this may require your solution to have (at least) 3 projects:
1) contains module project (also holding general data)
2) interface module project (dependent upon the contains module)
3) application project (dependent on interface module project)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Fortran 90, the "module" keyword was required when declaring a module procedure for a generic interface. Fortran 2003 made that keyword optional. There is no difference here.
The "module" keyword is required if you are declaring an interface for a separate module procedure that is supplied in a submodule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Ret.) wrote:got it! thanks!
In Fortran 90, the "module" keyword was required when declaring a module procedure for a generic interface. Fortran 2003 made that keyword optional. There is no difference here.
The "module" keyword is required if you are declaring an interface for a separate module procedure that is supplied in a submodule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jimdempseyatthecove wrote:the description of my title is not accurate
In a module, contained subroutines and functions do not require an interface.
In your example case, your "interface" is simply a redeclaration for a subroutine. In your actual program, you may have multiple different subroutines (i.e. as for generic interface), or you simply wish to rename the interface.
Try placing into a separate module (and compilation unit) and use the only and => to remap the names. You may also need to specify a dependency in the solution such that the contains module is built first. IOW this may require your solution to have (at least) 3 projects:
1) contains module project (also holding general data)
2) interface module project (dependent upon the contains module)
3) application project (dependent on interface module project)Jim Dempsey
it's not the interface leading to build problem, but the difference of <module procedure> and <procedure>
still thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Run a simple experiment:
a) Edit the contains section (this can be as simple as adding a comment)
b) Build
Next, click on Build again. If it rebuilds, then the work around I offered in #8 will prevent the unnecessary build. The suggestion I made was to break the circular dependency (that should not have been there).
If the rebuild did not occur then the removal of the optional "module" keyword is all you have to do (for now).
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page