On 2015-01-11 18:41, Lisandro Dalcin wrote:
On 8 January 2015 at 23:32, Juan Luis Cano <[email protected]> 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.

Nice to know! I was thinking about doing it myself. You may find
interesting my mpich and openmpi packages (newer versions than the
available in Anaconda) to depend on https://binstar.org/mpi4py, I
still have to put the recipes in github repo.

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:

Are you using pip to create/build the conda recipes? I really advice
against that. You should create a petsc package that is independent of
a Python runtime (of course, you still need Python to run configure),
this way you can install in the standard $PREFIX location. Why do you
say things are installed in site-packages? Who is installing there
FEniCS ?
¡Hola Lisandro! Thanks for your answer. At first I used 'conda skeleton pypi' to create the packages, but the setup.py procedure installs in site-packages and it didn't seem appropriate, so I finally arranged the build script as you say.

Please note/remember that conda is not only for Python stuff, but for
any other Python-independent package that install under a $PREFIX
tree.

I am aware! Actually if you see my binstar you will see boost and eigen3 there.

https://github.com/Juanlu001/conda-recipes/blob/juanlu001/fenics/petsc/build.sh

* Please remember to add the md5 hash under the source section.
* python should not be a runtime dependency of the petsc package

You are right, I wanted to do it the quick 'n' dirty way so I didn't write the hashes. This evening I achieved the result I wanted so I will polish the recipes.

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?

Knowing the full stack of conda packages you depend on would help to
figure out your issue.

As I said, fortunately this is not an issue anymore since I am not using 'setup.py install'. The configure && make procedure is much more suitable.

Regards,

Juan Luis

Reply via email to