File: build_bundled.sh

package info (click to toggle)
sentencepiece 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 53,912 kB
  • sloc: cpp: 190,245; python: 1,776; xml: 231; perl: 198; sh: 58; pascal: 50; makefile: 23
file content (22 lines) | stat: -rwxr-xr-x 657 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

VERSION="$1"

mkdir -p build

BUILD_DIR=./build
INSTALL_DIR=./build/root

if [ -f ./sentencepiece/src/CMakeLists.txt ]; then
  SRC_DIR=./sentencepiece
elif [ -f ../src/CMakeLists.txt ]; then
  SRC_DIR=..  
else
  # Try tagged version. Othewise, use head.
  git clone https://github.com/google/sentencepiece.git -b v"${VERSION}" --depth 1 || \
  git clone https://github.com/google/sentencepiece.git --depth 1
  SRC_DIR=./sentencepiece
fi

cmake ${SRC_DIR} -B ${BUILD_DIR} -DSPM_ENABLE_SHARED=OFF -DSPM_DISABLE_EMBEDDED_DATA=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
cmake --build ${BUILD_DIR} --config Release --target install --parallel $(nproc)