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

Remove CMake test for MPI_SEEK_SET or make it more portable #14922

Closed
sloede opened this issue Mar 20, 2023 · 1 comment · Fixed by #14923
Closed

Remove CMake test for MPI_SEEK_SET or make it more portable #14922

sloede opened this issue Mar 20, 2023 · 1 comment · Fixed by #14923

Comments

@sloede
Copy link
Contributor

sloede commented Mar 20, 2023

The FindMPI module for CMake includes a test for the presence of MPI_SEEK_SET:

CHECK_CXX_SOURCE_COMPILES(
"
#include <mpi.h>
#ifndef MPI_SEEK_SET
# error
#endif
int main() {}
"
MPI_HAVE_MPI_SEEK_SET
)

The test requires MPI_SEEK_SET to be a preprocessor definition, which is more restrictive than what the MPI standard mandates. This causes problems with MPI implementations such as MPItrampoline, which defines it as

extern int MPI_SEEK_SET;

A quick grep on the sources for deal.II v9.4.1 shows that MPI_SEEK_SET does not seem to be used (and neither are MPI_SEEK_CUR or MPI_SEEK_END). Thus my question is: Would it be possible to remove this test altogether? Or, if it is still needed, could it be changed to something that would work for MPItrampoline, e.g.,

CHECK_CXX_SOURCE_COMPILES(
  "
  #include <mpi.h>
  int main() {
    MPI_SEEK_SET;
  }
  "
  MPI_HAVE_MPI_SEEK_SET
  )

cc @eschnett

@masterleinad
Copy link
Member

The last occurrence was removed in abbca77. I would think it's OK to remove the check now.

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