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

compilation order problem

mattsdad
Beginner
501 Views

I have a Visual Studio Project that contains a module XXwhich includes several files each with some long subroutines. Those subroutines use other modules YY and ZZ in the same project. If I do a clean and then do a build, the build fails because the XX module is compiled before the YY and ZZ modules. (There are some variable names that appear in both YY and ZZ, so they cannot both be referenced by a USE clause in XX.)

Is there a way to tell the project to compile YY and ZZ first?

0 Kudos
4 Replies
Les_Neilson
Valued Contributor II
501 Views
Quoting - mattsdad

I have a Visual Studio Project that contains a module XXwhich includes several files each with some long subroutines. Those subroutines use other modules YY and ZZ in the same project. If I do a clean and then do a build, the build fails because the XX module is compiled before the YY and ZZ modules. (There are some variable names that appear in both YY and ZZ, so they cannot both be referenced by a USE clause in XX.)

Is there a way to tell the project to compile YY and ZZ first?

Yes if you put them in seperate projects within the one solution.
Then in the IDE Solution Explorer highlight the solution. Click Project->Project Build Orderand a dialog box shows with tabs Build Order and Dependencies. This is where you tell it to build Project YY then Project ZZ then Project XX
And in Dependencies you tell it that Project XX depends on YYand ZZ

Les

0 Kudos
Paul_Curtis
Valued Contributor I
501 Views
Quoting - mattsdad

... If I do a clean and then do a build, the build fails ...

Yes, this is the continuing non-operation of the Dependency Checker, an issue which has been raised numerous times in this forum, and we are assured each time that it actually works well.

I have found, almost by accident, that IVF does produce an automatic rebuild-all of my project (many modules, highly complex interdependencies) in debug mode, whereas the release mode clean build always fails.

A previous poster on this issue suggested that IVF might incorporate a user-supplied build order for multi-module projects, so that Rebuild-All could follow a script rather than try (and fail) to figure it out automatically. This would probably be a lot easier to implement than fixing the dependency checker, and would totally solve this problem. (Note- this is completely different from the above suggestion to game the system by putting each module in its own project whose dependencies can be explicitly specified.)

0 Kudos
mattsdad
Beginner
501 Views
Quoting - paul-curtis

Yes, this is the continuing non-operation of the Dependency Checker, an issue which has been raised numerous times in this forum, and we are assured each time that it actually works well.

I have found, almost by accident, that IVF does produce an automatic rebuild-all of my project (many modules, highly complex interdependencies) in debug mode, whereas the release mode clean build always fails.

A previous poster on this issue suggested that IVF might incorporate a user-supplied build order for multi-module projects, so that Rebuild-All could follow a script rather than try (and fail) to figure it out automatically. This would probably be a lot easier to implement than fixing the dependency checker, and would totally solve this problem. (Note- this is completely different from the above suggestion to game the system by putting each module in its own project whose dependencies can be explicitly specified.)

I did fix the problem byputting USE YY, ONLY: var_YY and USE ZZ, ONLY: var_ZZ into module XX . (var_YY and var_ZZ are each only in their respective modules.) That forced the right compilation order without IVF needing to descend into the INCLUDEs to resolve the order.

0 Kudos
jimdempseyatthecove
Honored Contributor III
501 Views
Quoting - mattsdad

I did fix the problem byputting USE YY, ONLY: var_YY and USE ZZ, ONLY: var_ZZ into module XX . (var_YY and var_ZZ are each only in their respective modules.) That forced the right compilation order without IVF needing to descend into the INCLUDEs to resolve the order.

Hmm ONLY: xxx exits the dependency checking once xxx is resolved. Didn't know that. Nice to know.

Jim Dempsey

0 Kudos
Reply