[mpich-discuss] Fwd: compiling parallel programms with ifort

Anthony Chan chan at mcs.anl.gov
Wed Apr 27 13:49:20 CDT 2011



----- Original Message -----
> Hi Anthony
> it gave me this message:
> The Open MPI wrapper compiler was unable to find the specified
> compiler
> gfortran in your PATH.

OpenMPI is a totally different MPI implementation from MPICH2.
This suggests your machine has OpenMPI preinstalled.  So you should
use full path of mpif90 (either OpenMPI or MPICH2) in
compiling/linking of your program. e.g.

<fullpath_to_MPI>/bin/mpif90 -o foo foo.f90.
 
> Note that this compiler was either specified at configure time or in
> one of several possible environment variables.
> 
> can i change any variable of mpif90 to appoint to ifort rather than
> gfortran?

Your preinstalled OpenMPI is probably built with gcc/g++/gfortran.
I think there is way in OpenMPI and MPICH2 to change the native compiler
used in mpif90, but I don't think you need that here.

A.Chan
> 
> 
> On Wed, Apr 27, 2011 at 8:33 PM, Anthony Chan <chan at mcs.anl.gov>
> wrote:
> 
> >
> > You should use mpif90 to compile and link your f90 program.
> > mpif90 will take care of include path and linking of various
> > MPICH2 internal libraries...
> >
> > ----- Original Message -----
> > > Dear there
> > >
> > > I have installed MPICH2-1.3.2p1 on ubuntu and the installation was
> > > ended and
> > > tested successfully, When i try to compile a parallel program with
> > > ifort,
> > > it gives me error. i use this command for compiling:
> > > ifort heat_mpi.f90 hi.out -o
> > >
> > > the errors that appear are as follows:
> > > /tmp/ifortYgvRCy.o: In function `MAIN__':
> > > heat_mpi.f90:(.text+0x1f8): undefined reference to `mpi_init_'
> > > heat_mpi.f90:(.text+0x214): undefined reference to
> > > `mpi_comm_rank_'
> > > heat_mpi.f90:(.text+0x230): undefined reference to
> > > `mpi_comm_size_'
> > > heat_mpi.f90:(.text+0x255): undefined reference to `mpi_wtime_'
> > > heat_mpi.f90:(.text+0x1166): undefined reference to `mpi_send_'
> > > heat_mpi.f90:(.text+0x11ce): undefined reference to `mpi_recv_'
> > > heat_mpi.f90:(.text+0x1236): undefined reference to `mpi_send_'
> > > heat_mpi.f90:(.text+0x1294): undefined reference to `mpi_recv_'
> > > heat_mpi.f90:(.text+0x149f): undefined reference to `mpi_wtime_'
> > > heat_mpi.f90:(.text+0x1590): undefined reference to
> > > `mpi_finalize_'
> > > /tmp/ifortYgvRCy.o: In function `update_':
> > > heat_mpi.f90:(.text+0x27f9): undefined reference to `mpi_send_'
> > > heat_mpi.f90:(.text+0x2858): undefined reference to `mpi_recv_'
> > > heat_mpi.f90:(.text+0x28b7): undefined reference to `mpi_send_'
> > > heat_mpi.f90:(.text+0x2911): undefined reference to `mpi_r
> > >
> > > i have included the mpif.h file in the same directory and i added
> > > the
> > > paths
> > > of mpich2/include and mpich2/lib to the PATH variable. should i
> > > change
> > > some
> > > thing in my command? or do some thing to define the mpich2 to
> > > ifort. I
> > > had
> > > the ifort installed befor mpich2.
> > >
> > > thanks,
> > > Ali.
> > >
> > > _______________________________________________
> > > mpich-discuss mailing list
> > > mpich-discuss at mcs.anl.gov
> > > https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
> > _______________________________________________
> > mpich-discuss mailing list
> > mpich-discuss at mcs.anl.gov
> > https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
> >


More information about the mpich-discuss mailing list