-
Notifications
You must be signed in to change notification settings - Fork 6
Fix find_package case for pre-installed Ginkgo #100
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,11 +41,11 @@ if(NOT nlohmann_json_FOUND) | |
| FetchContent_MakeAvailable(nlohmann_json) | ||
| endif() | ||
|
|
||
| # Find Ginkgo find_package(Ginkgo 1.7.0 QUIET) | ||
| find_package(ginkgo QUIET) | ||
| # Find Ginkgo (quietly; no minimum version specified) | ||
| find_package(Ginkgo QUIET) | ||
|
|
||
| # Fetch Ginkgo if not found | ||
| if(NOT ginkgo_FOUND) | ||
| if(NOT Ginkgo_FOUND) | ||
| # If not found, fetch Ginkgo | ||
| include(FetchContent) | ||
| if(NOT DEFINED GINKGO_BUILD_TESTS) | ||
|
|
@@ -182,16 +182,20 @@ endif() | |
| set(CMAKE_INSTALL_RPATH ${Python_SITELIB}/${PROJECT_NAME}) | ||
|
|
||
| message(STATUS "Install path: ${Python_SITELIB}") | ||
| install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | ||
| DESTINATION ${Python_SITELIB}) | ||
| install( | ||
| IMPORTED_RUNTIME_ARTIFACTS | ||
| ginkgo | ||
| ginkgo_device | ||
| ginkgo_hip | ||
| ginkgo_cuda | ||
| ginkgo_omp | ||
| ginkgo_dpcpp | ||
| ginkgo_reference | ||
| DESTINATION | ||
| ${Python_SITELIB}/${PROJECT_NAME}) | ||
| install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ | ||
|
Comment on lines
184
to
+185
|
||
| DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME}) | ||
|
Comment on lines
+185
to
+186
|
||
| if(NOT Ginkgo_FOUND) | ||
| # Only install Ginkgo shared libraries when built from source (FetchContent). | ||
| # When using a pre-installed Ginkgo (e.g. conda), its libraries are already available. | ||
| install( | ||
| IMPORTED_RUNTIME_ARTIFACTS | ||
| ginkgo | ||
| ginkgo_device | ||
| ginkgo_hip | ||
| ginkgo_cuda | ||
| ginkgo_omp | ||
| ginkgo_dpcpp | ||
| ginkgo_reference | ||
| DESTINATION | ||
| ${PY_BUILD_CMAKE_MODULE_NAME}) | ||
| endif() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMAKE_INSTALL_RPATHis still set using the absolute${Python_SITELIB}/${PROJECT_NAME}path, even though installation is now intended to go through a staging prefix for wheel builds. This can embed a build-environment-specific absolute RPATH into the extension, which is problematic for wheel relocatability. Consider setting an RPATH relative to the installed module location (e.g.,$ORIGIN) or deriving it from the actual install destination instead ofPython_SITELIB.