[petsc-dev] --known-mpi-shared-library and --with-batch annoyance

Barry Smith bsmith at mcs.anl.gov
Wed Apr 20 14:09:19 CDT 2016

   When running with --batch one must provide the flag --known-mpi-shared-library this is annoying since no one will know this 

   I am trying to understand the purpose of this flag. It is used in MPI.py in the code

  def checkSharedLibrary(self):
    '''Sets flag indicating if MPI libraries are shared or not and
    determines if MPI libraries CANNOT be used by shared libraries'''
      self.shared = self.libraries.checkShared('#include <mpi.h>\n','MPI_Init','MPI_Initialized','MPI_Finalize',checkLink = self.checkPackageLink,libraries = self.lib, defaultArg = 'known-mpi-shared-libraries', executor = self.mpiexec)
    except RuntimeError, e:
      if self.argDB['with-shared-libraries']:
        raise RuntimeError('Shared libraries cannot be built using MPI provided.\nEither rebuild with --with-shared-libraries=0 or rebuild MPI with shared library support')
      self.logPrint('MPI libraries cannot be used with shared libraries')
      self.shared = 0

   It looks to me like the code says that if MPI is not a shared library then you cannot build PETSc with a shared library.

1) Is this true? What if MPI was built with PIC but static, won't it still be possible to use it with a PETSc shared library? i.e. is this even the right test?

2) Is there any way to get rid of this flag or will there be cases were configure goes through with success and accepts using shared libraries but then the build fails with unable to make the PETSc shared library?

   Thanks for any input


More information about the petsc-dev mailing list