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 on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29281 Discussions

Error in compiling/linking with a module

tom_c_lin
Beginner
913 Views

Good Morning Everyone,

I am trying to compile/link a FORTRAN program with a module and received the following error message:

fatal error LNK1106: invalid file or disk full: cannot seek to 0x3047

Can any of you help me to resolve this. Thanks. Here is what I am trying to do. I have a small program with two subroutines, which is working finewithIFC. Since the two subroutines can be applied/used by other programs, I decide to put them into anmodule. The followingwere what I did:

1. In .NET, select New Project, Intel Fortran, Console application and a name said DBmain.

2. Open DBmain.f90 and copy the source of the main program. Modify DBmain.f90 by adding 'use DBmodule' at the beginning of the program.

3. Add a new source file call DBmodule.f90 to DBmain Source files.

4. Open DBmodule.f90 and copy the two subroutine into the file. Modify the source by adding 'MODULE DBmodule' at the beginning of the program and 'END MODULE DBmodule' at the end.

5. In DBmain property page, add 'DBmodule.mod' inLinker:Input: additional dependencies.

6. Compile DBmodule.f90 to generate DBmodule.mod.

7. When I try to build DBmain.exe the error occurred.

What did I do wrong?Your assistance to resolve this is greatly appreciated. Thanks.

Tom Lin

0 Kudos
4 Replies
Steven_L_Intel1
Employee
913 Views
Undo step 5. .mod files are compiler inputs, not linker inputs. Just treat the module source as another Fotrran file and Visual Studio will know what to do with it. You don't have to compile the module source separately, just build the solution.
0 Kudos
tom_c_lin
Beginner
913 Views

Thanks Steve. It works. Have a great day.

Tom Lin

0 Kudos
tom_c_lin
Beginner
913 Views

Hi Steve, Thanks for your help. Maybe you can help me to unlock this mystery too. Currently we are moving our FORTRAN codes from UNIX to Window operating system. Some of our subroutines were developed in early sixties, which are old butreliable. Among them, there is oneroutine calling two subroutines (said subroutines A and B)to perform iterations/calculations. What I observed was very strange. If I insert a write statement between the two calls (before callingsubroutine B, but after calling A), theoutputs of the calculationare exactly the same as those from UNIX. But if I remove the write statment, the outputs changed. The difference is not a lot.But one would expect the twooutputs should be exactly the same. Any clue? initialization? common block alignment?or the waycompiler handling call? Thanks for your time.

Tom Lin

0 Kudos
Steven_L_Intel1
Employee
913 Views
Old? Perhaps. Reliable? Perhaps not. This symptom almost always indicates a coding error, such as running off the end of an array or a mismatch in argument data types. Anything that causes variables to be allocated at different addresses, such as the WRITE, can change the behavior.

Try building with array and string bounds checkng on (this is on by default in a Debug Visual Studio build) and with the "Generate Interface Blocks" (/gen_interface) and "Interface block checking" (/warn:interface) options selected and see what happens.
0 Kudos
Reply