Skip to content

Commit 00eddc9

Browse files
committed
Update setup.py
1 parent 5568599 commit 00eddc9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

setup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ def load_requirements(fname):
2626

2727
class MyInstallData(build_py):
2828
def run(self):
29-
from llvm import amdgcn
30-
shutil.copy(
31-
amdgcn.__file__,
32-
Path(self.build_lib)
33-
/ HOST_MLIR_PYTHON_PACKAGE_PREFIX
34-
/ "extras"
35-
/ "dialects"
36-
/ "ext"
37-
/ "llvm"
38-
/ "amdgcn.py",
39-
)
40-
4129
build_py.run(self)
30+
try:
31+
from llvm import amdgcn
32+
33+
build_dir = os.path.join(
34+
*([self.build_lib] + HOST_MLIR_PYTHON_PACKAGE_PREFIX.split("."))
35+
)
36+
shutil.copy(
37+
amdgcn.__file__,
38+
Path(build_dir) / "extras" / "dialects" / "ext" / "llvm" / "amdgcn.py",
39+
)
40+
except ImportError:
41+
pass
4242

4343

4444
setup(

0 commit comments

Comments
 (0)