Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
39 Views

Compiling an existing code (error #5102: Cannot open include file 'mpif.h')

Hi Everyone,

I am trying to use Intel® Parallel Studio XE 2019 for Fortran Windows to compile and build a set of existing .f90 files.

When I try to compile the code, I get the next errors:

 - error #5102: Cannot open include file 'mpif.h'

 - error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MSFLIB] 

 - error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association.   [MPI_STATUS_SIZE]

I am not sure how to inlude 'mpif.h' I read that it is under Tools / Intel Visual Fortran / Compilers. But I still dont know what should I do there to add that include file.
I will apreciate any help, Thanks!

 

Visual and intel versions:

Microsoft Visual Studio Enterprise 2017 
Version 15.8.4
VisualStudio.15.Release/15.8.4+28010.2026
Microsoft .NET Framework
Version 4.7.03056

Intel® Parallel Studio XE 2019 Update 3 Composer Edition for Fortran Windows*   Package ID: w_comp_lib_2019.3.203
Intel® Parallel Studio XE 2019 Update 3 Composer Edition for Fortran Windows* Integration for Microsoft Visual Studio* 2017, Version 19.0.0051.15.

0 Kudos
12 Replies
Highlighted
Moderator
39 Views

You will need to install an

You will need to install an MPI package on your system.  The Fortran compiler has the Intel MPI runtime libraries but NOT the include files or libraries needed to build MPI programs.

Intel MPI is one such package.  And now they have a free Community Edition:  https://software.intel.com/en-us/mpi-library/choose-download

 

0 Kudos
Highlighted
Black Belt
39 Views

Also, MSFLIB was from

Also, MSFLIB was from Microsoft PowerStation Fortran and Intel Fortran does not provide it. Try replacing that with DFLIB (which is the closest equivalent). 

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
39 Views

Quote:Ronald W Green

Ronald W Green (Blackbelt) wrote:

You will need to install an MPI package on your system.  The Fortran compiler has the Intel MPI runtime libraries but NOT the include files or libraries needed to build MPI programs.

Intel MPI is one such package.  And now they have a free Community Edition:  https://software.intel.com/en-us/mpi-library/choose-download

 

Thanks Ronald! I did not know that. I already installed the MPI package. It solved the first error but I still have the second error:

 - error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MSFLIB] 

0 Kudos
Highlighted
Beginner
39 Views

Quote:Steve Lionel (Ret.)

Steve Lionel (Ret.) (Blackbelt) wrote:

Also, MSFLIB was from Microsoft PowerStation Fortran and Intel Fortran does not provide it. Try replacing that with DFLIB (which is the closest equivalent). 

 

Thanks Steve!

You are right, I still have this error:  - error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MSFLIB] 

Do you know how can I replace MSFLIB for DFLIB? just replacing it in the code? (I did not write the code).

0 Kudos
Highlighted
Black Belt
39 Views

Yes, just replace MSFLIB with

Yes, just replace MSFLIB with DFLIB wherever it appears.

Alternatively, add the following code as a source file named msflib.f90 to your project:

module msflib
use dflib
end module msflib

 

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
39 Views

Quote:Steve Lionel (Ret.)

Steve Lionel (Ret.) (Blackbelt) wrote:

Yes, just replace MSFLIB with DFLIB wherever it appears.

Alternatively, add the following code as a source file named msflib.f90 to your project:

module msflib
use dflib
end module msflib

 

I just tried both options, and I got this error:

error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [DFLIB] 

it seems that I dont have DFLIB either? do you know how I can include it?

Thanks!

  
 

0 Kudos
Highlighted
Black Belt
39 Views

This should work - that

This should work - that module has been provided in every version of Intel Visual Fortran since 8.0. Are you building from within Visual Studio, or some other environment? It sounds as if the INCLUDE path is not properly set.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
39 Views

Quote:Steve Lionel (Ret.)

Steve Lionel (Ret.) (Blackbelt) wrote:

This should work - that module has been provided in every version of Intel Visual Fortran since 8.0. Are you building from within Visual Studio, or some other environment? It sounds as if the INCLUDE path is not properly set.

Yes, I am building from within Visual Studio. I do not know how to properly set the include path . I tried to do it but I did not find the DFLIB folder, do you have any idea where I can find it?

Thanks!

0 Kudos
Highlighted
Valued Contributor II
39 Views

Well the libs on my system

Well the libs on my system are in 

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.2.185\windows\compiler\lib\ia32_win

The source being in:

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.2.185\windows\compiler\include

However is should just find these if installed OK based on tools>options>Intel Compilers and tools> Visual Fortran

settings in VS

If those are not set OK I suspect your instal is bad

0 Kudos
Highlighted
Black Belt
39 Views

In Visual Studio, go to Tools

In Visual Studio, go to Tools > Options > Intel Compilers and Tools > Visual Fortran > Compilers. Click Reset... Then click on the x64 tab and click Reset... there as well.

If you click on the ... button to the right of Includes it should show (for Win32):

$(UniversalCRTSdkDir)Include\$(UCRTVersion)\um
$(UniversalCRTSdkDir)Include\$(UCRTVersion)\shared
$(IFortInstallDir)compiler\include
$(IFortInstallDir)compiler\include\ia32
$(IFortInstallDir)mkl\include
$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\atlmfc\include
$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\include
$(WindowsSdkDir)include\um
$(WindowsSdkDir)include\shared
$(FrameworkSDKDir)include

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
39 Views

Quote:Steve Lionel (Ret.)

Steve Lionel (Ret.) (Blackbelt) wrote:

In Visual Studio, go to Tools > Options > Intel Compilers and Tools > Visual Fortran > Compilers. Click Reset... Then click on the x64 tab and click Reset... there as well.

If you click on the ... button to the right of Includes it should show (for Win32):

$(UniversalCRTSdkDir)Include\$(UCRTVersion)\um
$(UniversalCRTSdkDir)Include\$(UCRTVersion)\shared
$(IFortInstallDir)compiler\include
$(IFortInstallDir)compiler\include\ia32
$(IFortInstallDir)mkl\include
$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\atlmfc\include
$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\include
$(WindowsSdkDir)include\um
$(WindowsSdkDir)include\shared
$(FrameworkSDKDir)include

I just did what you said but I am getting the same error, is there something else I have to modify? (I already found the folder that contains dflib and added in Project - properties - Fortran - General - Additional include directories) this is what it shows and it seems the same as you said: 

$(UniversalCRTSdkDir)Include\$(UCRTVersion)\um
$(UniversalCRTSdkDir)Include\$(UCRTVersion)\shared
$(IFortInstallDir)compiler\include
$(IFortInstallDir)compiler\include\ia32
$(IFortInstallDir)mkl\include
$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\atlmfc\include
$(VSInstallDir)VC\Tools\MSVC\$(VCToolsVersion)\include
$(WindowsSdkDir)include\um
$(WindowsSdkDir)include\shared
$(FrameworkSDKDir)include

0 Kudos
Highlighted
Black Belt
39 Views

I'd suggest an uninstall and

I'd suggest an uninstall and reinstall of the Intel product.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos