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

Aren't the files compiled only if they are modified?

Mike896
Beginner
1,139 Views

Hi,

I have two static libraries (two projects) and one project is for main program.

One of the libraries is for numerical recipes and the other is created by myself.

I set my library dependent to library of numiercal recipes and then main project is dependent to my own library.

When I Build solution, I find some of the module files in my own library will be compiled, even though there are not modified.

Aren't the files compiled only if they are modified?

Thank you very much in advance.

ps. I use Intel Fortran 11.0.066 [IA-32]...

Mike

0 Kudos
11 Replies
garylscott1
Beginner
1,139 Views
Quoting - Mike896

Hi,

I have two static libraries (two projects) and one project is for main program.

One of the libraries is for numerical recipes and the other is created by myself.

I set my library dependent to library of numiercal recipes and then main project is dependent to my own library.

When I Build solution, I find some of the module files in my own library will be compiled, even though there are not modified.

Aren't the files compiled only if they are modified?

Thank you very much in advance.

ps. I use Intel Fortran 11.0.066 [IA-32]...

Mike


One thing to check...are you certain that the file time stamps are unchanged? It isn't a reliable indicator, but I only assume that's part of the criteria.

0 Kudos
bearoflittlebrain_ol
1,139 Views

Mike,

The symptoms that you complain of can, I think,becreated byby addingyour own individual library files to your project rather than linking with the compiled library. Is that the problem?

Bear of Little Brain

0 Kudos
Mike896
Beginner
1,139 Views
Quoting - garylscott


One thing to check...are you certain that the file time stamps are unchanged? It isn't a reliable indicator, but I only assume that's part of the criteria.

Do you mean the time of the file? The files aren't modified at all. I successively build solution multiple times with seconds without any modification.

Mike

0 Kudos
Mike896
Beginner
1,139 Views

Mike,

The symptoms that you complain of can, I think,becreated byby addingyour own individual library files to your project rather than linking with the compiled library. Is that the problem?

Bear of Little Brain

Is this a good idea? Aren't files to be used a lot (usually module files) built as a library project and easier to be managed? I really have a lot of modules. If I include them one by one, it would takes a lot of time. Hence I use project.

Mike

0 Kudos
bearoflittlebrain_ol
1,139 Views
Quoting - Mike896

Is this a good idea? Aren't files to be used a lot (usually module files) built as a library project and easier to be managed? I really have a lot of modules. If I include them one by one, it would takes a lot of time. Hence I use project.

Mike


Mike,

Iam not suggesting that it is a good idea, but that it displays your symptoms. If you have a lot of library modules, put them into a super module in the library, thenby using just the super module, you use all the individual modules.(Don't forget to include the library in the linking settings).

However, I suspect that we are probably talking at cross purposes because it is not easy to understand exactly how you are using the modules.

Regards

Bear

0 Kudos
Mike896
Beginner
1,139 Views


Mike,

Iam not suggesting that it is a good idea, but that it displays your symptoms. If you have a lot of library modules, put them into a super module in the library, thenby using just the super module, you use all the individual modules.(Don't forget to include the library in the linking settings).

However, I suspect that we are probably talking at cross purposes because it is not easy to understand exactly how you are using the modules.

Regards

Bear

I get this. It's called the cyclic dependency. I have this problem before by using CVF 6.6c. I also ask this problem in Google groups http://groups.google.com/group/comp.lang.fortran/browse_frm/thread/8377389c5c569e81?hl=en&tvc=1&q=cyclic+dependency

I have a problem like the following:

module modA
contains
subroutine suba()
use modT
print *,'suba'
end subroutine suba
end module modA
module modT
contains
subroutine subb()
use modA
print *,'subb'
end subroutine subb
end module modT

program main
use modA
use modT

call suba()
call subb()

stop
END

Do you get an error about the above problem?

I remember someone told that IVF will solve this problem at that time. However, I guess not.

Mike

0 Kudos
Steven_L_Intel1
Employee
1,139 Views

The real answer is "don't do that". Use a third module if needed to break the cycle. Otherwise you'll continue to have problems across many Fortran implementations.

0 Kudos
Paul_Curtis
Valued Contributor I
1,139 Views

The real answer is "don't do that". Use a third module if needed to break the cycle. Otherwise you'll continue to have problems across many Fortran implementations.

Oh no! That doesn't work, it only enlarges the scope of the circularity. In fact, IVF is superb at winkling out high-order circularities in very complex multimodule code. The only solution is to actually eliminate the circularity by restructuring the code within modules.

In a Win32 program it is sometimes possible to game this sort of thing by invoking a routine via a custom WM_ routed through the main message loop, instead of a direct call (but this is an empirical trick which fools the linker, is highly inefficient, and does not address the fundamental problem).

0 Kudos
Mike896
Beginner
1,139 Views

The real answer is "don't do that". Use a third module if needed to break the cycle. Otherwise you'll continue to have problems across many Fortran implementations.

Aren't the following messages misleading:

D:tempConsole2Source1.F90(3): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MODA]
1>D:tempConsole2Source1.F90(4): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MODT]

This is only a very simple example. I spent a lot of time to debug this in my real complex program.

Mike

0 Kudos
Steven_L_Intel1
Employee
1,137 Views

Misleading? How? The messages say that the compiler cannot find the .mod files for the referenced modules. Note that it is not the compiler doing the build dependency ordering but the VS integration and build system.

Regarding circular dependencies: I still say this is a bad thing to do and that a bit of planning can avoid it. While the build dependency analyzer in IVF does not throw up its hands the way the Microsoft one in CVF did when dependencies were more than three deep, the results may still be undesireable.

0 Kudos
Mike896
Beginner
1,137 Views

Misleading? How? The messages say that the compiler cannot find the .mod files for the referenced modules. Note that it is not the compiler doing the build dependency ordering but the VS integration and build system.

Regarding circular dependencies: I still say this is a bad thing to do and that a bit of planning can avoid it. While the build dependency analyzer in IVF does not throw up its hands the way the Microsoft one in CVF did when dependencies were more than three deep, the results may still be undesireable.

Maybe it is not misleading. It would be better that IDE takes take care or give better advice for that.

Mike

0 Kudos
Reply