Skip to content

fix: propagate HDF5_IS_PARALLEL to parent scope for SZ3Config#127

Open
ayzk wants to merge 1 commit intomasterfrom
fix/hdf5-parallel-scope
Open

fix: propagate HDF5_IS_PARALLEL to parent scope for SZ3Config#127
ayzk wants to merge 1 commit intomasterfrom
fix/hdf5-parallel-scope

Conversation

@ayzk
Copy link
Copy Markdown
Collaborator

@ayzk ayzk commented Feb 19, 2026

Summary

Fixes Copilot review comment on PR #126: HDF5_IS_PARALLEL was not available in the parent scope when configure_package_config_file processes SZ3Config.cmake.in.

Changes

  • tools/H5Z-SZ3/CMakeLists.txt: Added set(HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} PARENT_SCOPE) to propagate the variable set by find_package(HDF5) to the parent scope.

Verified

Both import methods tested:

  • find_package(SZ3) + SZ3::hdf5sz3: PASS
  • FetchContent + hdf5sz3: PASS

Ensures @HDF5_IS_PARALLEL@ is correctly substituted in SZ3Config.cmake.in
when configure_package_config_file runs in the parent CMakeLists.txt scope.
Copilot AI review requested due to automatic review settings February 19, 2026 01:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a scope issue identified in PR #126 where HDF5_IS_PARALLEL was not available in the parent scope when configure_package_config_file processes SZ3Config.cmake.in. The variable is set by find_package(HDF5) in the tools/H5Z-SZ3 subdirectory but needed in the parent scope for template substitution.

Changes:

  • Propagate HDF5_IS_PARALLEL from subdirectory scope to parent scope using PARENT_SCOPE

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

target_link_libraries(hdf5sz3
PUBLIC MPI::MPI_CXX)
endif ()
set(HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} PARENT_SCOPE)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When BUILD_H5Z_FILTER is OFF (the default), this subdirectory is not included (main CMakeLists.txt line 95-98), so HDF5_IS_PARALLEL remains undefined. The configure_package_config_file call (main CMakeLists.txt line 122) will substitute @HDF5_IS_PARALLEL@ with an empty string in SZ3Config.cmake.in line 6, resulting in invalid CMake syntax if(). This will cause errors for downstream projects using find_package(SZ3) when SZ3 is built with the default configuration.

Consider initializing HDF5_IS_PARALLEL to FALSE in the main CMakeLists.txt before line 95 (the BUILD_H5Z_FILTER conditional), ensuring it has a valid value even when the H5Z-SZ3 subdirectory is not included.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants