Dependency problem

Dependency problem

Hi,

I am using Visual Studio 2010 Professional and Intel Fortran 13.0.1.119.

I have just come across a strange problem where the compiler is able to compile and link the program
that has a bug.

I have included a pdf file with screenshots of the steps I took, and a zip file with the sample code.

I am not sure if it the problem with Visual Studio, the Fortran compiler, or if I made a mistake
with my settings.

Roman

Fichier attachéTaille
Télécharger dependency-problem.pdf220.26 Ko
Télécharger ifc-test.zip3.45 Ko
6 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

I don't know whether it is by design, but what you are seeing is a symptom of the dependency analysis undertaken by the Fortran integration not spanning across projects - i.e. if you make a change in the interface to a procedure in a module in a child project (the lib), you need to manually rebuild the parent project (the exe). This has been the case for some years (perhaps since VS2010 or maybe ifort 12.0, perhaps forever and I just never noticed).

There is some justification for this to be by design, as in large solutions the compilation cascade caused by changing a module can be rather time consuming. If the change is in the executable part of a procedure rather than its interface.there is no change in the object code generated when downstream program units are compiled (in the absence of IPO, etc). The project boundary provides a reasonable compromise for the programmer to manually manage whether a rebuild is required, and I've certainly take advantage of it to reduce build times (particularly earlier this year when some updates of ifort 12.1 took almost a day, each, to do a debug build of a couple of my source files).

But yes, if you change the interface and don't rebuild, then all sorts of fun stuff starts happening.

Portrait de Paul Curtis

It has been my experience that it is much better to directly include libraries as project components, rather than put them in the dependencies list. However, this does not mean that library functions are checked for interface consistency at each compile,

Fichiers joints: 

Fichier attachéTaille
Télécharger dependencies.jpg6.75 Ko

Thanks for the replies.
I did some more experimenting, and I think I solved the problem if a put the path of the compiled library module files
into the main program's "Additional Include Directories" field. Have a look at the attached image.
I'm still not sure if this is a valid solution.

Fichiers joints: 

Fichier attachéTaille
Télécharger main-property.jpg50.25 Ko

That's an integration glitch if that is the case - dependencies that are Fortran projects automatically get added to that list in the background (have a look at the command line for the exe project and note the magic /Ixxx options).

Yes, you are correct, that include directory is already there on the command line.
What I just noticed is that if I include it again in the "Additional Include Directories" field,
the same /I option is repeated twice, and the bug always gets caught.
If I do not include it, the /I is still there (but only one time), and the bug is not caught.

Connectez-vous pour laisser un commentaire.