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

fix(cmake): fix PyTorch_LIBRARY_PATH #3890

Merged
merged 1 commit into from
Jun 21, 2024
Merged
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
5 changes: 3 additions & 2 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ if(ENABLE_PYTORCH AND NOT DEEPMD_C_ROOT)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${OP_CXX_ABI})
endif()
endif()
# get torch directory
set(PyTorch_LIBRARY_PATH ${TORCH_INCLUDE_DIRS}/../lib)
# get torch directory get the directory of the target "torch"
get_target_property(_TORCH_LOCATION torch LOCATION)
get_filename_component(PyTorch_LIBRARY_PATH ${_TORCH_LOCATION} DIRECTORY)
list(APPEND BACKEND_LIBRARY_PATH ${PyTorch_LIBRARY_PATH})
list(APPEND BACKEND_INCLUDE_DIRS ${TORCH_INCLUDE_DIRS})
endif()
Expand Down
Loading