Version of Mpi and fblaslapack

Satish Balay balay at
Fri Oct 12 09:23:18 CDT 2007

On Fri, 12 Oct 2007, Mads Hoel wrote:
> I found out that linking PETSc with another library (Diffpack) compiled with
> different
> versions of MPI will crash when calling InitializePetsc(...). My solution was
> to drop running config/configure with --download-mpi option, but have MPI
> point to the correct installation of MPI using the --with-mpi-dir=/path/to/mpi
> option.

Yes - you cannot mix 2 different versions of MPI [or any other
package] to create a single binary. This is equvalent to using include
files from package-version1 - and linking with
package-version2. [which is obviously wrong.]

In the same way, its best to install ALL packages that go into a
binary with the same compiler set [c,c++,fortran].

Usually compilers & MPI are the basic blocks that many external
packages use, so in this case one can first install MPI [with the
correct desired compilers]. And then install all other packages [used
by the application] with the MPI wrappers.

And all external packages built by PETSc will use the compilers/MPI
specified to PETSc.

./config/ --with-cc=mpicc --with-fc=mpif90
or the shortcut equivalent of the above:
./config/ --with-mpi-dir=


More information about the petsc-users mailing list