-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
92 lines (76 loc) · 2.27 KB
/
install.sh
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env bash
# Copyright 2019 Qwant Research. Licensed under the terms of the Apache 2.0
# license. See LICENSE in the project root.
set -eou pipefail
export PREFIX=/usr/local/
echo "Prefix set to $PREFIX"
export CMAKE_PREFIX_PATH=$PREFIX
echo "Installing dependencies"
pushd third_party/qnlp-toolkit
rm -rf build
bash install.sh $PREFIX
popd
for dep in pistache json fastText
do
pushd third_party/$dep
rm -rf build
mkdir -p build
pushd build
cmake .. -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=Release
make -j 4 && make install
popd
popd
done
pushd third_party/grpc
# Based on https://github.com/grpc/grpc/blob/master/test/distrib/cpp/run_distrib_test_cmake.sh
# Install abseil-cpp
pushd third_party/abseil-cpp
mkdir -p cmake/build
pushd cmake/build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ../..
make -j4 install
popd
popd
# Install c-ares
pushd third_party/cares/cares
mkdir -p cmake/build
pushd cmake/build
cmake -DCMAKE_BUILD_TYPE=Release ../..
make -j4 install
popd
popd
# rm -rf third_party/cares/cares # wipe out to prevent influencing the grpc build
# Install zlib
pushd third_party/zlib
mkdir -p cmake/build
pushd cmake/build
cmake -DCMAKE_BUILD_TYPE=Release ../..
make -j4 install
popd
popd
# rm -rf third_party/zlib # wipe out to prevent influencing the grpc build
# Install protobuf
pushd third_party/protobuf
mkdir -p cmake/build
pushd cmake/build
cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release ..
make -j4 install
popd
popd
# rm -rf third_party/protobuf # wipe out to prevent influencing the grpc build
rm -rf cmake/build
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DCMAKE_BUILD_TYPE=Release -DgRPC_ABSL_PROVIDER=package --DCMAKE_INSTALL_PREFIX="${PREFIX}" ../..
# See https://github.com/grpc/grpc/issues/13841
make -j 4 && make install
popd
popd
echo "Installing text-classifier"
mkdir -p $PREFIX
rm -rf build
mkdir -p build
pushd build
cmake .. -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=Release
make -j 4 && make install
popd