<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 20, 2016 at 2:09 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
When running with --batch one must provide the flag --known-mpi-shared-library this is annoying since no one will know this<br>
<br>
I am trying to understand the purpose of this flag. It is used in MPI.py in the code<br>
<br>
def checkSharedLibrary(self):<br>
'''Sets flag indicating if MPI libraries are shared or not and<br>
determines if MPI libraries CANNOT be used by shared libraries'''<br>
self.executeTest(self.configureMPIEXEC)<br>
try:<br>
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)<br>
except RuntimeError, e:<br>
if self.argDB['with-shared-libraries']:<br>
raise RuntimeError('Shared libraries cannot be built using MPI provided.\nEither rebuild with --with-shared-libraries=0 or rebuild MPI with shared library support')<br>
self.logPrint('MPI libraries cannot be used with shared libraries')<br>
self.shared = 0<br>
return<br>
<br>
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.<br>
<br>
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?<br></blockquote><div><br></div><div>PETSc used to have multiple shared libraries, and its still possible. If you link MPI statically into multiple shared libraries,</div><div>you duplicate symbols like isInitialized. This messes up tons of things in MPI.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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?<br></blockquote><div><br></div><div>If we allow --single-library=0, I do not see how we can avoid this.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for any input<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>