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's _USE_EXTERNAL variables are confusing #3637

Closed
mathstuf opened this issue Oct 5, 2023 · 7 comments
Closed

CMake's _USE_EXTERNAL variables are confusing #3637

mathstuf opened this issue Oct 5, 2023 · 7 comments
Assignees
Labels
Component - Build CMake, Autotools Priority - 1. High 🔼 These are important issues that should be resolved in the next release Type - Improvement Improvements that don't add a new feature or functionality
Milestone

Comments

@mathstuf
Copy link
Contributor

mathstuf commented Oct 5, 2023

Describe the bug
The ZLIB_USE_EXTERNAL and SZIP_USE_EXTERNAL variables are confusingly named. They refer to "make a new external build and use it", not "use an external copy that has already been built". The hint in the docstring is that it uses "building", not "build", but this is far too subtle IMO. Especially when the behavior is such that if something fails, the associated functionality is just turned off with a warning message. If the functionality was requested, it should be a hard error if it cannot be made available to avoid surprises.

Expected behavior
If a feature is requested (say, HDF5_ENABLE_Z_LIB_SUPPORT), it should be an error if it is not found. Same with SZIP or any other filter requests. Additionally, docstrings and/or variable names could be more clear.

Platform (please complete the following information)

  • HDF5 version: 1.14.1
  • OS and version: macOS, Windows, Linux
  • Compiler and version: any
  • Build system (e.g. CMake, Autotools) and version: CMake
  • Any configure options you specified
  • MPI library and version (parallel HDF5): either; MPICH or MS-MPI
@derobins
Copy link
Member

derobins commented Oct 5, 2023

Agree this requires discussion. We're going to be setting up a recurring working group meeting to discuss filter issues (details TBD) and this should be one of the first things we discuss.

@derobins derobins added Priority - 1. High 🔼 These are important issues that should be resolved in the next release Component - Build CMake, Autotools Type - Improvement Improvements that don't add a new feature or functionality labels Oct 5, 2023
@byrnHDF
Copy link
Contributor

byrnHDF commented Oct 5, 2023

Looking at this, These options control whether cmake will only do a find package or use the EXTERNALPROJECT_ADD (now FETCHCONTENT) process.
I think the name could be changed to *_USE_FINDPACKAGE_ONLY, which would be the opposite logic.

@mathstuf
Copy link
Contributor Author

mathstuf commented Oct 5, 2023

Yep, that's what I thought they were at first (not that it was related to ExternalProject). The docstring didn't clue me in either.

@byrnHDF
Copy link
Contributor

byrnHDF commented Oct 5, 2023

Would adding, EXTERNALPROJECT_ADD (now FETCHCONTENT), help?

@byrnHDF
Copy link
Contributor

byrnHDF commented Oct 5, 2023

OR change the name?

@mathstuf
Copy link
Contributor Author

mathstuf commented Oct 5, 2023

For me, yes, that in the docstring would have helped. Not sure how useful it would be for non-CMake experts building HDF5 though. Something like:

option(HDF5_BUILD_OWN_<PKG> "Build a copy of <PKG> for use during the build" OFF)

would be more mechanism-agnostic too.

@derobins derobins added this to the 1.14.4 milestone Jan 19, 2024
@derobins derobins modified the milestones: 1.14.4, 1.14.5 Mar 23, 2024
@byrnHDF
Copy link
Contributor

byrnHDF commented May 21, 2024

Should be clearer with fix in #4512,

@byrnHDF byrnHDF closed this as completed Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Build CMake, Autotools Priority - 1. High 🔼 These are important issues that should be resolved in the next release Type - Improvement Improvements that don't add a new feature or functionality
Projects
None yet
Development

No branches or pull requests

3 participants