[petsc-users] PETSc4Py with Enthough Python Distribution
Barry Smith
bsmith at mcs.anl.gov
Sat Jun 12 19:14:26 CDT 2010
On Jun 12, 2010, at 6:45 PM, Amal Alghamdi wrote:
> Dear All,
>
> I have Mac OS 10.6 and I'd like to ask if any one have tried using PETSc4Py with Enthough Python Distribution, EPD. I have tried to build PETSc with the option --download-petsc4py but it complained that I am not using the system python
>
> realpath of /usr/lib/libpython.dylib (/System/Library/Frameworks/Python.framework/Versions/2.6/Python) does not point to Python library path (/Library/Frameworks/Python.framework/Versions/6.1/Python) for current Python;
> Are you not using the Apple python?
>
> Does that mean I should use Apple python or there is a way to make PETSc4Py works on EPD.
Take a look at config/PETSc/packages/petsc4py.py and the lines
if os.path.isfile(os.path.join(prefix,'Python')):
for i in ['/usr/lib/libpython.dylib','/opt/local/lib/libpython2.5.dylib','/opt/local/lib/libpython2.6.dylib']:
if os.path.realpath(i) == os.path.join(prefix,'Python'):
self.addDefine('PYTHON_LIB','"'+os.path.join(i)+'"')
return
raise RuntimeError('realpath of /usr/lib/libpython.dylib ('+os.path.realpath('/usr/lib/libpython.dylib')+') does not point to Python library path ('+os.path.join(prefix,'Python')+') for current Python;\n Are you not using the Apple python?')
The problem is that some python on apples make it a little difficult to find the python shared library (that ends in .dylib) that is needed by PETSc4py. This is our hack to find the right .dylib; perhaps you can add the location of the dylib that you need to the list and get it to work? If you cannot find the right . dylib (which is actually just a link to the os.path.join(prefix,'Python') file you could make your own dummy libpython.dylib and point to that?
Good luck and let us know how it goes,
Barry
>
> Thank you very much
> Amal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20100612/97c4f0d4/attachment.htm>
More information about the petsc-users
mailing list