"...text-generation-inference.git" did not exist on "f20463e4e3a994fbcbc836cd315c14b766c72205"
Unverified Commit 7a2f4943 authored by nv-dlasalle's avatar nv-dlasalle Committed by GitHub
Browse files

[bugfix] Make source build work for systems where the default is python2 (#3718)



* Make compatible for system where the default is python2

* Update cmakelists with find package

* Switch to find_program
Co-authored-by: default avatarQuan (Andy) Gan <coin2028@hotmail.com>
parent 4c7bd314
...@@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.5) ...@@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.5)
project(tensoradapter_pytorch C CXX) project(tensoradapter_pytorch C CXX)
# Find PyTorch cmake files and PyTorch versions with the python interpreter $PYTHON_INTERP # Find PyTorch cmake files and PyTorch versions with the python interpreter $PYTHON_INTERP
# (or "python" if empty) # ("python3" or "python" if empty)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/find_cmake.py FIND_CMAKE_PY)
if(NOT PYTHON_INTERP) if(NOT PYTHON_INTERP)
set(PYTHON_INTERP python) find_program(PYTHON_INTERP NAMES python3 python)
endif() endif()
message(STATUS "Using Python interpreter: ${PYTHON_INTERP}") message(STATUS "Using Python interpreter: ${PYTHON_INTERP}")
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/find_cmake.py FIND_CMAKE_PY)
execute_process( execute_process(
COMMAND ${PYTHON_INTERP} ${FIND_CMAKE_PY} COMMAND ${PYTHON_INTERP} ${FIND_CMAKE_PY}
OUTPUT_VARIABLE TORCH_PREFIX_VER OUTPUT_VARIABLE TORCH_PREFIX_VER
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment