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

How to compile with a module chain?

bendel_boy_2007
Beginner
402 Views

Having added an interface assignment, I have had to modify my code as

module type
use type_declares
interface assignment(=)
...
end module

module type_declares
... various definitions ...
end module

When I come to compile I get an error message that type_declares could not be opened.

If I compile type_declares, then type, this is reported as two succesful compiles.

If I load the project inside Compaq Visual Fortran 6.1A then this compiles.

But using the IDE/Intel Fortran 9.1, I get this failure. The error message is

D:CodeTechneauCoreTypes.f90(2): Error: Error in opening the Library module file. [TYPE_DECLARES]

Is there any work-around to this problem?

0 Kudos
4 Replies
Steven_L_Intel1
Employee
402 Views

The Fortran language requires that a module be "available" before it is referenced. The best solution is to put each module in its own source file. Failing that, move TYPE_DECLARES to the top of the source so that it is compiled first.

I think you misunderstood something if you thought CVF 6.1 did this any differently.

0 Kudos
bendel_boy_2007
Beginner
402 Views

Steve,

The modules *are* in separate files.

And DVF does compile them with no error message, while IVF does not. I'm using both within their respective Visual Studio IDEs.

The problem appears to be that I was using 'Build solution' rather than 'Build [project name]' - when I use 'Build [project name]' then I get the same behaviour as with DVF. I had thought that for a solution that contained a single project there would be no difference.

On a side note, I can post to this forum if I use Microsoft Internet Explorer, but when I try to use Firefox Firefox freezes, and has to be killed using the Task Manager. Are there any plans to make this web forum work with non-Microsoft solutions?

0 Kudos
Les_Neilson
Valued Contributor II
402 Views

In VS2005 :

(a) Look at Project Properties Configuration Manager - ensure that the build box is ticked on.

(2) Look at Project, Project Dependencies and ensure that the build order is correct (A depends on B and box for B is ticked on) for solutions containing two or more projects.

I have had a few problems converting VS2003 solutions and projects toVS2005 where these setting were not carried over correctly during the conversion.

Les

0 Kudos
Steven_L_Intel1
Employee
402 Views

It should work with Build Solution, unless something is misconfigured. I have seen this happen when there are two source files that build the same moduke.

As for the forum and Firefox - this is a bug I reported a while ago. A workaround is to wait until you get the warning about unresponsive script, click Continue and then press the space bar. Another is to use the IE Tab add-on to Firefox.

0 Kudos
Reply