-
Notifications
You must be signed in to change notification settings - Fork 708
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,7 +114,13 @@ IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h) | |
FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING | ||
REGEX "#define.*P4EST_MPI 1") | ||
IF("${P4EST_MPI_STRING}" STREQUAL "") | ||
SET(P4EST_WITH_MPI FALSE) | ||
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) | ||
ELSE() | ||
SET(P4EST_WITH_MPI TRUE) | ||
ENDIF() | ||
ELSE() | ||
SET(P4EST_WITH_MPI TRUE) | ||
ENDIF() | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Not important, but the C preprocessor syntax doesn't actually require the |
||
IF("${P4EST_ZLIB_STRING}" STREQUAL "") | ||
SET(P4EST_WITH_ZLIB FALSE) | ||
ELSE() | ||
|
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?