PETSc includes conflicting with MPI.h header

Issue #222 invalid
Paolo Crosetto created an issue

Hi, I don't know if anyone has the same problem.. but I noticed that if one includes the petsc header petscsys.h (which includes mpi.h) before the MPI.h header (e.g. like in PETScSNESSolver.cpp), then compilation errors pop up.

error: expected primary-expression before ‘’ token OMPI_DECLSPEC int MPI_Comm_create_errhandler(MPI_Comm_errhandler_function function,

this does not happen if the header petscsys.h is included after MPI.h. Bye, Paolo

Comments (3)

  1. Paolo Crosetto reporter

    Hi. Sorry for the late reply.. I only have one openmpi version. But if noone else has this problem it must be something I did wrong... maybe some versions dependency that I didn't respect. For the moment I "solved" it by adding/swapping MPI headers in some header files. Thanks for the reply.

  2. Log in to comment