mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
See https://github.com/pytorch/pytorch/pull/129751#issue-2380881501. Most changes are auto-generated by linter. You can review these PRs via: ```bash git diff --ignore-all-space --ignore-blank-lines HEAD~1 ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/129752 Approved by: https://github.com/ezyang, https://github.com/malfet
25 lines
670 B
Python
25 lines
670 B
Python
## @package get_python_cmake_flags
|
|
# Module scripts.get_python_cmake_flags
|
|
##############################################################################
|
|
# Use this script to find your preferred python installation.
|
|
##############################################################################
|
|
#
|
|
# You can use the following to build with your preferred version of python
|
|
# if your installation is not being properly detected by CMake.
|
|
#
|
|
# mkdir -p build && cd build
|
|
# cmake $(python ../scripts/get_python_cmake_flags.py) ..
|
|
# make
|
|
#
|
|
|
|
|
|
import sys
|
|
import sysconfig
|
|
|
|
|
|
flags = [
|
|
f"-DPython_EXECUTABLE:FILEPATH={sys.executable}",
|
|
]
|
|
|
|
print(" ".join(flags), end="")
|