mpicc errors on installation

Issue #41 resolved
Nicholas Knezek created an issue

I've tried to install petsc4py 3.6.0 from both pip (using URL) and compiling from source with the same error given: "error: command 'mpicc' failed with exit status 1".

I'm running Mac Os X10.11.3 and am trying to use petsc4py. I use HomeBrew and pip to manage most installations, but installed PETSc by hand to enable complex scalars. PETSc 3.6.3 is installed using make with mpicc (mpich2), gcc, and gfortran and configured to run with double-precision complex variables.

I'm using versions: PETSc: 3.6.3 petsc4py: 3.6.0 python: 2.7.10 cython: 0.23.4 mpi4py: 2.0.0 mpich2: 3.2 gcc: 5.3.0

I have also tried using open-MPI instead of mpich2 and re-installing PETSc before trying petsc4py. It failed with the same error. I've attached the console output that occurs when I run "setup.py build" below.

Any suggestions?

$ ./setup.py build
running build
running build_src
running build_py
running build_ext
PETSC_DIR:   /Users/nknezek/petsc-3.6.3
PETSC_ARCH:  arch-darwin-c-debug
version:     3.6.3 release
scalar-type: complex
precision:   double
language:    CONLY
compiler:    mpicc
linker:      mpicc
building 'PETSc' extension
mpicc -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3 -O0 -arch x86_64 -arch i386 -pipe -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -DENABLE_DTRACE -DPETSC_DIR=/Users/nknezek/petsc-3.6.3 -I/usr/local/Cellar/mpich/3.2/include -I/opt/X11/include -I/Users/nknezek/petsc-3.6.3/arch-darwin-c-debug/include -I/Users/nknezek/petsc-3.6.3/include -Isrc/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/PETSc.c -o build/temp.macosx-10.11-intel-2.7/arch-darwin-c-debug/src/PETSc.o
In file included from src/PETSc.c:3:
In file included from src/petsc4py.PETSc.c:243:
In file included from src/include/petsc4py/numpy.h:11:
In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/arrayobject.h:4:
In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarraytypes.h:1760:
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/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:10305:125: error: too many arguments to function call, expected 4, have 5
  ...__pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetBool(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))...
                                     ~~~~~~~~~~~~~~~~~~~                                                           ^~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:11:1: note: 'PetscOptionsGetBool' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsGetBool(const char[],const char [],PetscBool  *,PetscBool *);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:10429:124: error: too many arguments to function call, expected 4, have 5
  ...__pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetInt(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag)))...
                                     ~~~~~~~~~~~~~~~~~~                                                           ^~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:10:1: note: 'PetscOptionsGetInt' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsGetInt(const char[],const char [],PetscInt *,PetscBool *);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:10553:125: error: too many arguments to function call, expected 4, have 5
  ...__pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetReal(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))...
                                     ~~~~~~~~~~~~~~~~~~~                                                           ^~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:12:1: note: 'PetscOptionsGetReal' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsGetReal(const char[],const char[],PetscReal *,PetscBool *);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:10677:127: error: too many arguments to function call, expected 4, have 5
  ...PetscOptionsGetScalar(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == -...
     ~~~~~~~~~~~~~~~~~~~~~                                                           ^~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:13:1: note: 'PetscOptionsGetScalar' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsGetScalar(const char[],const char[],PetscScalar *,PetscBool *);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:10792:131: error: too many arguments to function call, expected 5, have 6
  ...PetscOptionsGetString(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, __pyx_v_value, 0x400, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 ...
     ~~~~~~~~~~~~~~~~~~~~~                                                               ^~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:18:1: note: 'PetscOptionsGetString' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsGetString(const char[],const char[],char[],size_t,PetscBool *);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:50601:21: error: assigning to 'PetscOptions' (aka 'struct _p_PetscOptions') from incompatible type 'void *'
  __pyx_v_self->opt = NULL;
                    ^ ~~~~
src/petsc4py.PETSc.c:50666:35: error: invalid operands to binary expression ('PetscOptions' (aka 'struct _p_PetscOptions') and
      'void *')
  __pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0);
                ~~~~~~~~~~~~~~~~~ ^  ~~~~
src/petsc4py.PETSc.c:50678:67: error: too many arguments to function call, expected 0, have 1
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsDestroy((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == -1)) {__py...
                                              ~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:41:1: note: 'PetscOptionsDestroy' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsDestroy(void);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:51284:35: error: invalid operands to binary expression ('PetscOptions' (aka 'struct _p_PetscOptions') and
      'void *')
  __pyx_t_1 = ((__pyx_v_self->opt != NULL) != 0);
                ~~~~~~~~~~~~~~~~~ ^  ~~~~
src/petsc4py.PETSc.c:51298:66: error: too many arguments to function call, expected 0, have 1
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsCreate((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == -1)) {__pyx...
                                              ~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:34:1: note: 'PetscOptionsCreate' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsCreate(void);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:51372:35: error: invalid operands to binary expression ('PetscOptions' (aka 'struct _p_PetscOptions') and
      'void *')
  __pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0);
                ~~~~~~~~~~~~~~~~~ ^  ~~~~
src/petsc4py.PETSc.c:51386:67: error: too many arguments to function call, expected 0, have 1
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsDestroy((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == -1)) {__py...
                                              ~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:41:1: note: 'PetscOptionsDestroy' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsDestroy(void);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:51460:35: error: invalid operands to binary expression ('PetscOptions' (aka 'struct _p_PetscOptions') and
      'void *')
  __pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0);
                ~~~~~~~~~~~~~~~~~ ^  ~~~~
src/petsc4py.PETSc.c:51474:65: error: too many arguments to function call, expected 0, have 1
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsClear(__pyx_v_self->opt)); if (unlikely(__pyx_t_2 == -1)) {__pyx_fil...
                                              ~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:42:1: note: 'PetscOptionsClear' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsClear(void);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:51620:83: error: too many arguments to function call, expected 1, have 2
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsView(__pyx_v_self->opt, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == -1)...
                                              ~~~~~~~~~~~~~~~~                    ^~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:32:1: note: 'PetscOptionsView' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsView(PetscViewer);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:51683:74: error: too many arguments to function call, expected 0, have 1
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsSetFromOptions(__pyx_v_self->opt)); if (unlikely(__pyx_t_1 == -1)) {...
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:280:1: note: 'PetscOptionsSetFromOptions' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsSetFromOptions(void);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:51818:89: error: too many arguments to function call, expected 1, have 2
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsPrefixPush(__pyx_v_self->opt, __pyx_v_cprefix)); if (unlikely(__pyx_...
                                              ~~~~~~~~~~~~~~~~~~~~~~                    ^~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:43:1: note: 'PetscOptionsPrefixPush' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsPrefixPush(const char[]);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:51883:69: error: too many arguments to function call, expected 0, have 1
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsPrefixPop(__pyx_v_self->opt)); if (unlikely(__pyx_t_1 == -1)) {__pyx...
                                              ~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:44:1: note: 'PetscOptionsPrefixPop' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsPrefixPop(void);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
In file included from src/PETSc.c:3:
src/petsc4py.PETSc.c:52030:110: error: too many arguments to function call, expected 3, have 4
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsHasName(__pyx_v_self->opt, __pyx_v_pr, __pyx_v_nm, (&__pyx_v_flag))); ...
                                              ~~~~~~~~~~~~~~~~~~~                                            ^~~~~~~~~~~~~~~
/Users/nknezek/petsc-3.6.3/include/petscoptions.h:9:1: note: 'PetscOptionsHasName' declared here
PETSC_EXTERN PetscErrorCode PetscOptionsHasName(const char[],const char[],PetscBool *);
^
/Users/nknezek/petsc-3.6.3/include/petscsys.h:83:22: note: expanded from macro 'PETSC_EXTERN'
#define PETSC_EXTERN extern PETSC_VISIBILITY_PUBLIC
                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
error: command 'mpicc' failed with exit status 1

Comments (5)

  1. Lisandro Dalcin

    To build from a git clone and build with PETSc 3.6.3 release, please switch first to branch maint, i.e.

    $ git checkout maint
    $ python setup.py build
    
  2. Nicholas Knezek reporter

    issue was resolved by using petsc4py "maint" branch and downgrading SLEPc and PETSc to 3.6.0 to resolve other issues with slepc4py compatibility.

  3. Log in to comment