- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, everyone
I am using a parallel package for my work. It is coded by c/c++ and uses mpich for parallel. I have compiled it successfully with gcc.
Now, I need to use a fortran code in my program. This code is the f90 type and is not parallel. So, I want to select intel fortran compiler to compile it into a library. I will call this lib in my program. This call is relevant to c and fortran mixing programming. Furthermore, the compilers for my program (gcc) and fortran code (intel fortran compiler) are different. I want to know whether it is possible. If it is, how should I do it? thanks a lot.
I am using a parallel package for my work. It is coded by c/c++ and uses mpich for parallel. I have compiled it successfully with gcc.
Now, I need to use a fortran code in my program. This code is the f90 type and is not parallel. So, I want to select intel fortran compiler to compile it into a library. I will call this lib in my program. This call is relevant to c and fortran mixing programming. Furthermore, the compilers for my program (gcc) and fortran code (intel fortran compiler) are different. I want to know whether it is possible. If it is, how should I do it? thanks a lot.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mpich is built frequently with gcc and ifort. Just follow the configure instructions, setting gcc and g++ as the C and C++ compilers, and ifort as the f77 and f90 compiler.
openmpi is probably the most popular of the open source MPI implementations nowadays.
As you should be aware, ifort depends on a g++ installation, so the same combinations of gcc/g++ and ifort are OK for MPI.
You could use Intel MPI, which is based on mpich2, and get the multiple interconnect device support with relatively little effort. That also will support any combination of gcc,g++, icc,icpc, and ifort.
openmpi is probably the most popular of the open source MPI implementations nowadays.
As you should be aware, ifort depends on a g++ installation, so the same combinations of gcc/g++ and ifort are OK for MPI.
You could use Intel MPI, which is based on mpich2, and get the multiple interconnect device support with relatively little effort. That also will support any combination of gcc,g++, icc,icpc, and ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think the reason why I can't use the lib compiled by ifort in the package compiled by gcc
should be their different run-time libraries. If it is correct, according to what you said, whether is the run-time lib of ifort compatible with that of gcc?
whether does it ok that I do not set ifort to the fortran compiler in MPI, separately compile the fortran code with ifort and then use it in my program? thanks a lot.
should be their different run-time libraries. If it is correct, according to what you said, whether is the run-time lib of ifort compatible with that of gcc?
whether does it ok that I do not set ifort to the fortran compiler in MPI, separately compile the fortran code with ifort and then use it in my program? thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort run-time is compatible in mixed language builds with the gcc/g++ used to install ifort. This carries over to MPI builds based on the same compilers.
Correctly configured mpif77 and mpif90 wrappers are a convenience (and a necessity, to support portable MPI code). They simply add MPI include files and libraries to the ifort command. Where you have Fortran source files which don't require the MPI includes, it makes no difference whether you compile with ifort or with the MPI wrapper.
The mpicc and C++ wrappers deal also with getting the Fortran to C linkage correct, generally using legacy means rather than ISO C interop.
Correctly configured mpif77 and mpif90 wrappers are a convenience (and a necessity, to support portable MPI code). They simply add MPI include files and libraries to the ifort command. Where you have Fortran source files which don't require the MPI includes, it makes no difference whether you compile with ifort or with the MPI wrapper.
The mpicc and C++ wrappers deal also with getting the Fortran to C linkage correct, generally using legacy means rather than ISO C interop.

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