Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagico2 authored Jul 26, 2024
1 parent 9cadf97 commit 1f37bf7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import string
import subprocess
import sys
import platform
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.build_py import build_py as _build_py
Expand Down Expand Up @@ -108,6 +109,8 @@ def build_extension(self, ext):
arch = 'win32'
if sys.maxsize > 2**32:
arch = 'amd64'
if 'arm' in platform.machine().lower():
arch = 'arm64'
if os.path.exists('..\\build\\root_{}\\lib'.format(arch)):
cflags = ['/std:c++17', '/I..\\build\\root_{}\\include'.format(arch)]
libs = [
Expand All @@ -125,6 +128,8 @@ def build_extension(self, ext):
cmake_arch = 'Win32'
if arch == 'amd64':
cmake_arch = 'x64'
elif arch == "arm64":
cmake_arch = "ARM64"
subprocess.check_call([
'cmake',
'sentencepiece',
Expand Down

0 comments on commit 1f37bf7

Please sign in to comment.