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] handling of hwloc-related flags should be improved #1047

Open
AlexeySachkov opened this issue Jan 17, 2025 · 4 comments
Open

[cmake] handling of hwloc-related flags should be improved #1047

AlexeySachkov opened this issue Jan 17, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@AlexeySachkov
Copy link

Environment Information

  • UMF version (hash commit or a tag): main, v0.9.0
  • OS(es) version(s): Reproduced on Windows, but shouldn't be OS-dependent
  • kernel version(s): N/A
  • compiler, libraries, and other related tools version(s): N/A

Please provide a reproduction of the bug:

Try building UMF with the following combination of cmake options:

-DUMF_LINK_HWLOC_STATICALLY=ON
-DUMF_DISABLE_HWLOC=ON

I.e. disable hwloc, but still say that it should be linked statically. Arguably, that combination of flags should can be considered incorrect, because they contradict each other, but it should be diagnosed better.

How often bug is revealed:

Always

Actual behavior:

CMake configure step fails with the following error:

unified-memory-framework-src/src/CMakeLists.txt:187 (add_dependencies):
  The dependency target "hwloc" of target "umf" does not exist.

Expected behavior:

Either UMF_LINK_HWLOC_STATICALLY=ON should be silently ignored when UMF_DISABLE_HWLOC=ON here:

if(UMF_LINK_HWLOC_STATICALLY)
add_dependencies(umf ${UMF_HWLOC_NAME})
endif()

Or CMake configure step should fail with an error saying that those flags are mutually exclusive and only one of them should be ever set to ON, but not both at the same time.

Details

Nothing to add here.

Additional information about Priority and Help Requested:

Are you willing to submit a pull request with a proposed change? Yes, if there is an agreement about the way it should be handled.

Requested priority: Medium. The issue was found at intel/llvm as part of trying to reduce amount of dependencies the project has for those who don't need all the functionality. We understand now how to overcome the issue, but the diagnostic provided right now is quite confusing and it took us some time to figure it out.

@AlexeySachkov AlexeySachkov added the bug Something isn't working label Jan 17, 2025
@lplewa
Copy link
Contributor

lplewa commented Jan 17, 2025

Maybe we should merge those flags in to one? UMF_USE_HWLOC=[Dynamic, Static, Disable]

@PatKamin
Copy link
Contributor

The flag UMF_USE_HWLOC shall be removed as soon as its use cases are removed. See ie. https://github.com/intel/llvm/pull/15261/files

@KFilipek
Copy link
Contributor

I completely agree with @lplewa

@ldorau
Copy link
Contributor

ldorau commented Feb 24, 2025

@AlexeySachkov UMF_DISABLE_HWLOC is going to be removed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants