Skip to content
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
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ target_link_libraries(xfastertransformer
add_dependencies(xfastertransformer_static ${DEPEND_LIST})
add_dependencies(xfastertransformer ${DEPEND_LIST})

execute_process(COMMAND python -m pip show torch
find_package (Python COMPONENTS Interpreter Development)
message(STATUS "Using python: ${Python_EXECUTABLE}")

execute_process(COMMAND ${Python_EXECUTABLE} -m pip show torch
RESULT_VARIABLE EXIT_CODE
OUTPUT_QUIET)
if(${EXIT_CODE} EQUAL 0)
Expand Down
2 changes: 1 addition & 1 deletion src/pytorch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ find_package(OpenMP REQUIRED)
find_package(MPI REQUIRED)
find_package(oneCCL REQUIRED)

execute_process(COMMAND python -c "import torch.utils; print(torch.utils.cmake_prefix_path)"
execute_process(COMMAND ${Python_EXECUTABLE} -c "import torch.utils; print(torch.utils.cmake_prefix_path)"
OUTPUT_VARIABLE TORCH_CMAKE_PREFIX_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE)

Expand Down