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)
project(tensoradapter_pytorch C CXX)
# Find PyTorch cmake files and PyTorch versions with the python interpreter $PYTHON_INTERP
# (or "python" if empty)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/find_cmake.py FIND_CMAKE_PY)
# ("python3" or "python" if empty)
if(NOT PYTHON_INTERP)
set(PYTHON_INTERP python)
find_program(PYTHON_INTERP NAMES python3 python)
endif()
message(STATUS "Using Python interpreter: ${PYTHON_INTERP}")
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/find_cmake.py FIND_CMAKE_PY)
execute_process(
COMMAND ${PYTHON_INTERP} ${FIND_CMAKE_PY}
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