[mpich-discuss] Newbie getting started question?

Gus Correa gus at ldeo.columbia.edu
Fri Sep 14 18:24:27 CDT 2012


Maybe the mpich2 from yum doesn't have the Fortran90 bindings.
Does it only fail with the F90 examples?
Can you compile the C, C++, and Fortran77 examples?

It isn't hard to build mpich2 from source, maybe in your home directory,
with all bindings, as long as you have working C, C++, F77 and F90 
compilers,
which could be gcc, g++, and gfortran, for instance.
You need to have the compilers to begin with, but you can install with 
yum if one
of the Gnu compilers is missing.

Download the tarball to a work directory and untar it.
http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads
configure --prefix=$HOME/mpich2 CC=gcc CXX=g++ F77=gfortran FC=gfortran
make
make install
Add the new $HOME/mpich2/bin to your PATH, and the new $HOME/mpich2/lib 
to your LD_LIBRARY_PATH.

Reading the documentation may help with the details:
http://www.mcs.anl.gov/research/projects/mpich2/documentation/index.php?s=docs

I hope this helps,
Gus Correa

On 09/14/2012 07:04 PM, John Chludzinski wrote:
> *$ mpif90 -o ex1 ex1.f95*
> /usr/bin/ld: cannot find -lmpichf90
> /usr/bin/ld: cannot find -lmpichf90
> /usr/bin/ld: cannot find -lmpich
> collect2: ld returned 1 exit status
>
> No go!
>
> I used "yum install mpich2", should this bring the compiler wrapper?
>
> Why does the PETSc MPICH2 lib directory have *.a files while the newly 
> installed MPICH2 have *.so files?
>
> ---John
>
> On Fri, Sep 14, 2012 at 5:54 PM, Anthony Chan <chan at mcs.anl.gov 
> <mailto:chan at mcs.anl.gov>> wrote:
>
>     If the mpich2 installation you are using has Fortran 90 binding
>     correctly, you don't need -L<MPICH2_LIBDIR> when using mpif90.
>     The compiler wrapper should have taken care of setting all -L
>     flags to mpich2 libraries, try
>
>     mpif90 -o ex1 ex1.f95
>
>     A.Chan
>     ----- Original Message -----
>     > I have a small example program I've built and tested before using
>     > MPICH2
>     > that come with the PETSc installation.
>     >
>     > I just installed MPICH2 on a new machine (without PETSc) using: yum
>     > install
>     > mpich2.
>     >
>     > I added /usr/lib/mpich2/bin/ to my PATH env. variable and tried:
>     > mpif90
>     > ex1.f95 -L/usr/lib/mpich2/lib/. This resulted in:
>     >
>     > /usr/bin/ld: cannot find -lmpichf90
>     > /usr/bin/ld: cannot find -lmpichf90
>     > /usr/bin/ld: cannot find -lmpich
>     >
>     > I checked and the PETSc installation has *.a files in the lib
>     > directory,
>     > whereas my new installation of MPICH2 has *.so files. What do I need
>     > to do
>     > to get this to compile?
>     >
>     > ---John
>     >
>     > _______________________________________________
>     > mpich-discuss mailing list mpich-discuss at mcs.anl.gov
>     <mailto:mpich-discuss at mcs.anl.gov>
>     > To manage subscription options or unsubscribe:
>     > https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>     _______________________________________________
>     mpich-discuss mailing list mpich-discuss at mcs.anl.gov
>     <mailto:mpich-discuss at mcs.anl.gov>
>     To manage subscription options or unsubscribe:
>     https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>
>
>
>
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list