home-brew and petsc4py after petsc update
I am trying to reinstall petsc4py after a home-brew update of the petsc library. First I tried to use pip with
pip uninstall petsc4py pip install petsc4py
There are no errors, but when running pets4py.init() in python it claims:
Python 2.7.9 (default, Feb 10 2015, 03:28:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import petsc4py petsc4py.init() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/petsc4py/init.py", line 67, in init _petsc = petsc4py.lib.Import(arch) File "/usr/local/lib/python2.7/site-packages/petsc4py/lib/init.py", line 60, in Import fo, fn, stuff = imp.find_module('_petscext', [mpath]) ImportError: No module named _petscext
After that I tried to install petsc4py from source, but it seems that the folder structure of petsc has changed. I had to change all "$PETSC_DIR/lib/petsc-conf/" references in petsc4py/conf/baseconf.py to "$PETSC_DIR/conf/". That seem to work but there are still build errors:
localhost:get pegalus$ python setup.py build
running build
running build_src
running build_py
running build_ext
PETSC_DIR: /usr/local/Cellar/petsc/3.5.3_2/complex
PETSC_ARCH:
version: 3.5.3 release
scalar-type: complex
precision: double
language: CONLY
compiler: /usr/local/bin/mpicc
linker: /usr/local/bin/mpicc
building 'PETSc' extension
creating build/temp.macosx-10.10-x86_64-2.7
creating build/temp.macosx-10.10-x86_64-2.7/src
/usr/local/bin/mpicc -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -DPETSC_DIR=/usr/local/Cellar/petsc/3.5.3_2/complex -I/usr/local/Cellar/open-mpi/1.8.4/include -I/usr/local/opt/hdf5/include -I/usr/local/opt/netcdf/include -I/usr/local/opt/fftw/include -I/usr/local/opt/metis/include -I/usr/local/opt/parmetis/include -I/usr/local/opt/superlu_dist/include/superlu_dist -I/usr/local/opt/superlu/include/superlu -I/usr/local/opt/suite-sparse/include -I/usr/local/opt/mumps/include -I/usr/local/Cellar/petsc/3.5.3_2/complex/include -Isrc/include -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/PETSc.c -o build/temp.macosx-10.10-x86_64-2.7/src/PETSc.o
In file included from src/PETSc.c:3:
In file included from src/petsc4py.PETSc.c:249:
src/include/custom.h:587:10: warning: implicit declaration of function
'DMSetDimension' is invalid in C99 [-Wimplicit-function-declaration]
ierr = DMSetDimension(da,dim);CHKERRQ(ierr);
^
In file included from src/PETSc.c:3:
In file included from src/petsc4py.PETSc.c:251:
In file included from src/include/petsc4py/numpy.h:11:
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:
/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning:
"Using deprecated NumPy API, disable it by " "#defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by " \
^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:894:3: error: unknown type name 'PetscPartitioner'
PetscPartitioner part;
^
src/petsc4py.PETSc.c:2281:66: error: a parameter list without types is only
allowed in a function definition
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New(PetscPa...
^
src/petsc4py.PETSc.c:2282:8: error: unknown type name 'PetscPartitioner'
static PetscPartitioner __pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get(...
^
What am I doing wrong?
Comments (2)
-
-
- changed status to resolved
- Log in to comment
I've just released petsc4py 3.6.0. It should work with latest petsc 3.6.0. I'll close this issue, if thing still do not work, please let me know.