Skip to content

Commit e90398b

Browse files
Tell CMake to use venv Python
Signed-off-by: Yuan Tong <13075180+tongyuantongyu@users.noreply.github.com>
1 parent de3d91b commit e90398b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ set(TRTLLM_VERSION_DIR ${PROJECT_SOURCE_DIR}/../tensorrt_llm)
109109
set_directory_properties(PROPERTIES CMAKE_CONFIGURE_DEPENDS
110110
${TRTLLM_VERSION_DIR}/version.py)
111111
execute_process(
112-
COMMAND python3 -c "import version; print(version.__version__)"
112+
COMMAND ${Python_EXECUTABLE} -c "import version; print(version.__version__)"
113113
WORKING_DIRECTORY ${TRTLLM_VERSION_DIR}
114114
OUTPUT_VARIABLE TRTLLM_VERSION
115115
RESULT_VARIABLE TRTLLM_VERSION_RESULT

scripts/build_wheel.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ def main(*,
363363
f'cmake -DCMAKE_BUILD_TYPE="{build_type}" -DBUILD_PYT="{build_pyt}" -DBUILD_PYBIND="{build_pybind}"'
364364
f' -DNVTX_DISABLE="{disable_nvtx}" -DBUILD_MICRO_BENCHMARKS={build_micro_benchmarks}'
365365
f' -DBUILD_WHEEL_TARGETS="{";".join(targets)}"'
366+
f' -DPython_EXECUTABLE={venv_python} -DPython3_EXECUTABLE={venv_python}'
366367
f' {cmake_cuda_architectures} {cmake_def_args} {cmake_generator} -S "{source_dir}"'
367368
)
368369
print("CMake Configure command: ")

0 commit comments

Comments
 (0)