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

F90 module compile order

Intel_C_Intel
Employee
1,417 Views

I am just starting using IVF+Microsoft Visual Studio. I have a problem specifying compilation order of my *.f90 files in a project. Those files that contain modules should be compiles first. However in the Solution Explorer window the files are listed in the alphabetical order, which I cannot figure out how to change. As a result I have to compile each module file individually before executing Build, which is very annoying. Please, let me know how to specify compilation order to avoid this problem. Thanks in advance.

0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,417 Views
You don't have to change. The build system automatically builds the files in the correct order when you build the project. Are you not seeing this?. The order listed in the Solution Explorer is not relevant.
0 Kudos
ukhoray
Beginner
1,417 Views

Thanks Steve,

Ive noticed that in the Solution Explorer the order is different. It is not correct, however. Some modules have to be compiled prior to others, since the later use global variables defined in these modules. This is not happening. Modules are compiled in what it seems to be an alphabetical order. Is there any way to force a certain compilation order to avoid this problem? Thank you.

0 Kudos
Steven_L_Intel1
Employee
1,417 Views
If the compile order is not correct, then there's a bug. Please open an issue with Intel Premier Support and attach a ZIP of your project and its sources. The build system is supposed to automatically determine the proper compilation order taking modules into account, and I have not seen any recent cases where it did not do so. I'd very much like to see why it is not working in your case.

Please be sure to include the buildlog.txt from the Debug or Release folder that is created after a Rebuild so we can see what it did on your system.

The order as shown in Solution Explorer is simply alphabetical and does not reflect compile order.
0 Kudos
ukhoray
Beginner
1,417 Views

Tanks again Steve,

I actually found the problem and its solution by studying the Output more carefully. It seems that the compiler has a problem with the following construct:

use a; use b; use c,

which I use at all interfaces. When at the modules I switch to

use a

use b

use c

The problem goes away and the build system figures out the compilation order correctly.

0 Kudos
Steven_L_Intel1
Employee
1,417 Views
Ah, that's very interesting. I'll pass that on to the developers.
0 Kudos
Reply