Skip to content

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

Open
@AlexeySachkov

Description

@AlexeySachkov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions