forked from Helsinki-NLP/opus-fast-mosestokenizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (56 loc) · 1.67 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY = help build install clean
help:
@echo "Subcommands"
@echo "==========="
@echo "- build"
@echo " Build the mosestokenizer c library"
@echo "- clean"
@echo " Remove all build files"
@echo "- download-build-static-deps"
@echo " Download and build static dependencies"
build:
mkdir -p build/rel
( \
cd build/rel; \
cmake ../.. \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_CLI:BOOL=ON; \
cmake --build . --config Release; \
)
install:
cd build/rel && make install
clean:
rm -rf build bindings/python/mosestokenizer/lib
download-build-static-deps:
@mkdir -p deps
@echo "Downloading pybind"
curl -L -o deps/pybind-v2.10.3.tar.gz \
https://github.com/pybind/pybind11/archive/v2.10.3.tar.gz
tar -C deps -xf deps/pybind-v2.10.3.tar.gz
@echo "Downloading and building re2"
curl -L -o deps/re2-2020-06-01.tar.gz \
https://github.com/google/re2/archive/2020-06-01.tar.gz
tar -C deps -xf deps/re2-2020-06-01.tar.gz
cd deps/re2-2020-06-01; CXXFLAGS="-fPIC" make
@echo "Downloading and building glib2"
curl -L -o deps/glib-2.72.4.tar.xz \
https://download.gnome.org/sources/glib/2.72/glib-2.72.4.tar.xz
tar -C deps -xf deps/glib-2.72.4.tar.xz
( \
cd deps/glib-2.72.4; \
meson build --default-library static; \
ninja -C build; \
)
@echo "Downloading and building boost"
curl -L -o deps/boost_1_73_0.tar.gz \
https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
tar -C deps -xf deps/boost_1_73_0.tar.gz
( \
cd deps/boost_1_73_0; \
./bootstrap.sh \
--with-libraries=thread,program_options \
--without-icu \
--with-toolset=clang; \
./b2 -j8 toolset=clang link=static cxxflags=-fPIC; \
)