[petsc-users] PETSc was configured with one OpenMPI version but now appears to be compiling using a different OpenMPI

Satish Balay balay at mcs.anl.gov
Thu Jun 11 12:34:51 CDT 2015


The code is in petscsys.h. The flags HAVE_OMPI_MAJOR_VERSION etc should
not be set [if the version cannot be determined]

So perhaps the attached patch is the fix.

patch -Np1 < mpi-version-check.patch

Satish

On Thu, 11 Jun 2015, Matthew Knepley wrote:

> On Thu, Jun 11, 2015 at 7:04 AM, Florian Lindner <mailinglists at xgm.de>
> wrote:
> 
> > configure.log is attached.
> >
> 
> Ah, you have the buggy Apple preprocessor, so you get
> 
>                 Unable to parse OpenMPI version from header. Probably a
> buggy preprocessor
>                   Defined "HAVE_OMPI_MAJOR_VERSION" to "unknown"
>                   Defined "HAVE_OMPI_MINOR_VERSION" to "unknown"
>                   Defined "HAVE_OMPI_RELEASE_VERSION" to "unknown"
> 
> In the new release, we catch this. However, I think then the make check
> fails.
> 
> Satish, how is the make check for this version number done?
> 
>   Thanks,
> 
>     Matt
> 
> 
> > Thx!
> > Florian
> >
> > Am Donnerstag, 11. Juni 2015, 06:26:27 schrieb Matthew Knepley:
> > > Cannot tell without configure.log
> > >
> > >   Thanks,
> > >
> > >      Matt
> > >
> > > On Thu, Jun 11, 2015 at 6:23 AM, Florian Lindner <mailinglists at xgm.de>
> > > wrote:
> > >
> > > > Hello,
> > > >
> > > > I try to setup petsc on my Arch Linux box.  Download it using git -b
> > maint.
> > > >
> > > > % python2 configure works fine:
> > > > [...]
> > > > Compilers:
> > > >   C Compiler:         mpicc  -fPIC -Wall -Wwrite-strings
> > > > -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -O0
> > > >   C++ Compiler:       mpicxx  -Wall -Wwrite-strings
> > -Wno-strict-aliasing
> > > > -Wno-unknown-pragmas -g -O0   -fPIC
> > > >   Fortran Compiler:   mpif90  -fPIC -Wall -Wno-unused-variable
> > > > -ffree-line-length-0 -g -O0
> > > > Linkers:
> > > >   Shared linker:   mpicc  -shared  -fPIC -Wall -Wwrite-strings
> > > > -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -O0
> > > >   Dynamic linker:   mpicc  -shared  -fPIC -Wall -Wwrite-strings
> > > > -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -O0
> > > > make:
> > > > [...]
> > > >
> > > >
> > xxx=========================================================================xxx
> > > >  Configure stage complete. Now build PETSc libraries with (gnumake
> > build):
> > > >    make PETSC_DIR=/home/florian/software/petsc
> > > > PETSC_ARCH=arch-linux2-c-debug all
> > > >
> > > >
> > xxx=========================================================================xxx
> > > >
> > > > Now building:
> > > >
> > > > % make PETSC_DIR=/home/florian/software/petsc
> > > > PETSC_ARCH=arch-linux2-c-debug all
> > > >
> > > > yields this error:
> > > >
> > > > "PETSc was configured with one OpenMPI mpi.h version but now appears
> > to be
> > > > compiling using a different OpenMPI mpi.h version"
> > > >
> > > > I would prefer to use my distributions openmpi 1.8.5, there is no other
> > > > MPI version installed.
> > > >
> > > > Using configure with --download-mpich and this compiler
> > > > /home/florian/software/petsc/arch-linux2-c-debug/bin/mpicc seems to
> > work.
> > > >
> > > > Is openmpi 1.8.5 incompatible with petsc? Is used to work fine some
> > time
> > > > ago, but I'm not sure how my system changed in the last weeks when I
> > > > haven't used petsc on this machine (Arch is a rolling release).
> > > >
> > > > Thx,
> > > > Florian
> > > >
> > > >
> > >
> > >
> > >
> 
> 
> 
> 
> 
-------------- next part --------------
diff --git a/config/BuildSystem/config/packages/MPI.py b/config/BuildSystem/config/packages/MPI.py
index 042aeeb..3b574f2 100644
--- a/config/BuildSystem/config/packages/MPI.py
+++ b/config/BuildSystem/config/packages/MPI.py
@@ -434,9 +434,9 @@ class Configure(config.package.Package):
       buf = self.outputPreprocess(mpich_test)
       try:
         mpich_numversion = re.compile('\nint mpich_ver = *([0-9]*) *;').search(buf).group(1)
+        self.addDefine('HAVE_MPICH_NUMVERSION',mpich_numversion)
       except:
         self.logPrint('Unable to parse MPICH version from header. Probably a buggy preprocessor')
-      self.addDefine('HAVE_MPICH_NUMVERSION',mpich_numversion)
     elif self.checkCompile(openmpi_test):
       buf = self.outputPreprocess(openmpi_test)
       ompi_major_version = ompi_minor_version = ompi_release_version = 'unknown'
@@ -444,11 +444,11 @@ class Configure(config.package.Package):
         ompi_major_version = re.compile('\nint ompi_major = *([0-9]*) *;').search(buf).group(1)
         ompi_minor_version = re.compile('\nint ompi_minor = *([0-9]*) *;').search(buf).group(1)
         ompi_release_version = re.compile('\nint ompi_release = *([0-9]*) *;').search(buf).group(1)
+        self.addDefine('HAVE_OMPI_MAJOR_VERSION',ompi_major_version)
+        self.addDefine('HAVE_OMPI_MINOR_VERSION',ompi_minor_version)
+        self.addDefine('HAVE_OMPI_RELEASE_VERSION',ompi_release_version)
       except:
         self.logPrint('Unable to parse OpenMPI version from header. Probably a buggy preprocessor')
-      self.addDefine('HAVE_OMPI_MAJOR_VERSION',ompi_major_version)
-      self.addDefine('HAVE_OMPI_MINOR_VERSION',ompi_minor_version)
-      self.addDefine('HAVE_OMPI_RELEASE_VERSION',ompi_release_version)
   def findMPIInc(self):
     '''Find MPI include paths from "mpicc -show"'''
     import re


More information about the petsc-users mailing list