-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
Support CMake VOL builds with FetchContent from local directory #3455
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bf7cd4c
Update VOL CMake for REST VOL
mattjala 5c5c3f1
Prevent linking static libs to VOLs
mattjala 78960af
index on fetch_local: 5c5c3f1505 Prevent linking static libs to VOLs
mattjala 9a36d3e
On fetch_local: WIP:add source dir fetch option for vols
mattjala bf3e96d
index on (no branch): 9a36d3e7b1 On fetch_local: WIP:add source dir f…
mattjala d6973a4
On (no branch): again
mattjala c86f9af
Allow building of VOL from local source
mattjala 0bc6bcb
Support CMake VOL builds from local dir
mattjala 1768dc8
Support CMake VOL builds from local dir
mattjala b2106f4
Merge branch 'local_vol' of https://github.com/mattjala/hdf5 into loc…
mattjala 0af4447
Move LOCAL_DIR option to HDF5_VOL_ALLOW_EXTERNAL
mattjala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,10 +26,13 @@ two CMake variables must first be set: | |
|
||
HDF5_ALLOW_EXTERNAL_SUPPORT (Default: "NO") | ||
This variable is a string that specifies the manner in which the source code for | ||
an external VOL connector will be retrieved. Currently, this variable must be set | ||
to "GIT" for building external VOL connectors. | ||
an external VOL connector will be retrieved. This variable must be set | ||
to "GIT" for building external VOL connectors from a Github repository, or | ||
set to "LOCAL_DIR" to build from a local source directory. | ||
|
||
Once the `HDF5_VOL_ALLOW_EXTERNAL` option is set to ON and the `HDF5_ALLOW_EXTERNAL_SUPPORT` | ||
### Building | ||
|
||
If the `HDF5_VOL_ALLOW_EXTERNAL` option is set to ON and the `HDF5_ALLOW_EXTERNAL_SUPPORT` | ||
variable is set to "GIT", the CMake cache will be populated with a predefined | ||
(currently 10) amount of new variables, named: | ||
|
||
|
@@ -49,26 +52,44 @@ For each URL specified, HDF5's CMake code will attempt to use CMake's | |
[FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) | ||
functionality to retrieve the source code for a VOL connector pointed to by | ||
that URL and will try to build that VOL connector as part of the HDF5 library | ||
build process. The VOL connector must be able to be built by CMake and currently | ||
build process. | ||
|
||
If `HDF5_ALLOW_EXTERNAL_SUPPORT` is set to "LOCAL_DIR", then the CMake cache | ||
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. Please see the existing use of HDF5_ALLOW_EXTERNAL_SUPPORT; these changes are overwriting current usage reqs. |
||
will instead be populated with the variables: | ||
|
||
HDF5_VOL_PATH01 | ||
HDF5_VOL_PATH02 | ||
HDF5_VOL_PATH03 | ||
... | ||
|
||
For each of these variables, an absolute path that points to a local | ||
directory containing source code for an HDF5 VOL connector | ||
can be specified. For example, to specify a local clone of the | ||
REST VOL connector stored under one's home directory, one can provide | ||
the following option to `cmake`: | ||
|
||
-DHDF5_VOL_PATH01=/home/vol-rest | ||
|
||
Regardless of the method used to obtain the VOL source code, | ||
the VOL connector must be able to be built by CMake and currently | ||
must have a CMakeLists.txt file in the top level of the source tree in order to | ||
be buildable by this process. If the source code for a VOL connector is successfully | ||
retrieved, the HDF5 build's CMake cache will be populated with variables from | ||
the VOL connector's CMake code, as if one were building the connector by itself. | ||
This gives one the ability to customize the build of the connector as usual. | ||
|
||
The CMake cache will also be populated with a few new variables for each VOL | ||
connector that was successfully retrieved from a given URL. To generate these | ||
variables, the CMake code first creates an internal name for the VOL connector | ||
connector that was successfully retrieved. To generate these | ||
variables, the CMake code first creates an internal name for the VOL connector. | ||
If the source was retrieved from a URL, then the name is generated | ||
by stripping off the last part of the Git repository URL given for the connector, | ||
removing the ".git" suffix and any whitespace and then upper-casing the result. | ||
For example, the name of the VOL connector located at the URL | ||
https://github.com/hpc-io/vol-async.git would become "VOL-ASYNC". Then, the following | ||
new variables get created: | ||
https://github.com/hpc-io/vol-async.git would become "VOL-ASYNC". If the source was | ||
retrieved from a local directory, then the source directory's name is trimmed of whitespace, | ||
upper-cased, and has any trailing slashes removed. | ||
|
||
HDF5_VOL_<VOL name>_BRANCH (Default: "main") | ||
This variable specifies the git branch name or tag to use when fetching | ||
the source code for the VOL connector with the CMake-internal name | ||
'<VOL name>'. | ||
After the VOL's internal name is generated, the following new variables get created: | ||
|
||
HDF5_VOL_<VOL name>_NAME (Default: "") | ||
This variable specifies the string that should be used when setting the | ||
|
@@ -84,8 +105,15 @@ new variables get created: | |
This variable determines whether the VOL connector with the CMake-internal | ||
name '<VOL name>' should be tested against HDF5's parallel tests. | ||
|
||
If the source was retrieved from a Git URL, then the following variable will additionally be created: | ||
|
||
HDF5_VOL_<VOL name>_BRANCH (Default: "main") | ||
This variable specifies the git branch name or tag to use when fetching | ||
the source code for the VOL connector with the CMake-internal name | ||
'<VOL name>'. | ||
|
||
As an example, this would create the following variables for the | ||
previously-mentioned VOL connector: | ||
previously-mentioned VOL connector if it is retrieved from a URL: | ||
|
||
HDF5_VOL_VOL-ASYNC_BRANCH | ||
HDF5_VOL_VOL-ASYNC_NAME | ||
|
@@ -99,7 +127,7 @@ doesn't parse the string as a list. If `cmake` is run from a shell, extra care | |
may need to be taken when escaping the semicolons depending on how the | ||
shell interprets backslashes. | ||
|
||
### Example - Build and test HDF5 Asynchronous I/O VOL connector | ||
### Example - Build and test HDF5 Asynchronous I/O VOL connector from GIT | ||
|
||
Assuming that the HDF5 source code has been checked out and a build directory | ||
has been created, running the following cmake command from that build directory | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
LOCAL_DIR is not currently a valid choice - just TGZ
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.
Would it be reasonable to separate the external support source used for VOLs and the external suppport source used elsewhere in the library? There could be a
HDF5_VOL_EXTERNAL_SUPPORT
for VOL sources, andHDF5_ALLOW_EXTERNAL_SUPPORT
could be unchanged. This would avoid the current weirdness where wanting to get a VOL from github means you also need to get ZLIB and SZIP from github.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.
For maintenance reasons, I didn't want to create a separate path just for support for VOL connectors, since external VFD plugins are another thing we'll have to think about at some point. There shouldn't be any need to grab ZLIB and SZIP from github just by turning on
HDF5_ALLOW_EXTERNAL_SUPPORT
though. I think that's just because the options for building SZIP and ZLIB are on by default.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.
HDF5_ALLOW_EXTERNAL_SUPPORT is just three states NO: go find it, GIT: use a repo and TGZ: use a file.
Because at that time it was all do the same thing, compression, plugins, etc.
There is a supervariable per item: XXX_USE_EXTERNAL which determines whether to do a find_package or use the HDF5_ALLOW_EXTERNAL_SUPPORT option. See the CMakeFilters.cmake file.
For the vol you could create a VOL_USE_EXTERNAL or even a new variable and leave the last option to follow the global HDF5_ALLOW_EXTERNAL_SUPPORT.
Does this need refactored - yes, but maybe for version 2.0 of HDF5.
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.
There are a couple lines in
CMakeFilters.cmake
that tell CMake that ZLIB will come from github if "GIT" is set:You can get around this by disabling ZLIB and SZIP when getting a VOL from Github, or just getting them from Github as well, but it's an unintuitive thing to encounter.