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

Matthew Knepley knepley at gmail.com
Sat Jan 17 13:29:13 CST 2015


On Sat, Jan 17, 2015 at 1:18 PM, Jerry <orzgodlo at gmail.com> wrote:

> Hi, Matthew.
>
> Please find attached the configure log. Thanks.
>

There are problems with C++ and this MPI install:

Executing: g++  -o /tmp/petsc-FhcRYT/config.libraries/conftest    -Wall
-Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g -O0
 /tmp/petsc-FhcRYT/config.libraries/conftest.o  -Wl,-rpath,/usr/lib
-L/usr/lib -lmpi -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/4.8
-L/usr/lib/gcc/x86_64-linux-gnu/4.8 -Wl,-rpath,/usr/lib/x86_64-linux-gnu
-L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/lib/x86_64-linux-gnu
-L/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu
-L/usr/lib/x86_64-linux-gnu -ldl -lgcc_s -ldl
Possible ERROR while running linker: exit code 256
stderr:
/tmp/petsc-FhcRYT/config.libraries/conftest.o: In function
`MPI::Intracomm::Intracomm()':
/usr/include/mpi/openmpi/ompi/mpi/cxx/intracomm.h:25: undefined reference
to `MPI::Comm::Comm()'
/tmp/petsc-FhcRYT/config.libraries/conftest.o: In function
`MPI::Intracomm::Intracomm(ompi_communicator_t*)':
/usr/include/mpi/openmpi/ompi/mpi/cxx/intracomm_inln.h:23: undefined
reference to `MPI::Comm::Comm()'
/tmp/petsc-FhcRYT/config.libraries/conftest.o: In function
`MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&),
bool)':
/usr/include/mpi/openmpi/ompi/mpi/cxx/op_inln.h:122: undefined reference to
`ompi_mpi_cxx_op_intercept'
/tmp/petsc-FhcRYT/config.libraries/conftest.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48):
undefined reference to `MPI::Win::Free()'
/tmp/petsc-FhcRYT/config.libraries/conftest.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78):
undefined reference to `MPI::Datatype::Free()'
collect2: error: ld returned 1 exit status

If you are using your own installation of MPI, it is best to use its
compiler wrappers:

  --with-cc=/usr/bin/mpicc --with-cxx=/usr/bin/mpicxx

instead of the MPI flags (since it looks like you missed a library). Also,
do you really
need to build PETSc with C++? If not, leave it out using

  --with-cxx=0

  Thanks,

     Matt


> -Jerry
>
> 2015-01-17 4:52 GMT-08:00 Matthew Knepley <knepley at gmail.com>:
>
>> Send the whole configure.log
>>
>>   Thanks,
>>
>>      Matt
>>
>> On Sat, Jan 17, 2015 at 4:07 AM, Jerry <orzgodlo at gmail.com> wrote:
>>
>>> Hi, all.
>>>
>>> I am trying to configure&compile petsc. However, during configuring, I
>>> got the following error (C++ error! MPI_Finalize() could not be located!).
>>> I am also copying the last few lines in configure.log.
>>>
>>> But I am sure mpi.h is under the folder I specified
>>> (--with-mpi-include=/usr/include/mpi )
>>>
>>> Any idea about the problem? Thanks.
>>>
>>>
>>> $$ ./configure --prefix=~/local --with-cc=gcc --with-cxx=g++
>>> --with-fc=gfortran --with-mpi-include=/usr/include/mpi
>>> --with-mpi-lib=/usr/lib/libmpi.so
>>>
>>>
>>> ===============================================================================
>>>              Configuring PETSc to compile on your
>>> system
>>>
>>> ===============================================================================
>>> TESTING: CxxMPICheck from
>>> config.packages.MPI(config/BuildSystem/config/packages*******************************************************************************
>>>          UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log
>>> for details):
>>>
>>> -------------------------------------------------------------------------------
>>> C++ error! MPI_Finalize() could not be located!
>>>
>>> *******************************************************************************
>>>
>>>
>>>
>>> ===========  Last few lines from configure.log ================
>>>
>>>
>>>
>>> *******************************************************************************
>>>   File "./config/configure.py", line 272, in petsc_configure
>>>     framework.configure(out = sys.stdout)
>>>   File
>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/framework.py",
>>> line 941, in configure
>>>     child.configure()
>>>   File
>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/package.py",
>>> line 606, in configure
>>>     self.executeTest(self.configureLibrary)
>>>   File
>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/base.py",
>>> line 126, in executeTest
>>>     ret = test(*args,**kargs)
>>>   File
>>> "/home/delia/workspace/programs/petsc/config/BuildSystem/config/packages/MPI.py",
>>> line 660, in CxxMPICheck
>>>     raise RuntimeError('C++ error! MPI_Finalize() could not be located!')
>>>
>>> ================================================================================
>>> Finishing Configure Run at Sat Jan 17 01:34:31 2015
>>>
>>> ================================================================================
>>>
>>>
>>> Jerry
>>>
>>
>>
>>
>> --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150117/ba0ca8ab/attachment.html>


More information about the petsc-users mailing list