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

[cudnn] Fix port: install find module, add usage #17644

Merged
merged 3 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/cudnn/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: cudnn
Version: 7.6.5
Port-Version: 2
Port-Version: 3
Description: NVIDIA's cuDNN deep neural network acceleration library
Build-Depends: cuda
Supports: (windows|linux)&x64
3 changes: 3 additions & 0 deletions ports/cudnn/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ elseif(VCPKG_TARGET_IS_WINDOWS)
else()
message(FATAL_ERROR "Please install CUDNN using your system package manager (the same way you installed CUDA). For example: apt install libcudnn8-dev.")
endif()

file(INSTALL "${CURRENT_PORT_DIR}/FindCUDNN.cmake" DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're supposed to install Xxx-config.cmake or XxxConfig rather than FindXxx? (Hoping a better cmake expert than I can point to policy/rationale but I've heard this before)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, at the beginning modules were preferred for non-cmake-built projects, hoping that upstream (in the project or in cmake itself) they could find a final home after some development here

imho, this is still the best approach (and still applied in many other ports, see ffmpeg for example)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. In that case pay no attention to the Billy behind the curtain… 😂

file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
10 changes: 10 additions & 0 deletions ports/cudnn/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The package cudnn provides CMake variables:

find_package(CUDNN REQUIRED)
target_link_libraries(main PRIVATE ${CUDNN_LIBRARIES})
target_include_directories(main PRIVATE ${CUDNN_INCLUDE_DIRS})

Or the following CMake target:

find_package(CUDNN REQUIRED)
target_link_libraries(main PRIVATE CuDNN::CuDNN)
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@
},
"cudnn": {
"baseline": "7.6.5",
"port-version": 2
"port-version": 3
},
"cunit": {
"baseline": "2.1.3-6",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cudnn.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "00e54079329e9cc4f1f623dce3bc39b0f19e958d",
"version-string": "7.6.5",
"port-version": 3
},
{
"git-tree": "5581791a9ad35390ed30629985b3863cf8b85bba",
"version-string": "7.6.5",
Expand Down