Skip to content

Commit 7da8f17

Browse files
committed
Fix
1 parent 4cf0889 commit 7da8f17

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ if(EXECUTORCH_BUILD_PYBIND)
799799
util
800800
torch
801801
)
802-
802+
803803
# Build common AOTI functionality if needed by CUDA or Metal backends
804804
if(EXECUTORCH_BUILD_CUDA OR EXECUTORCH_BUILD_METAL)
805805
list(APPEND _dep_libs aoti_common)

setup.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@
6565
from pathlib import Path
6666
from typing import List, Optional
6767

68+
# Add the current directory to sys.path to import install_utils
69+
CWD = Path(__file__).absolute().parent
70+
# Add the current directory to the Python path so that we can import `install_utils`.
71+
# This is required when running this script with a PEP-517-enabled build backend.
72+
#
73+
# From the PEP-517 documentation: https://peps.python.org/pep-0517
74+
#
75+
# > When importing the module path, we do *not* look in the directory containing
76+
# > the source tree, unless that would be on `sys.path` anyway (e.g. because it
77+
# > is specified in `PYTHONPATH`).
78+
#
79+
sys.path.insert(0, str(CWD)) # this only affects the current process
6880
import install_utils
6981

7082
from setuptools import Extension, setup
@@ -831,6 +843,7 @@ def run(self): # noqa C901
831843

832844
if cmake_cache.is_enabled("EXECUTORCH_BUILD_CUDA"):
833845
cmake_build_args += ["--target", "aoti_cuda"]
846+
cmake_build_args += ["--target", "aoti_common"]
834847

835848
if cmake_cache.is_enabled("EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER"):
836849
cmake_build_args += ["--target", "_llm_runner"]

0 commit comments

Comments
 (0)