Repository navigation
Add CMake options to build static hwloc from local sources or a local git mirror - #1610
Conversation
|
|
||
| - name: Clone hwloc sources | ||
| if: matrix.local_hwloc == 'ON' | ||
| run: git clone --depth 1 -b hwloc-2.3.0 https://github.com/open-mpi/hwloc.git ${{env.HWLOC_SRC_DIR}} |
26b779f to
fbd7fd6
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The Windows companion Debug build does not receive the local hwloc path and can unexpectedly fetch a different source.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds support for building statically linked hwloc from a local source directory.
Changes:
- Adds and documents
UMF_HWLOC_SOURCE_DIR. - Supports local sources on Windows and Unix builds.
- Adds CI coverage using hwloc 2.3.0 and fixes test compatibility.
| File | Description |
|---|---|
CMakeLists.txt |
Configures local hwloc source handling. |
README.md |
Documents the new option. |
.github/workflows/reusable_basic.yml |
Tests a local hwloc checkout. |
test/memspaces/memspace_highest_bandwidth.cpp |
Supports the older hwloc enum scope. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fbd7fd6 to
77af354
Compare
77af354 to
274a17f
Compare
| if(UMF_HWLOC_SOURCE_DIR) | ||
| # Drop build artifacts copied over from an already built local tree | ||
| set(UMF_HWLOC_PATCH_CMD | ||
| "(test ! -f Makefile || make distclean) && (${UMF_HWLOC_PATCH_CMD})" |
There was a problem hiding this comment.
just a question, why we have to run this patch cmd here and right in the next step (ExternalProject_Add)?
There was a problem hiding this comment.
We don't run anything here, we only add make distclean to the front of the single PATCH_COMMAND so that build artifacts copied from an already built local tree aren't reused and linked
|
NOTE: This needs to be set as a draft, as I need to add a separate option to use a mirrored HWLOC repository path. |
274a17f to
6188113
Compare
|
|
||
| - name: Create hwloc git mirror | ||
| if: matrix.local_hwloc == 'mirror' | ||
| run: git clone --mirror https://github.com/open-mpi/hwloc.git ${{env.HWLOC_MIRROR_DIR}} |
| -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON | ||
| -DUMF_TESTS_FAIL_ON_SKIP=ON | ||
| -DUMF_LINK_HWLOC_STATICALLY=${{matrix.link_hwloc_statically}} | ||
| ${{ matrix.local_hwloc == 'source' && format('-DUMF_HWLOC_SOURCE_DIR={0}', env.HWLOC_SRC_DIR) || '' }} |
| -DUMF_TESTS_FAIL_ON_SKIP=ON | ||
| -DUMF_LINK_HWLOC_STATICALLY=${{matrix.link_hwloc_statically}} | ||
| ${{ matrix.local_hwloc == 'source' && format('-DUMF_HWLOC_SOURCE_DIR={0}', env.HWLOC_SRC_DIR) || '' }} | ||
| ${{ matrix.local_hwloc == 'mirror' && format('-DUMF_HWLOC_REPO={0}', env.HWLOC_MIRROR_DIR) || '' }} |
6188113 to
f2c5035
Compare

UMF currently always clones hwloc from GitHub. This PR adds two ways to avoid that, which is useful for offline builds:
UMF_HWLOC_SOURCE_DIR- path to a local hwloc working tree., which is copied into the build directory (the original tree is unmodified)UMF_HWLOC_REPO- a URL or a local mirror path (default ishttps://github.com/open-mpi/hwloc.git)If
UMF_HWLOC_SOURCE_DIRis set, it takes precedence overUMF_HWLOC_REPOandUMF_HWLOC_TAG.Examples: