[petsc-users] WHY "C++ error! MPI_Finalize() could not be located!"? Thanks.

Satish Balay balay at mcs.anl.gov
Sun Jan 18 11:49:07 CST 2015


On Sun, 18 Jan 2015, Matthew Knepley wrote:

> On Sun, Jan 18, 2015 at 3:28 AM, Jerry <orzgodlo at gmail.com> wrote:
> 
> > Thanks, Matthew.
> >
> > I thought "--with-cc" "--with-cxx "  "--with-fc" are all needed, according
> > to the following webpage
> > http://www.mcs.anl.gov/petsc/documentation/installation.html
> >
> 
> Only if you want to turn on those features. I'll see if we can clarify that.

The 3 reasons for c++ is:

- some externalpackages [hypre, openmpi etc..] require a c++ compiler.

- some user codes might be c++ - so to use PETSc from user c++ code -
its best to configure PETSc with a c++ compiler [eventhough the PETSc
build is C]

- to build PETSc using --with-clanguage=cxx. [This should mostly be
unnecessary as the equivalent functionality is present in c build of
PETSc]

There is always a priority order [for info] in installation
instructions. --with-cxx is partly explained in the example usages
section as:

>>>>>>
Same as above - but do not have a fortran compiler [and want to use PETSc from C only].

    ./configure --with-cc=gcc --with-cxx=0 --with-fc=0 --download-f2cblaslapack --download-mpich
<<<<<


The first instruction list:

./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich


Alternatively - we could change it to:

./configure --with-cc=gcc --with-cxx=0 --with-fc=gfortran --download-fblaslapack --download-mpich

[this default is bad for PETSc users who use it from c++]

I wanted to avoid specifying:

./configure --with-cc=gcc --with-fc=gfortran --download-fblaslapack --download-mpich

[i.e no mention of --with-cxx] - as configure picks up a random c++
compiler in this mode - and can result in broken builds.

Satish




More information about the petsc-users mailing list