[petsc-users] Libraries destination directory is non-standard

Barry Smith bsmith at mcs.anl.gov
Thu Jan 8 17:58:09 CST 2015


  Juan Luis,

   We are very interested in making it easy for you to get this installer to suit your needs.

   The particular problem you report is due to the fact that PETSc's setup.py has the lines

class cmd_install(_install):

    def initialize_options(self):
        _install.initialize_options(self)
        self.optimize = 1

    def run(self):
        root_dir = self.install_platlib
        dest_dir = os.path.join(root_dir, 'petsc')

that is it sets the dest_dir to be the usual install directory appended with a 'petsc'. I don't know why we adopted this extra name spacing.

1)  As a quick and dirty fix you can edit the setup.py and set dest_dir directly to root_dir.

 2) For the longer term we'd like to make it trivial for  things work as you desire. We've revamped our installation process in the developer version of PETSc http://www.mcs.anl.gov/petsc/developers/index.html (git branch barry/namespace-install) and would be happy to work with you to get that version to to have the support you require. I'm guessing that we could add an optional argument to our setup.py that allows you to bypass the extra 'petsc' in the installation directory and we'd be happy to add that. 

  Please let us know your thoughts,

  Barry




> On Jan 8, 2015, at 2:32 PM, Juan Luis Cano <juanlu001 at gmail.com> wrote:
> 
> Hello all,
> 
> I am trying to build a conda package of PETSc 3.4 using its Python build system so anybody can install it in the Anaconda Python distribution. I need PETSc as a dependency for FEniCS.
> 
> The problem is that the required shared libraries (also those corresponding to external packages such as UMFPACK) are installed in $PREFIX/lib/python2.7/site-packages/petsc/lib. The build process goes perfectly fine but when packaging this into a tarball these libs won't be found by any package as they are not in $PREFIX/lib. Here is the build script I am using:
> 
> https://github.com/Juanlu001/conda-recipes/blob/juanlu001/fenics/petsc/build.sh
> 
> I tried to change the destination using `--prefix` in PETSC_CONFIGURE_OPTIONS and after `setup.py install`, but neither worked. Changing LD_LIBRARY_PATH seems dangerous to me and creating symbolic links three levels higher seems dirty. If the python version changes, or "lib64" is added somewhere, this will surely break... Does anybody have a suggestion on how to do this?
> 
> Thanks in advance, regards,
> 
> Juan Luis



More information about the petsc-users mailing list