[petsc-users] error compiling on MPI_Win

hbui hgbk2008 at gmail.com
Thu Jul 5 16:02:47 CDT 2012


Hi

When compiling a small petsc example, i got an error as such:

--------------------------------------------------------------------------------------
In file included from /opt/petsc/petsc-dev/include/petscis.h:8:0,
                  from /opt/petsc/petsc-dev/include/petscvec.h:9,
                  from /opt/petsc/petsc-dev/include/petscmat.h:6,
                  from /opt/petsc/petsc-dev/include/petscdm.h:6,
                  from /opt/petsc/petsc-dev/include/petscpc.h:6,
                  from /opt/petsc/petsc-dev/include/petscksp.h:6,
                  from ../PETScSolver.h:14,
                  from ../PETScSolver.cpp:8:
/opt/petsc/petsc-dev/include/petscsf.h:69:119: error: 'MPI_Win' has not 
been declared
/opt/petsc/petsc-dev/include/petscsf.h:70:80: error: 'MPI_Win' has not 
been declared
/opt/petsc/petsc-dev/include/petscsf.h:71:105: error: 'MPI_Win' has not 
been declared
In file included from /opt/petsc/petsc-dev/include/petscvec.h:482:0,
                  from /opt/petsc/petsc-dev/include/petscmat.h:6,
                  from /opt/petsc/petsc-dev/include/petscdm.h:6,
                  from /opt/petsc/petsc-dev/include/petscpc.h:6,
                  from /opt/petsc/petsc-dev/include/petscksp.h:6,
                  from ../PETScSolver.h:14,
                  from ../PETScSolver.cpp:8:
/opt/petsc/petsc-dev/include/petsc-private/vecimpl.h:498:3: error: 
'MPI_Win' does not name a type
--------------------------------------------------------------------------------------

I search over the mailing list and see a post which related to this 
error but i didn't quite understand the answer and the user has also 
discontinued the thread.
http://lists.mcs.anl.gov/pipermail/petsc-dev/2011-November/006227.html

I tried to trace back the definition of MPI_Win struct and see as below:

#ifndef PETSC_HAVE_MPI_WIN_CREATE
#define PETSC_HAVE_MPI_WIN_CREATE 1
#endif

#if !defined(PETSC_HAVE_MPI_WIN_CREATE) /* The intent here is to be able 
to compile even without a complete MPI. */
typedef struct MPI_Win_MISSING *MPI_Win;
#endif

For some reason the ./configure define PETSC_HAVE_MPI_WIN_CREATE and 
compiler skip the MPI_Win definition. However, i also don't know where 
the struct MPI_Win_MISSING is defined.

Please advise the method to resolve this compilation error.

My system is Ubuntu 12.04, Gcc 4.6.3.

Regards,
Giang Bui



More information about the petsc-users mailing list