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
CMake: Adjust MPI and ZLIB support query for p4est version 2.8 #13374
Conversation
/rebuild |
FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING | ||
REGEX "#define.*P4EST_ENABLE_MPI") | ||
IF("${P4EST_MPI_STRING}" STREQUAL "") | ||
SET(P4EST_WITH_MPI FALSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this even possible? I didn't know you could compile p4est without MPI, and in any case, what would one want to use it for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is perfectly possible to compile P4est without MPI support:
https://github.com/cburstedde/p4est/blob/feature-cmake/cmake/options.cmake#L9
https://github.com/cburstedde/p4est/blob/master/src/p4est.c#L1297-L1327
P4est without MPI support isn't really useful for us. Because of that we require enabled MPI for P4est. 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fascinating. Why would one do that?
FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING | ||
REGEX "#define.*P4EST_ENABLE_MPI") | ||
IF("${P4EST_MPI_STRING}" STREQUAL "") | ||
SET(P4EST_WITH_MPI FALSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fascinating. Why would one do that?
@@ -123,7 +129,7 @@ IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h) | |||
# Is p4est built against zlib? | |||
# | |||
FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_ZLIB_STRING | |||
REGEX "#define.*P4EST_HAVE_ZLIB 1") | |||
REGEX "^#define.*P4EST_HAVE_ZLIB") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not important, but the C preprocessor syntax doesn't actually require the #
to appear at the top of the line (it just has to be the first non-space-non-tab of the line), and it can be followed by zero or more spaces. So technically, the regex isn't quite correct. But then if it works, that's good enough :-)
No description provided.