runtime subproject mixes CMake build tree artifacts with install tree artifacts
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cmake
- Domain
- build-system
Research direction
Start by tracing the runtime CMake configuration, especially CMAKE_LIBRARY_OUTPUT_DIRECTORY and the ExternalProject_Add setup for accelerate-lapacke. Compare the build-tree and install-tree paths, then choose and document a consistent approach; done means runtime/build/lib no longer mixes artifacts from both trees and the build and packaging flow still succeeds.
Written by the indexing model from the issue text.
Description
Impact:
As the libraries in runtime manually set the RPATH/RUNPATH to $ORIGIN/@loader_path for the build tree artifacts and then continue to use the build tree artifacts for further building and packaging (wheel), this is probably nitpicky and won't have any impact.
Description:
When building the runtime subproject, the variable CMAKE_LIBRARY_OUTPUT_DIRECTORY is used to place the build tree artifacts into a common location runtime/build/lib. The accelerate-lapacke dependency on the other hand is installed into this directory. This breaks the fundamental CMake principle of separating build tree and install tree.
ChatGPT had this to say (exerpt):
The CMake docs and common guidance on Discourse repeatedly emphasize separating build tree and install tree, and using target-based install/export mechanisms instead.
One could argue, that in this project, when the runtime subproject has been built, the build process is not finished, so we're still operating in the build tree. Unfortunately, because the LAPACKE build is a nested sub-project with a distinct build directory, CMAKE_LIBRARY_OUTPUT_DIRECTORY does not propagate to it. The LAPACKE library is installed alongside the other libraries.
Solutions:
You could either use a more fragile approach, skip the install step for accelerate-lapacke and copy the build tree artifacts of the reference lapack build to runtime/build/lib. But the path to the reference lapack build directory would be hard-coded and fragile.
ExternalProject_Add(
...
INSTALL_COMMAND "${CMAKE_COMMAND}" -E copy_directory_if_different "<BINARY_DIR>/_deps/reference-lapack-build/lib" "${CMAKE_BINARY_DIR}/lib"
...
)
This way, all artifacts in runtime/build/lib would be build tree artifacts.
The other approach would be to make runtime a standalone, installable project. For this, all the other CMake libraries in runtime would have to define install()'s for each target. Then, you could install the whole runtime project before using it in the top-level project or packaging it into a wheel.
- Dominant language
- Python
- Stars
- 234
- Forks
- 84
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 78
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PennyLaneAI/catalyst
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
PennyLaneAI/catalyst#3489 ·
Maintainers usually reply within 1 day
-
Fix platform tag for macOS wheelsMay be free again @sarehaskari17 claimed this 107 days ago, and no pull request is open. OpenCI/Build enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
PennyLaneAI/catalyst#2907 · 2 comments ·
Maintainers usually reply within 1 day
-
The docs page for `CompileOptions` is missing a description for the `target` attributePossibly taken @daxsh2803 claimed this 68 days ago. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
PennyLaneAI/catalyst#2653 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
PennyLaneAI/catalyst#3550 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
PennyLaneAI/catalyst#3497 ·
Maintainers usually reply within 1 day
All issues in PennyLaneAI/catalyst
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day