mirror of
https://github.com/google/sentencepiece.git
synced 2024-10-26 11:38:45 +03:00
Fixed build error on Mac.
This commit is contained in:
parent
9dee6649ae
commit
d8c4b04056
1
.gitignore
vendored
1
.gitignore
vendored
@ -70,3 +70,4 @@ m.vocab
|
|||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
libsentencepiece.so*
|
libsentencepiece.so*
|
||||||
libsentencepiece_train.so*
|
libsentencepiece_train.so*
|
||||||
|
python/bundled
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
recursive-include test *.py *.model botchan.txt
|
recursive-include test *.py *.model botchan.txt
|
||||||
include *.i *.md VERSION
|
recursive-include src *.i
|
||||||
include build_bundled.sh
|
include *.md VERSION build_bundled.sh
|
||||||
|
@ -42,7 +42,7 @@ build() {
|
|||||||
for i in /opt/python/*
|
for i in /opt/python/*
|
||||||
do
|
do
|
||||||
$i/bin/python setup.py bdist
|
$i/bin/python setup.py bdist
|
||||||
strip build/*/*.so
|
strip build/*/*/*.so
|
||||||
$i/bin/python setup.py bdist_wheel
|
$i/bin/python setup.py bdist_wheel
|
||||||
$i/bin/python setup.py test
|
$i/bin/python setup.py test
|
||||||
rm -fr build
|
rm -fr build
|
||||||
|
@ -53,9 +53,11 @@ def run_pkg_config(section, pkg_config_path=None):
|
|||||||
|
|
||||||
|
|
||||||
def is_sentencepiece_installed():
|
def is_sentencepiece_installed():
|
||||||
return subprocess.run(
|
try:
|
||||||
'pkg-config sentencepiece --libs', shell=True,
|
subprocess.check_call('pkg-config sentencepiece --libs', shell=True)
|
||||||
check=False).returncode == 0
|
return True
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
class build_ext(_build_ext):
|
class build_ext(_build_ext):
|
||||||
|
Loading…
Reference in New Issue
Block a user