- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just updated my compiler to 11.0.
How do I link my openmpi installation to ifort?
When I compile my code I get the following error,
04.mpiinc.f(23): error #5102: Cannot open include file 'mpif.h'
include "mpif.h"
--------------^
compilation aborted for 04.mpiinc.f (code 1)
How do I link my openmpi installation to ifort?
When I compile my code I get the following error,
04.mpiinc.f(23): error #5102: Cannot open include file 'mpif.h'
include "mpif.h"
--------------^
compilation aborted for 04.mpiinc.f (code 1)
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You also have the option of building your mpich wrapper (e.g. mpif77 or mpif90) so that it uses ifort, along with supplying the MPI include and link paths. Intel MPI, a derivative of mpich2, provides the mpiifort wrapper as the ifort analogy to the mpif90 wrapper which uses gfortran.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - amit
I just updated my compiler to 11.0.
How do I link my mpich installation to ifort?
When I compile my code I get the following error,
04.mpiinc.f(23): error #5102: Cannot open include file 'mpif.h'
include "mpif.h"
--------------^
compilation aborted for 04.mpiinc.f (code 1)
How do I link my mpich installation to ifort?
When I compile my code I get the following error,
04.mpiinc.f(23): error #5102: Cannot open include file 'mpif.h'
include "mpif.h"
--------------^
compilation aborted for 04.mpiinc.f (code 1)
This is not a linking problem, you have a compilation problem. When your code has:
include "mpif.h"
the compiler needs to be able to find that file, mpif.h. This MPI include file should be in an include/ directory on your system somewhere, in the directory where you installed mpich. Let's just pretend it's in /usr/local/mpich/include
then you need to let the compiler know about this include path. This is done with the -I option. In the example above you'd need to add this to your compile command:
-I/usr/local/mpich/include
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You also have the option of building your mpich wrapper (e.g. mpif77 or mpif90) so that it uses ifort, along with supplying the MPI include and link paths. Intel MPI, a derivative of mpich2, provides the mpiifort wrapper as the ifort analogy to the mpif90 wrapper which uses gfortran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ron,
I've been working this problem for quite some time and have had no luck anywhere. I'm running a guest Ubuntu 9.04 through VirtualBox on Windows Vista, all 64 bit. I've run standalond fortran programs and they run fine.
My 'include' files are not being found when compiling. I'm working in /home/cbisher/Research/TorusSGP4/HootsSgp4 directory. My f90 file has an include statement that needs to pull subroutines from /home/cbisher/Research/FourierSeries. However, I get error #5102: Cannot open include file.
I tried adding "$ ifort -I/home/cbisher SPG4Series.f90" to the command line, but I still get the same error. I've used FPATH in .bashrc and ifortvars_64.sh to look in the /home/cbisher directory also.
My include statement that gets the error is:
include 'ResearchFourierSeriesmultiplefilenames.f90
---------^
Do you have any ideas/recommendations? My thesis advisor runs from the Windows command prompt and is unfamiliar with Linux. My schools resident linux professor could only recommend the -I flag and FPATH which I have tried. I do not want to just move this include files into my working directory since this is my professors file structure, all his code is written with this structure, and my work will be absorbed into his when I leave.
Thank you for any help or guidance.
Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - cbisher
Ron,
I've been working this problem for quite some time and have had no luck anywhere. I'm running a guest Ubuntu 9.04 through VirtualBox on Windows Vista, all 64 bit. I've run standalond fortran programs and they run fine.
My 'include' files are not being found when compiling. I'm working in /home/cbisher/Research/TorusSGP4/HootsSgp4 directory. My f90 file has an include statement that needs to pull subroutines from /home/cbisher/Research/FourierSeries. However, I get error #5102: Cannot open include file.
I tried adding "$ ifort -I/home/cbisher SPG4Series.f90" to the command line, but I still get the same error. I've used FPATH in .bashrc and ifortvars_64.sh to look in the /home/cbisher directory also.
My include statement that gets the error is:
include 'ResearchFourierSeriesmultiplefilenames.f90
---------^
Do you have any ideas/recommendations? My thesis advisor runs from the Windows command prompt and is unfamiliar with Linux. My schools resident linux professor could only recommend the -I flag and FPATH which I have tried. I do not want to just move this include files into my working directory since this is my professors file structure, all his code is written with this structure, and my work will be absorbed into his when I leave.
Thank you for any help or guidance.
Christian
I'm not familiar with VirtualBox. However, it looks like a discrepency in how pathnames are represented between the Windows system and the Ubuntu under it. From a command line (terminal window) on Ubuntu, what happens if you enter the command:
cat ResearchFourierSeriesmultiplefilenames.f90
?
if the Ubuntu command line does not find the file on that path, neither will the compiler. The 'include' statement must use paths that are understood by Ubuntu and NOT the underlying Windows Vista filesystem. You may need to change the path in your 'include' statements to find the files under Ubuntu.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you want your Fortran source to work on both linux and Windows, you'll have to take that part of the include file path between backslashes out of the source and put the entire directory path (in linux forward slashed style) in the -I directive. Your linux professor gave the right advice there.
Your Fortran INCLUDE requires matching quotes before and after the filename. That would not change between Windows and linux.
Your Fortran INCLUDE requires matching quotes before and after the filename. That would not change between Windows and linux.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page