sentencepiece/python/build_bundled.sh

21 lines
550 B
Bash
Raw Normal View History

2020-10-21 13:28:09 +03:00
#!/bin/sh
VERSION="$1"
2022-06-02 18:19:14 +03:00
mkdir -p bundled
BUILD_DIR=./bundled
INSTALL_DIR=./bundled/root
if [ -f ../src/CMakeLists.txt ]; then
SRC_DIR=..
else
# Try taged version. Othewise, use head.
git clone https://github.com/google/sentencepiece.git -b v"${VERSION}" --depth 1 || \
2020-10-21 13:28:09 +03:00
git clone https://github.com/google/sentencepiece.git --depth 1
2022-06-02 18:19:14 +03:00
SRC_DIR=./sentencepiece
fi
2020-10-21 13:28:09 +03:00
2022-06-02 18:19:14 +03:00
cmake ${SRC_DIR} -B ${BUILD_DIR} -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
cmake --build ${BUILD_DIR} --config Release --target install --parallel $(nproc)