File sentencepiece-fix-build.patch of Package python-sentencepiece
--- a/setup.py
+++ b/setup.py
@@ -59,17 +59,7 @@ def is_sentencepiece_installed():
def get_cflags_and_libs(root):
cflags = ['-std=c++17', '-I' + os.path.join(root, 'include')]
- libs = []
- if os.path.exists(os.path.join(root, 'lib/pkgconfig/sentencepiece.pc')):
- libs = [
- os.path.join(root, 'lib/libsentencepiece.a'),
- os.path.join(root, 'lib/libsentencepiece_train.a'),
- ]
- elif os.path.exists(os.path.join(root, 'lib64/pkgconfig/sentencepiece.pc')):
- libs = [
- os.path.join(root, 'lib64/libsentencepiece.a'),
- os.path.join(root, 'lib64/libsentencepiece_train.a'),
- ]
+ libs = ['-L'+ os.path.join(root, 'lib64'), '-lsentencepiece' , '-lsentencepiece_train']
return cflags, libs
@@ -77,7 +67,7 @@ class build_ext(_build_ext):
"""Override build_extension to run cmake."""
def build_extension(self, ext):
- cflags, libs = get_cflags_and_libs('../build/root')
+ cflags, libs = get_cflags_and_libs('./build-libs/root/usr')
if len(libs) == 0:
if is_sentencepiece_installed():