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

CMake: Adjust MPI and ZLIB support query for p4est version 2.8 #13374

Merged
merged 1 commit into from Feb 16, 2022

Conversation

tamiko
Copy link
Member

@tamiko tamiko commented Feb 14, 2022

No description provided.

@tamiko
Copy link
Member Author

tamiko commented Feb 14, 2022

/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)
Copy link
Member

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?

Copy link
Member Author

@tamiko tamiko Feb 14, 2022

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. 😸

Copy link
Member

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)
Copy link
Member

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")
Copy link
Member

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 :-)

@bangerth bangerth merged commit ab8db4b into dealii:master Feb 16, 2022
@tamiko tamiko deleted the p4est_compatibility branch November 30, 2022 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants