<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 11, 2015 at 5:07 AM, Mikhail Khodak <span dir="ltr"><<a href="mailto:mkhodak@princeton.edu" target="_blank">mkhodak@princeton.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thank you for your help - the install seems to work, apart from routines requiring MPI, which fail due to the "Attempting to use an MPI routine before initializing MPI" error. This seems to be an error in the PETSc build itself.</div></blockquote><div><br></div><div>The MPI routines will not work until after</div><div><br></div><div>import petsc4py, sys</div><div>petsc4py.init(sys.argv)</div><div>from petsc4py import PETSc<br></div><div><br></div><div>If they fail after this, it is usually a mismatch between the mpiexec being used and the MPI</div><div>libraries being linked.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Thanks again,</div><div>Mikhail Khodak</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 8, 2015 at 5:11 AM, Lisandro Dalcin <span dir="ltr"><<a href="mailto:dalcinl@gmail.com" target="_blank">dalcinl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>On 8 June 2015 at 02:50, Mikhail Khodak <<a href="mailto:mkhodak@princeton.edu" target="_blank">mkhodak@princeton.edu</a>> wrote:<br>
> Hello, I am trying to build petsc4py-3.5.1 using Cygwin on 64-bit Windows 7.<br>
> I have built PETSc 3.5.4 with shared and dynamic libraries using<br>
> mpich2-1.2.1 and successfully ran the installation tests. I am using Python<br>
> 2.7 and NumPy 1.9.2 and have installed mpi4py. However, when I attempt to<br>
> install petsc4py (both with pip and distutils) I get a mpicc compiler error<br>
> due to undefined references/symbols. I have attached the output of running<br>
><br>
> pip install petsc petsc4py --allow-external petsc --allow-external petsc4py<br>
><br>
<br>
</div></div>I've never ever built or test petsc4py under Cygwin. The errors you<br>
see are expected.<br>
Perhaps you can manually workaround the issues following the following steps:<br>
<br>
1) Download the petsc4py tarball and unpack it.<br>
2) Open the file "src/libpetsc4py/libpetsc4py.h", add remove all<br>
occurences of DL_IMPORT, i.e, replace DL_IMPORT(XYZ) for just XYZ<br>
3) Use pip again:<br>
<br>
pip install petsc<br>
pip install .<br>
<br>
The last line assumes your current working directory is the one having<br>
petsc4py's setup.py<br>
<br>
Finally, I do not guarantee this will work. I'm just guessing,<br>
petsc4py never explicitly supported Windows and/or Cygwin.<br>
<br>
<br>
--<br>
Lisandro Dalcin<br>
============<br>
Research Scientist<br>
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)<br>
Numerical Porous Media Center (NumPor)<br>
King Abdullah University of Science and Technology (KAUST)<br>
<a href="http://numpor.kaust.edu.sa/" target="_blank">http://numpor.kaust.edu.sa/</a><br>
<br>
4700 King Abdullah University of Science and Technology<br>
al-Khawarizmi Bldg (Bldg 1), Office # 4332<br>
Thuwal 23955-6900, Kingdom of Saudi Arabia<br>
<a href="http://www.kaust.edu.sa" target="_blank">http://www.kaust.edu.sa</a><br>
<br>
Office Phone: <a href="tel:%2B966%2012%20808-0459" value="+966128080459" target="_blank">+966 12 808-0459</a><br>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>