forked from mingruimingrui/fast-mosestokenizer
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (57 loc) · 1.72 KB
/
Makefile
File metadata and controls
68 lines (57 loc) · 1.72 KB
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
66
67
68
BOOST_TOOLSET ?= clang
.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.13.6.tar.gz \
https://github.com/pybind/pybind11/archive/v2.13.6.tar.gz
tar -C deps -xf deps/pybind-v2.13.6.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.85.0.tar.xz \
https://download.gnome.org/sources/glib/2.85/glib-2.85.0.tar.xz
tar -C deps -xf deps/glib-2.85.0.tar.xz
( \
cd deps/glib-2.85.0; \
meson setup build --default-library static; \
meson compile -C build; \
)
@echo "Downloading and building boost"
curl -L -o deps/boost_1_88_0.tar.gz \
https://archives.boost.io/release/1.88.0/source/boost_1_88_0.tar.gz
tar -C deps -xf deps/boost_1_88_0.tar.gz
( \
cd deps/boost_1_88_0; \
./bootstrap.sh \
--with-libraries=thread,program_options \
--without-icu \
--with-toolset=$(BOOST_TOOLSET); \
./b2 -j8 toolset=$(BOOST_TOOLSET) link=static cxxflags=-fPIC; \
)