C++ error! MPI_Finalize() could not be located!

Asked by jstults on 2011-11-22

I am trying to compile on Fedora 14 with Dorsal (dorsal-1.0-beta2). I have openmpi installed. I have previously installed all of the packages indicated on the yum command displayed at the start of the dorsal.sh script. I have added 'module load openmpi-i386' to my bashrc (and 'module list' shows the openmpi environment as loaded).

Parametis is downloaded and compiled, but PETSc fails with:
*******************************************************************************
         UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):
-------------------------------------------------------------------------------
C++ error! MPI_Finalize() could not be located!
*******************************************************************************
Failure with exit status: 1
Exit message: There was a problem configuring petsc-3.1-p8.

What should I be looking for in configure.log to diagnose this problem? Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Dorsal Edit question
Assignee:
No assignee Edit question
Solved by:
Johannes Ring
Solved:
2011-11-22
Last query:
2011-11-22
Last reply:
2011-11-22
Best Johannes Ring (johannr) said : #1

You can paste the configure.log here, or maybe better, try the development version of Dorsal:

  bzr branch lp:dorsal

Then you will get the latest PETSc 3.2.

jstults (joshua-stults) said : #2

Got the development version of dorsal as Johannes Ring suggested. I removed all of the directories and files under ~/Work/FEniCS.
Now Trilinos fails with:

CMake Error at cmake/package_arch/TPLDeclareLibraries.cmake:453 (MESSAGE):
  Could not find the UMFPACK headers include directory! Please manually set
  UMFPACK_INCLUDE_DIRS and/or UMFPACK_LIBRARY_DIRS or
  TPL_UMFPACK_INCLUDE_DIRS to point to the UMFPACK headers!

On my install umfpack.h is located at /usr/include/suitesparse/umfpack.h and the library is at /usr/lib/libumfpack.so
Added this to bashrcl:
  export UMFPACK_INCLUDE_DIRS=/usr/include/suitesparse

Removed the Trilinos dorsal_build_dir, and re-attempted ./dorsal.sh. Still fails with:
CMake Error at cmake/package_arch/TPLDeclareLibraries.cmake:453 (MESSAGE):
  Could not find the UMFPACK headers include directory! Please manually set
  UMFPACK_INCLUDE_DIRS and/or UMFPACK_LIBRARY_DIRS or
  TPL_UMFPACK_INCLUDE_DIRS to point to the UMFPACK headers!

'echo $UMFPACK_INCLUDE_DIRS' returns /usr/include/suitesparse

Johannes Ring (johannr) said : #3

Try to add -DUMFPACK_INCLUDE_DIRS=/usr/include/suitesparse in dolfin.package:

=== modified file 'FEniCS/packages/trilinos.package'
--- FEniCS/packages/trilinos.package 2011-11-17 09:14:45 +0000
+++ FEniCS/packages/trilinos.package 2011-11-22 17:20:44 +0000
@@ -14,7 +14,8 @@
           -D CMAKE_BUILD_TYPE:STRING=Release
           -D BUILD_SHARED_LIBS:BOOL=ON
           -D TPL_ENABLE_MPI:BOOL=ON
- -D TPL_ENABLE_UMFPACK:BOOL=ON"
+ -D TPL_ENABLE_UMFPACK:BOOL=ON
+ -D UMFPACK_INCLUDE_DIRS=/usr/include/suitesparse"

 if [ -x "${SWIG_EXECUTABLE}" ]; then
     CONFOPTS="${CONFOPTS} -D SWIG_EXECUTABLE:FILEPATH=${SWIG_EXECUTABLE}"

Getting the same trilinos problem, the last fix by Johannes solves one problem, but now I get:

Getting information for all enabled TPLs ...

-- Processing enabled TPL: Pthread
-- Attempting to enable tentatively enabled TPL 'Pthread' ...
-- Searching for library 'pthread' ...
-- Found Pthread TPL library: /usr/lib/libpthread.so
-- TPL_Pthread_LIBRARIES='/usr/lib/libpthread.so'
-- Found Pthread TPL header: /usr/include/pthread.h
-- Found Pthread TPL header path: /usr/include
-- TPL_Pthread_INCLUDE_DIRS='/usr/include'
-- Attempt to enable tentatively enabled TPL 'Pthread' passed!
-- Processing enabled TPL: BinUtils
-- Attempting to enable tentatively enabled TPL 'BinUtils' ...
-- Must find all libraries in "bfd;iberty"
-- Searching for library 'bfd' ...
-- Error: Could not find a library in the set "bfd" for the TPL BinUtils! Please manually set BinUtils_LIBRARY_DIRS and/or BinUtils_LIBRARY_NAMES or just TPL_BinUtils_LIBRARIES to point to the BinUtils libraries!
-- Searching for library 'iberty' ...
-- Error: Could not find a library in the set "iberty" for the TPL BinUtils! Please manually set BinUtils_LIBRARY_DIRS and/or BinUtils_LIBRARY_NAMES or just TPL_BinUtils_LIBRARIES to point to the BinUtils libraries!
-- Could not find the BinUtils Library! Please manually set BinUtils_LIBRARY_DIRS and/or BinUtils_LIBRARY_NAMES or just TPL_BinUtils_LIBRARIES to point to the BinUtils libraries!
-- _BinUtils_ENABLE_SUCCESS='FALSE'
-- TPL_BinUtils_LIBRARIES=''
-- Must find all headers in "link.h;bfd.h"
-- Searching for headers "link.h"
-- Found BinUtils TPL header: /usr/include/link.h
-- Searching for headers "bfd.h"
-- Did not find BinUtils TPL header: bfd.h
-- Found BinUtils TPL header path: /usr/include
-- TPL_BinUtils_INCLUDE_DIRS='/usr/include'
-- TPL_ENABLE_BinUtils='OFF'

So the above "Error: Could not find a library in the set "iberty" for the TPL BinUtils!" was not a showstopper, I managed to build trilinos by fixing an unrelated problem.

But scipy doesn't find UMFPACK either:

swig -python -I/usr/include/suitesparse -I/usr/include/suitesparse -I/usr/include/suitesparse -o build/src.linux-x86_64-2.6/scipy/sparse/linalg/dsolve/umfpack/_umfpack_wrap.c -outdir build/src.linux-x86_64-2.6/scipy/sparse/linalg/dsolve/umfpack scipy/sparse/linalg/dsolve/umfpack/umfpack.i
scipy/sparse/linalg/dsolve/umfpack/umfpack.i:192: Error: Unable to find 'suitesparse/umfpack.h'

How do I set the equivalent of -DUMFPACK_INCLUDE_DIRS=/usr/include/suitesparse for scipy.package?

jstults (joshua-stults) said : #6

Adding the UMFPACK_INCLUDE_DIRS change to the trilinos.package fixes that problem. Now I get an mpi problem again. It may be because I recently installed OpenFoam. Here's the tail of configure.log for petsc:

Possible ERROR while running linker: /tmp/petsc-mP6nTG/config.libraries/conftest.o: In function `main':
conftest.F:(.text+0x45): undefined reference to `mpi_init_'
collect2: ld returned 1 exit status
 output: ret = 256
error message = {/tmp/petsc-mP6nTG/config.libraries/conftest.o: In function `main':
conftest.F:(.text+0x45): undefined reference to `mpi_init_'
collect2: ld returned 1 exit status
}
                            Pushing language FC
                            Popping language FC
 in gfortran -o /tmp/petsc-mP6nTG/config.libraries/conftest -fPIC -Wall -Wno-unused-variable -Wno-line-truncation -O /tmp/petsc-mP6nTG/config.libraries/conftest.o -Wl,-rpath,/home/josh/OpenFOAM/ThirdParty-2.0.1/platforms/linuxGcc/openmpi-1.5.3/lib -L/home/josh/OpenFOAM/ThirdParty-2.0.1/platforms/linuxGcc/openmpi-1.5.3/lib -Wl,-rpath,/usr/lib/gcc/i686-redhat-linux/4.5.1 -L/usr/lib/gcc/i686-redhat-linux/4.5.1 -ldl -lmpi -lnsl -lutil -lgcc_s -lpthread -ldl
Source:
      program main
       include 'mpif.h'
       integer ierr
       call mpi_init(ierr)
      end
                Popping language FC
*******************************************************************************
         UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):
-------------------------------------------------------------------------------
Fortran error! mpi_init() could not be located!
*******************************************************************************
  File "./config/configure.py", line 283, in petsc_configure
    framework.configure(out = sys.stdout)
  File "/home/josh/Work/FEniCS/src/petsc-3.2-p5/config/BuildSystem/config/framework.py", line 925, in configure
    child.configure()
  File "/home/josh/Work/FEniCS/src/petsc-3.2-p5/config/BuildSystem/config/package.py", line 506, in configure
    self.executeTest(self.configureLibrary)
  File "/home/josh/Work/FEniCS/src/petsc-3.2-p5/config/BuildSystem/config/base.py", line 115, in executeTest
    ret = apply(test, args,kargs)
  File "/home/josh/Work/FEniCS/src/petsc-3.2-p5/config/BuildSystem/config/packages/MPI.py", line 733, in configureLibrary
    self.executeTest(self.FortranMPICheck)
  File "/home/josh/Work/FEniCS/src/petsc-3.2-p5/config/BuildSystem/config/base.py", line 115, in executeTest
    ret = apply(test, args,kargs)
  File "/home/josh/Work/FEniCS/src/petsc-3.2-p5/config/BuildSystem/config/packages/MPI.py", line 649, in FortranMPICheck
    raise RuntimeError('Fortran error! mpi_init() could not be located!')

How do I tell dorsal to use the system libraries/includes, and not the ones that came with OpenFoam?

jstults (joshua-stults) said : #7

I had sourced the OpenFOAM environment script from my bashrc; commenting that out and trying again seems to fix things. Sorry to be a bother!

jstults (joshua-stults) said : #8

Thanks Johannes Ring, that solved my question.