[petsc-dev] How do I build a shared library for exodus?

Satish Balay balay at mcs.anl.gov
Wed Jan 22 11:28:57 CST 2014

On Wed, 22 Jan 2014, Blaise A Bourdin wrote:

> On Jan 21, 2014, at 11:01 PM, Jed Brown <jed at jedbrown.org> wrote:
> > Blaise A Bourdin <bourdin at lsu.edu> writes:
> > 
> >> Hi,
> >> 
> >> For some reason, I would need to generate a shared library for
> >> exodusII, but the Makefile included in the source distribution does
> >> not have a rule for this. Is there an easy way to modify the build
> >> system package in order to generate the shared library?
> > 
> > The Makefile.standalone does not have rules for shared.  Perhaps
> > upstream exodus (now at version 6.02) is recommending the CMake build?

If upstream recommends cmake - perhaps we should stick to that? We
already have a bunch of packages that require cmake.

balay at asterix /home/balay/petsc (master)
$ git grep framework.require |grep PETSc.packages.cmake
config/PETSc/packages/clique.py:    self.cmake           = framework.require('PETSc.packages.cmake',self)
config/PETSc/packages/elemental.py:    self.cmake           = framework.require('PETSc.packages.cmake',self)
config/PETSc/packages/metis.py:    self.cmake           = framework.require('PETSc.packages.cmake',self)
config/PETSc/packages/parmetis.py:    self.cmake           = framework.require('PETSc.packages.cmake',self)
config/cmakeboot.py:   self.cmake         = self.framework.require('PETSc.packages.cmake',       None)

> > I'd rather not have exodusii.py depend on CMake if we can help it
> > (buggy, bad logging, another thing to compile), so maybe we need to add
> > a shared rule?  Or embrace the beast?
> let’s say we do want to mess with cmake. What is the typical way to add the shared rule?
>    - patch Makefile.standalone in exodusii.py?
>    - repackage exodus and serve it from the petsc servers?

Perhaps upstream exodus tarball should support sharedlibrary/static
library as a build option? elemental.py appears to have the followig
code commented..

if self.sharedLibraries.useShared:


> Is there a BuildSystem way to know that the linker flag to build a shared library is -shared under linux and -dynamiclib under mac OS? If so, can we simply build the shared library in exodusii.py?
> Blaise 

More information about the petsc-dev mailing list