On 5/19/2012 2:20 AM, Sergiy Bubin wrote:
> I built OpenMPI with that set of intel compilers. Everything seems to
> be fine and I can compile my fortran+MPI code with no problem when I
> invoke ifort. I should say that I do not actually invoke the "wrapper"
> mpi compiler. I normally just add flags as MPICOMPFLAGS=$(shell mpif90
> --showme:compile) and MPILINKFLAGS=$(shell mpif90 --showme:link) in my
> makefile. I know it is not the recommended way of doing things but the
> reason I do that is that I absolutely need to be able to use different
> fortran compilers to build my fortran code.
Avoiding the use of mpif90 accomplishes nothing for changing between
incompatible Fortran compilers. Run-time libraries are incompatible
among ifort, gfortran, and Oracle Fortran, so you can't link a mixture
of objects compiled by incompatible Fortran compilers except in limited
circumstances. This includes the MPI Fortran library.
I don't see how it is too great an inconvenience for your Makefile to
set PATH and LD_LIBRARY_PATH to include the mpif90 corresponding to the
chosen Fortran compiler. You may need to build your own mpif90 for
gfortran as well as the other compilers, so as to configure it to keep
it off the default PATHs (e.g. --prefix=/opt/ompi1.4gf/), if you can't
move the Ubuntu ompi.
Surely most of this is implied in the OpenMPI instructions.