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] Allow users to link against onemath_<domain>_<backend> targets #627

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Rbiessy
Copy link
Contributor

@Rbiessy Rbiessy commented Jan 22, 2025

Description

The goal of this PR is to allow users to integrate oneMath in their application with compile-time dispatching, only by linking against onemath__ targets. With the current CMake this would fail to compile due to missing include directories and linking libraries unless users manually add the dependencies or set up environment variables. This makes it easier for users.
To show this I have also updated the example's CMake to simplify them and make sure they only rely on target_link_libraries to get the oneMath library dependencies.

Other changes:

  • Remove mention of onemath_ targets in the documentation. I believe these targets only provide partial support for runtime-dispatching and have not benefit over using onemath.
  • Remove occurrences of install(TARGETS ${LIB_OBJ} ...). These target pollute the outputted oneMathTargets.cmake file and end up requiring more CMake targets such as ONEMATH::cublas targets which are not useful to users. With these changes ${LIB_NAME} targets link ${LIB_OBJ} targets privately so it is not needed to install them anymore.

These are only CMake changes so I think the review from onemath-arch-write is enough but more feedback is welcomed.

Checklist

All Submissions

@Rbiessy Rbiessy requested review from a team as code owners January 22, 2025 17:26
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.

1 participant