[petsc-users] petsc4py installation error with PETSc v 3.6.1

Justin Chang jychang48 at gmail.com
Fri Jul 24 16:12:21 CDT 2015


Hi again,

I am getting another error related to petsc4py. It happens when I updated
to the latest version:

Traceback (most recent call last):
  File "/usr/local/bin/py.test", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 18, in
main
    config = _prepareconfig(args, plugins)
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 62, in
_prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "/usr/lib/python2.7/dist-packages/_pytest/core.py", line 376, in
__call__
    return self._docall(methods, kwargs)
  File "/usr/lib/python2.7/dist-packages/_pytest/core.py", line 387, in
_docall
    res = mc.execute()
  File "/usr/lib/python2.7/dist-packages/_pytest/core.py", line 288, in
execute
    res = method(**kwargs)
  File "/usr/lib/python2.7/dist-packages/_pytest/helpconfig.py", line 25,
in pytest_cmdline_parse
    config = __multicall__.execute()
  File "/usr/lib/python2.7/dist-packages/_pytest/core.py", line 288, in
execute
    res = method(**kwargs)
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 617, in
pytest_cmdline_parse
    self.parse(args)
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 710, in
parse
    self._preparse(args)
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 690, in
_preparse
    args=args, parser=self._parser)
  File "/usr/lib/python2.7/dist-packages/_pytest/core.py", line 376, in
__call__
    return self._docall(methods, kwargs)
  File "/usr/lib/python2.7/dist-packages/_pytest/core.py", line 387, in
_docall
    res = mc.execute()
  File "/usr/lib/python2.7/dist-packages/_pytest/core.py", line 288, in
execute
    res = method(**kwargs)
  File "/usr/lib/python2.7/dist-packages/_pytest/capture.py", line 42, in
pytest_load_initial_conftests
    return __multicall__.execute()
  File "/usr/lib/python2.7/dist-packages/_pytest/core.py", line 288, in
execute
    res = method(**kwargs)
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 673, in
pytest_load_initial_conftests
    self._conftest.setinitial(args)
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 486, in
setinitial
    self._try_load_conftest(anchor)
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 492, in
_try_load_conftest
    self._path2confmods[None] = self.getconftestmodules(anchor)
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 511, in
getconftestmodules
    clist.append(self.importconftest(conftestpath))
  File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 537, in
importconftest
    self._conftestpath2mod[conftestpath] = mod = conftestpath.pyimport()
  File "/usr/lib/python2.7/dist-packages/py/_path/local.py", line 620, in
pyimport
    __import__(modname)
  File "/home/justin/Software/firedrake-deps/PyOP2/test/conftest.py", line
40, in <module>
    from pyop2 import op2
  File "/home/justin/Software/firedrake-deps/PyOP2/pyop2/__init__.py", line
9, in <module>
    from op2 import *
  File "/home/justin/Software/firedrake-deps/PyOP2/pyop2/op2.py", line 39,
in <module>
    import base
  File "/home/justin/Software/firedrake-deps/PyOP2/pyop2/base.py", line 56,
in <module>
    from sparsity import build_sparsity
  File "PETSc.pxd", line 70, in init pyop2.sparsity
(pyop2/sparsity.cpp:22252)
  File "/usr/local/lib/python2.7/dist-packages/petsc4py/PETSc.py", line 3,
in <module>
    PETSc = ImportPETSc(ARCH)
  File "/usr/local/lib/python2.7/dist-packages/petsc4py/lib/__init__.py",
line 29, in ImportPETSc
    return Import('petsc4py', 'PETSc', path, arch)
  File "/usr/local/lib/python2.7/dist-packages/petsc4py/lib/__init__.py",
line 64, in Import
    module = imp.load_module(fullname, fo, fn, stuff)
ImportError:
/usr/local/lib/python2.7/dist-packages/petsc4py/lib/arch-linux2-c-opt/PETSc.so:
undefined symbol: DMShellSetCreateSubDM
make: *** [unit_sequential] Error 1


Any idea on how to fix this? Thanks,

Justin

On Wednesday, July 22, 2015, Justin Chang <jychang48 at gmail.com> wrote:

> Alright got it, thanks!
>
> On Wed, Jul 22, 2015 at 7:44 PM, Satish Balay <balay at mcs.anl.gov
> <javascript:_e(%7B%7D,'cvml','balay at mcs.anl.gov');>> wrote:
>
>> You can apply the patch with the 'patch' command
>>
>> cd petsc4py
>> patch -Np1 < petsc4py.patch
>>
>> Satish
>>
>> On Wed, 22 Jul 2015, Justin Chang wrote:
>>
>> > How do I use this again?
>> >
>> > On Wednesday, July 22, 2015, Satish Balay <balay at mcs.anl.gov
>> <javascript:_e(%7B%7D,'cvml','balay at mcs.anl.gov');>> wrote:
>> >
>> > > The attached patch to petsc4py should fix the error.
>> > >
>> > > Satish
>> > >
>> > > On Wed, 22 Jul 2015, Justin Chang wrote:
>> > >
>> > > > Hi all,
>> > > >
>> > > > Just installed the latest petsc-dev, and when I tried to build
>> petsc4py
>> > > via
>> > > > git clone ... and pip setup.py build  i get the following errors:
>> > > >
>> > > > ====
>> > > >
>> > > > running build
>> > > >
>> > > > running build_src
>> > > >
>> > > > cythonizing 'petsc4py.PETSc.pyx' -> 'petsc4py.PETSc.c'
>> > > >
>> > > > cythonizing 'libpetsc4py/libpetsc4py.pyx' ->
>> 'libpetsc4py/libpetsc4py.c'
>> > > >
>> > > > running build_py
>> > > >
>> > > > creating build
>> > > >
>> > > > creating build/lib.linux-x86_64-2.7
>> > > >
>> > > > creating build/lib.linux-x86_64-2.7/petsc4py
>> > > >
>> > > > copying src/PETSc.py -> build/lib.linux-x86_64-2.7/petsc4py
>> > > >
>> > > > copying src/__init__.py -> build/lib.linux-x86_64-2.7/petsc4py
>> > > >
>> > > > copying src/__main__.py -> build/lib.linux-x86_64-2.7/petsc4py
>> > > >
>> > > > creating build/lib.linux-x86_64-2.7/petsc4py/lib
>> > > >
>> > > > copying src/lib/__init__.py ->
>> build/lib.linux-x86_64-2.7/petsc4py/lib
>> > > >
>> > > > creating build/lib.linux-x86_64-2.7/petsc4py/include
>> > > >
>> > > > creating build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/include/petsc4py/numpy.h ->
>> > > > build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/include/petsc4py/petsc4py.h ->
>> > > > build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/include/petsc4py/petsc4py.PETSc.h ->
>> > > > build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/include/petsc4py/petsc4py.PETSc_api.h ->
>> > > > build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/include/petsc4py/petsc4py.i ->
>> > > > build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/include/petsc4py/PETSc.pxd ->
>> > > > build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/include/petsc4py/__init__.pxd ->
>> > > > build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/include/petsc4py/__init__.pyx ->
>> > > > build/lib.linux-x86_64-2.7/petsc4py/include/petsc4py
>> > > >
>> > > > copying src/lib/petsc.cfg -> build/lib.linux-x86_64-2.7/petsc4py/lib
>> > > >
>> > > > running build_ext
>> > > >
>> > > > PETSC_DIR:   /home/jchang23/petsc-dev
>> > > >
>> > > > PETSC_ARCH:  arch-linux2-c-opt
>> > > >
>> > > > version:     3.6.1 development
>> > > >
>> > > > scalar-type: real
>> > > >
>> > > > precision:   double
>> > > >
>> > > > language:    CONLY
>> > > >
>> > > > compiler:    /share/apps/openmpi-1.8.3/bin/mpicc
>> > > >
>> > > > linker:      /share/apps/openmpi-1.8.3/bin/mpicc
>> > > >
>> > > > building 'PETSc' extension
>> > > >
>> > > > creating build/temp.linux-x86_64-2.7
>> > > >
>> > > > creating build/temp.linux-x86_64-2.7/arch-linux2-c-opt
>> > > >
>> > > > creating build/temp.linux-x86_64-2.7/arch-linux2-c-opt/src
>> > > >
>> > > > /share/apps/openmpi-1.8.3/bin/mpicc -pthread -fPIC -O -fPIC
>> > > > -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
>> > > > -DPETSC_DIR=/home/jchang23/petsc-dev
>> -I/share/apps/openmpi-1.8.3/include
>> > > > -I/home/jchang23/petsc-dev/arch-linux2-c-opt/include
>> > > > -I/home/jchang23/petsc-dev/include -Isrc/include
>> > > >
>> -I/home/jchang23/.local/lib/python2.7/site-packages/numpy/core/include
>> > > > -I/home/jchang23/.local/include/python2.7 -c src/PETSc.c -o
>> > > > build/temp.linux-x86_64-2.7/arch-linux2-c-opt/src/PETSc.o
>> > > >
>> > > > In file included from
>> > > >
>> > >
>> /home/jchang23/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
>> > > >
>> > > >                  from
>> > > >
>> > >
>> /home/jchang23/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
>> > > >
>> > > >                  from
>> > > >
>> > >
>> /home/jchang23/.local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
>> > > >
>> > > >                  from src/include/petsc4py/numpy.h:11,
>> > > >
>> > > >                  from src/petsc4py.PETSc.c:258,
>> > > >
>> > > >                  from src/PETSc.c:3:
>> > > >
>> > > >
>> > >
>> /home/jchang23/.local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2:
>> > > > warning: #warning "Using deprecated NumPy API, disable it by "
>> "#defining
>> > > > NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
>> > > >
>> > > >  #warning "Using deprecated NumPy API, disable it by " \
>> > > >
>> > > >   ^
>> > > >
>> > > > In file included from src/PETSc.c:3:0:
>> > > >
>> > > > src/petsc4py.PETSc.c: In function
>> > > > ‘__pyx_pf_8petsc4py_5PETSc_7Section_76createGlobalSection’:
>> > > >
>> > > > src/petsc4py.PETSc.c:108243:47: error: incompatible type for
>> argument 4
>> > > of
>> > > > ‘PetscSectionCreateGlobalSection’
>> > > >
>> > > >    __pyx_t_2 =
>> > > >
>> > >
>> __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreateGlobalSection(__pyx_v_self->sec,
>> > > > __pyx_v_sf->sf, PETSC_FALSE, (&__pyx_v_gsec->sec))); if
>> > > (unlikely(__pyx_t_2
>> > > > == -1)) {__pyx_filename = __pyx_f[32]; __pyx_lineno = 213;
>> __pyx_clineno
>> > > =
>> > > > __LINE__; goto __pyx_L1_error;}
>> > > >
>> > > >                                                ^
>> > > >
>> > > > In file included from
>> /home/jchang23/petsc-dev/include/petscvec.h:9:0,
>> > > >
>> > > >                  from /home/jchang23/petsc-dev/include/petscmat.h:6,
>> > > >
>> > > >                  from /home/jchang23/petsc-dev/include/petscdm.h:6,
>> > > >
>> > > >                  from
>> /home/jchang23/petsc-dev/include/petscdmda.h:4,
>> > > >
>> > > >                  from /home/jchang23/petsc-dev/include/petsc.h:12,
>> > > >
>> > > >                  from src/petsc4py.PETSc.c:254,
>> > > >
>> > > >                  from src/PETSc.c:3:
>> > > >
>> > > > /home/jchang23/petsc-dev/include/petscis.h:334:29: note: expected
>> > > > ‘PetscBool’ but argument is of type ‘struct _p_PetscSection **’
>> > > >
>> > > >  PETSC_EXTERN PetscErrorCode
>> > > PetscSectionCreateGlobalSection(PetscSection,
>> > > > PetscSF, PetscBool, PetscBool, PetscSection *);
>> > > >
>> > > >                              ^
>> > > >
>> > > > In file included from src/PETSc.c:3:0:
>> > > >
>> > > > src/petsc4py.PETSc.c:108243:47: error: too few arguments to function
>> > > > ‘PetscSectionCreateGlobalSection’
>> > > >
>> > > >    __pyx_t_2 =
>> > > >
>> > >
>> __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreateGlobalSection(__pyx_v_self->sec,
>> > > > __pyx_v_sf->sf, PETSC_FALSE, (&__pyx_v_gsec->sec))); if
>> > > (unlikely(__pyx_t_2
>> > > > == -1)) {__pyx_filename = __pyx_f[32]; __pyx_lineno = 213;
>> __pyx_clineno
>> > > =
>> > > > __LINE__; goto __pyx_L1_error;}
>> > > >
>> > > >                                                ^
>> > > >
>> > > > In file included from
>> /home/jchang23/petsc-dev/include/petscvec.h:9:0,
>> > > >
>> > > >                  from /home/jchang23/petsc-dev/include/petscmat.h:6,
>> > > >
>> > > >                  from /home/jchang23/petsc-dev/include/petscdm.h:6,
>> > > >
>> > > >                  from
>> /home/jchang23/petsc-dev/include/petscdmda.h:4,
>> > > >
>> > > >                  from /home/jchang23/petsc-dev/include/petsc.h:12,
>> > > >
>> > > >                  from src/petsc4py.PETSc.c:254,
>> > > >
>> > > >                  from src/PETSc.c:3:
>> > > >
>> > > > /home/jchang23/petsc-dev/include/petscis.h:334:29: note: declared
>> here
>> > > >
>> > > >  PETSC_EXTERN PetscErrorCode
>> > > PetscSectionCreateGlobalSection(PetscSection,
>> > > > PetscSF, PetscBool, PetscBool, PetscSection *);
>> > > >
>> > > > error: command '/share/apps/openmpi-1.8.3/bin/mpicc' failed with
>> exit
>> > > > status 1
>> > > >
>> > > >
>> > > > =========
>> > > >
>> > > > I am guessing it's because PetscSectionCreateGlobalSection has
>> changed in
>> > > > this latest released. Is there a way to fix this?
>> > > >
>> > > > Thanks,
>> > > >
>> > > > Justin
>> > > >
>> > >
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150724/d8eab3ae/attachment-0001.html>


More information about the petsc-users mailing list