Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindPETSc tests fail with missing include <mpi.h> #32

Open
fsimonis opened this issue Nov 30, 2018 · 5 comments
Open

FindPETSc tests fail with missing include <mpi.h> #32

fsimonis opened this issue Nov 30, 2018 · 5 comments

Comments

@fsimonis
Copy link

FindPETSc does not respect MPI include paths and therefore fails to compile the tests on systems with scoped mpi installs such as OpenMPI on Ubuntu 16.04 (/usr/include/openmpi/mpi.h)

It should include MPI_INCLUDE_DIRS, or similar here.

set (petsc_includes_minimal ${PETSC_INCLUDE_CONF} ${PETSC_INCLUDE_DIR})

A possible solution is to adapt FindPETSc to call FindMPI internally.

@jedbrown
Copy link
Owner

jedbrown commented Nov 30, 2018 via email

@fsimonis
Copy link
Author

fsimonis commented Dec 5, 2018

Are you referring to the version prior to the rewrite that came with 3.10 or in general?

@jedbrown
Copy link
Owner

jedbrown commented Dec 5, 2018

@fsimonis My experience is prior to that merge, but we're currently using cmake_policy(VERSION 3.3) and I think it's more hardship than it's worth to require people to upgrade CMake to gratuitously use a module that has amassed a decade of ill-will for creating inconsistencies where the less-typing method (CC=) has been more reliable.

@fsimonis
Copy link
Author

@jedbrown Fair enough.

The error message is misleading though as the tests fail due to the missing include and not a faulty PETSc install. The root of the problem is only visible by inspecting the error logs.
I suggest adding a trivial check to make sure the compiler can find the header:

#include <mpi.h>
int main() { return 0; }

@jedbrown
Copy link
Owner

jedbrown commented Dec 10, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants