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

usage of modules

Cetin_H_
Beginner
425 Views

Dear community,

I have a project to port from Linux to Windows. I habe several files with definitions of modules und other which use this modules.
When I try to compile my files in a batch-script I get errors. The modules are places in the path that I specify by the command line parameter.
But the modules will not be found by the other files?!?

Error message is:

mod_math.f(5): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MOD_NUM]
      use mod_num
----------^
mod_math.f(13): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MOD_NUM]
      use mod_num
----------^

My compiler command is:

set modp=c:\fvv\mudules

IFORT=ifort /c /object:..\exec\ /module:%modp% /DABQ_WIN86_64 /extend-source /iface:cref /recursive /Qauto-scalar /QxSSE3 /QaxAVX /nologo /heap-arrays:1 /Od /Qvec-report0 /include:%I /I%modp%

I have tried it also with the /I option and have put the modules in the same directory.

I am confused. Have anyone an idea?

Thanks in Advance

Cetin

0 Kudos
7 Replies
Arjen_Markus
Honored Contributor I
425 Views

The source files containing the modules have to be compiled first. It is not clear from your message that you are indeed doing that.

0 Kudos
Cetin_H_
Beginner
425 Views

Yes the modules needed by the other files are compiled and in the modules directory:

dir modules:


08.01.2016  14:45    <DIR>          .
08.01.2016  14:45    <DIR>          ..
08.01.2016  14:45             3.872 mod_num.mod
08.01.2016  14:45            85.944 tensor_classes.mod
               2 Datei(en),         89.816 Bytes

 

0 Kudos
Arjen_Markus
Honored Contributor I
425 Views

Can you upload the sources, so that somebody else can look at this? I have no clue as to what is going wrong. Quite possibly something simple, but that is easier to diagnose when you can experiment with the code (and the batch file) yourself.

0 Kudos
mecej4
Honored Contributor III
425 Views

If you wish to spell 'modules' as 'mudules', at least check that you do so consistently. What is the full path of the directory where you found the module files in #3?

0 Kudos
Cetin_H_
Beginner
425 Views

Attached are my make.bat-file and the contents of the MATH-directory. The whole structure is:

08.01.2016  10:35    <DIR>          BeispieleV5
08.01.2016  12:27    <DIR>          bin
08.01.2016  10:35    <DIR>          BLAS
10.07.2014  11:37               152 ifortvars.bat
08.01.2016  10:35    <DIR>          LAPACK
08.01.2016  14:45    <DIR>          lib
08.01.2016  14:45             3.016 make.bat
08.01.2016  10:35    <DIR>          MATH
08.01.2016  10:35    <DIR>          misc
08.01.2016  14:45    <DIR>          modules
08.01.2016  14:45    <DIR>          objects
08.01.2016  10:35    <DIR>          sources
08.01.2016  12:53    <DIR>          UEVAL
08.01.2016  10:35    <DIR>          UMAT

MATH-directory:

 Verzeichnis von C:\Benutzerdaten\FVV-Version6\Test\MATH

08.01.2016  10:35    <DIR>          .
08.01.2016  10:35    <DIR>          ..
08.01.2016  14:45    <DIR>          exec
08.01.2016  14:45    <DIR>          source

MATH\source-directory:

 Verzeichnis von C:\Benutzerdaten\FVV-Version6\Test\MATH\source

08.01.2016  14:45    <DIR>          .
08.01.2016  14:45    <DIR>          ..
15.12.2015  10:08             1.383 mod_math.f
02.12.2015  10:44             3.202 mod_num.f
08.01.2016  14:45             3.872 mod_num.mod
02.12.2015  16:18           128.787 mod_tensor.f
08.01.2016  14:45            85.944 tensor_classes.mod

 

0 Kudos
Arjen_Markus
Honored Contributor I
425 Views

I see in the make.bat batch file that you are compiling the source files via:

ifort *.f

I think that is the problem! You should specify the _order_ in which they should be compiled explicitly. So:

ifort mod_num.f

ifort mod_math.f

ifort mod_tensor.f

Otherwise - most likely - the alphabetical order is used and then mod_math.f comes before mod_num.f

 

0 Kudos
Cetin_H_
Beginner
425 Views

Thanks arjenmarkus,

that was it. Stupid developer. "Betriebsblind".

Regards and thanks to all.

0 Kudos
Reply