From 323af54cd6d893e23405eb4b650bdfe6bb1377e1 Mon Sep 17 00:00:00 2001 From: Taku Kudo Date: Mon, 25 Jun 2018 15:38:36 +0900 Subject: [PATCH] Making a static link for python wheel package --- make_py_wheel.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/make_py_wheel.sh b/make_py_wheel.sh index c10a429..4ce6236 100755 --- a/make_py_wheel.sh +++ b/make_py_wheel.sh @@ -45,10 +45,9 @@ make_wheel() { git clone https://github.com/google/protobuf.git cd protobuf ./autogen.sh - ./configure + ./configure --disable-shared --with-pic make -j4 make install - strip /usr/local/lib/*protobuf* || true cd .. cd ../../ @@ -57,15 +56,15 @@ make_wheel() { grep -v PKG_CHECK_MODULES configure > tmp mv tmp -f configure chmod +x configure - LIBS+="-lprotobuf -pthread" ./configure + LIBS+="-pthread -L/usr/local/lib -lprotobuf" ./configure --disable-shared --with-pic make -j4 make install - make distclean - strip /usr/local/lib/*sentencepiece* || true cd python for i in /opt/python/* do + $i/bin/python setup.py bdist + strip build/*/*.so $i/bin/python setup.py bdist_wheel $i/bin/python setup.py test rm -fr build