From 2f44ee41e31ffa2d9e33cc4ce2d6db3bd02e5ddd Mon Sep 17 00:00:00 2001 From: Taku Kudo Date: Sat, 4 Jun 2022 11:55:44 +0900 Subject: [PATCH] Uses build/root dir to make python wrapper --- python/setup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/setup.py b/python/setup.py index 204066c..cfbf0db 100755 --- a/python/setup.py +++ b/python/setup.py @@ -81,12 +81,13 @@ class build_ext(_build_ext): if len(libs) == 0: cflags, libs = get_cflags_and_libs('./bundled/root') - if len(libs) == 0 and is_sentencepiece_installed(): - cflags = cflags + run_pkg_config('cflags') - libs = run_pkg_config('libs') - else: - subprocess.check_call(['./build_bundled.sh', __version__]) - cflags, libs = get_cflags_and_libs('./bundled/root') + if len(libs) == 0: + if is_sentencepiece_installed(): + cflags = cflags + run_pkg_config('cflags') + libs = run_pkg_config('libs') + else: + subprocess.check_call(['./build_bundled.sh', __version__]) + cflags, libs = get_cflags_and_libs('./bundled/root') # Fix compile on some versions of Mac OSX # See: https://github.com/neulab/xnmt/issues/199 @@ -104,7 +105,6 @@ if os.name == 'nt': arch = 'win32' if sys.maxsize > 2**32: arch = 'amd64' - print('### arch={}'.format(arch)) if os.path.exists('..\\build\\root_{}\\lib'.format(arch)): cflags = ['/MT', '/I..\\build\\root_{}\\include'.format(arch)] libs = [