Skip to content

Commit d987d29

Browse files
authored
mac arm64(m1) (#200)
* mac arm64(m1) * linting * # Compile for mac arm64 * # Compile for mac arm64 * removing .DS_Store
1 parent 3bf43eb commit d987d29

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
@@ -66,6 +67,11 @@ def get_extensions():
6667
else:
6768
print('Compiling without OpenMP...')
6869

70+
# Compile for mac arm64
71+
if (sys.platform == 'darwin' and platform.machine() == 'arm64'):
72+
extra_compile_args['cxx'] += ['-arch', 'arm64']
73+
extra_link_args += ['-arch', 'arm64']
74+
6975
if suffix == 'cuda':
7076
define_macros += [('WITH_CUDA', None)]
7177
nvcc_flags = os.getenv('NVCC_FLAGS', '')

0 commit comments

Comments
 (0)