Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

How to FORCE compilation order?

WSinc
New Contributor I
983 Views
This is something about the features in VS 2010 or even earlier.

We sometimes need to have the subroutines or program units compile in a specific order,
for example if we make changes to a CALLED routine in the interface.

If we compile the CALLING routine first, it does not know about the inferface changes, so
we get error messages.

Ideally, we should be alerted if there is a different interface before the compilation is done.

Example: If program PROG1 calls subroutine SUB1, is there a way to force it to recompile SUB1
first?

Maybe there is also a way to SKIP OVER routines that are never invoked, rather than specifically having to
exclude them from the current project, like we do now. This might involve some knowledge of the
"calling tree" ahead of time.
0 Kudos
5 Replies
Steven_L_Intel1
Employee
983 Views
There is no way to do this. I recommend that if you change the interface to as routine, do a "rebuild" to clear old generated interface information.

I will also point out that if you used modules and not external procedures, you would not have this problem.
0 Kudos
WSinc
New Contributor I
983 Views
Compilation order is still an issue, even when using MODULES. the reason being
that I have to compile the MODULE first before any routines that USE it
can see the chenges.
I will do a rebuild though, as you suggested.
0 Kudos
Steven_L_Intel1
Employee
983 Views
Do you use :: in your USE statements? For example:

USE :: MYMOD

This is known to cause problems for the build dependency checker. I think this is fixed in Update 9, however.
0 Kudos
Arjen_Markus
Honored Contributor II
983 Views
Another way to do this is by creating separate projects and force the correct order by
setting the dependencies. That is:
- create projects containing modules that are mutually independent only
- source code in a project may depend on other modules in _other_ projects but not
on modules within the same project.

Regards,

Arjen
0 Kudos
WSinc
New Contributor I
983 Views
I will experiment with both suggestions -

But, a nice feature would be to have a "calling tree" that is
starting with one MAIN program, allow it to figure out the calling
order in a top down fashion.

As far as I know, you can't have a project with more than one MAIN program.

Otherwise it could give you a CHOICE as to which MAIN program to invoke at start of
execution.
0 Kudos
Reply