Skip to content

Commit 576e0bb

Browse files
authored
Compile flags for mac arm64 (#121)
1 parent e8620a8 commit 576e0bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os.path as osp
55
from itertools import product
66
from setuptools import setup, find_packages
7+
import platform
78

89
import torch
910
from torch.__config__ import parallel_info
@@ -46,6 +47,11 @@ def get_extensions():
4647
else:
4748
print('Compiling without OpenMP...')
4849

50+
# Compile for mac arm64
51+
if (sys.platform == 'darwin' and platform.machine() == 'arm64'):
52+
extra_compile_args['cxx'] += ['-arch', 'arm64']
53+
extra_link_args += ['-arch', 'arm64']
54+
4955
if suffix == 'cuda':
5056
define_macros += [('WITH_CUDA', None)]
5157
nvcc_flags = os.getenv('NVCC_FLAGS', '')

0 commit comments

Comments
 (0)