<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 12, 2010, at 6:45 PM, Amal Alghamdi wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Dear All,<div><br></div><div>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&nbsp;--download-petsc4py but it complained that I am not using the system python</div>
<div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div><font color="#009900">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;</font></div>
<div><font color="#009900">&nbsp;Are you not using the Apple python?</font></div></span></div>
<div><br></div><div>Does that mean I should use Apple python or there is a way to make PETSc4Py works on EPD.</div></div></blockquote><div><br></div>&nbsp;&nbsp; Take a look at config/PETSc/packages/petsc4py.py and the lines</div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp;if os.path.isfile(os.path.join(prefix,'Python')):</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for i in ['/usr/lib/libpython.dylib','/opt/local/lib/libpython2.5.dylib','/opt/local/lib/libpython2.6.dylib']:</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if os.path.realpath(i) == os.path.join(prefix,'Python'):</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self.addDefine('PYTHON_LIB','"'+os.path.join(i)+'"')</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;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?')</div><div><br></div><div>&nbsp;&nbsp;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. &nbsp;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&nbsp;os.path.join(prefix,'Python') file you could make your own dummy libpython.dylib and point to that?</div><div><br></div><div><br></div><div>&nbsp;&nbsp; &nbsp;Good luck and let us know how it goes,</div><div><br></div><div>&nbsp;&nbsp; Barry</div><div><br></div><blockquote type="cite"><div dir="ltr"><div><br></div><div>Thank you very much</div><div>Amal</div></div>
</blockquote></div><br></body></html>