On Thu, Jun 11, 2015 at 5:07 AM, Mikhail Khodak <mkhodak@princeton.edu> wrote:
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.

The MPI routines will not work until after

import petsc4py, sys
petsc4py.init(sys.argv)
from petsc4py import PETSc

If they fail after this, it is usually a mismatch between the mpiexec being used and the MPI
libraries being linked.

  Thanks,

    Matt

Thanks again,
Mikhail Khodak

On Mon, Jun 8, 2015 at 5:11 AM, Lisandro Dalcin <dalcinl@gmail.com> wrote:
On 8 June 2015 at 02:50, Mikhail Khodak <mkhodak@princeton.edu> wrote:
> Hello, I am trying to build petsc4py-3.5.1 using Cygwin on 64-bit Windows 7.
> I have built PETSc 3.5.4 with shared and dynamic libraries using
> mpich2-1.2.1 and successfully ran the installation tests. I am using Python
> 2.7 and NumPy 1.9.2 and have installed mpi4py. However, when I attempt to
> install petsc4py (both with pip and distutils) I get a mpicc compiler error
> due to undefined references/symbols. I have attached the output of running
>
> pip install petsc petsc4py --allow-external petsc --allow-external petsc4py
>

I've never ever built or test petsc4py under Cygwin. The errors you
see are expected.
Perhaps you can manually workaround the issues following the following steps:

1) Download the petsc4py tarball and unpack it.
2) Open the file "src/libpetsc4py/libpetsc4py.h", add remove all
occurences of DL_IMPORT, i.e, replace DL_IMPORT(XYZ) for just XYZ
3) Use pip again:

pip install petsc
pip install .

The last line assumes your current working directory is the one having
petsc4py's setup.py

Finally, I do not guarantee this will work. I'm just guessing,
petsc4py never explicitly supported Windows and/or Cygwin.


--
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Numerical Porous Media Center (NumPor)
King Abdullah University of Science and Technology (KAUST)
http://numpor.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459




--
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener