-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathutils_build.bash
More file actions
127 lines (112 loc) · 3.45 KB
/
Copy pathutils_build.bash
File metadata and controls
127 lines (112 loc) · 3.45 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/utils_base.bash"
################################################################################
# Build Tools Setup
################################################################################
install_build_tools () {
if which dnf; then
# Install EPEL and enable CRB
(dnf install -y epel-release) || return 1
(dnf install 'dnf-command(config-manager)') || return 1
(dnf config-manager --set-enabled crb) || return 1
# Install all other packages
(dnf install -y \
bc \
binutils \
binutils-devel \
bison \
bzip2-devel \
cmake \
double-conversion \
double-conversion-devel \
findutils \
flex \
git \
g++ \
gcc \
jq \
libaio-devel \
libatomic \
libdwarf \
libdwarf-devel \
libsodium-devel \
libtool \
libunwind-devel \
libzstd-devel \
lz4-devel \
ninja-build \
openssl-devel \
patch \
pciutils \
perl \
snappy-devel \
sudo \
tar \
texinfo \
wget \
which \
xz-devel \
zlib-devel) || return 1
fi
}
################################################################################
# Python Tools Setup
################################################################################
install_python_tools () {
local env_name="$1"
if [ "$env_name" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME"
echo "Example(s):"
echo " ${FUNCNAME[0]} build_env"
return 1
else
echo "################################################################################"
echo "# Install Build Tools"
echo "#"
echo "# [$(date --utc +%FT%T.%3NZ)] + ${FUNCNAME[0]} ${*}"
echo "################################################################################"
echo ""
fi
test_network_connection || return 1
# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")
echo "[INSTALL] Installing build tools ..."
# shellcheck disable=SC2086
(exec_with_retries 3 conda install ${env_prefix} -c conda-forge --override-channels -y \
click \
numpy=1.* \
pandas \
pyyaml \
tabulate \
packaging) || return 1
# Check Python packages are importable
local import_tests=( click numpy pandas tabulate packaging )
for p in "${import_tests[@]}"; do
(test_python_import_package "${env_name}" "${p}") || return 1
done
echo "[INSTALL] Successfully installed all the build tools"
}
################################################################################
# HHVM Setup
################################################################################
install_hhvm (){
echo "[INSTALL] Installing hhvm ..."
if which dnf; then
wget https://github.com/facebookresearch/DCPerf/releases/download/hhvm/hhvm-3.30-multplatform-binary.tar.xz
tar -Jxf hhvm-3.30-multplatform-binary.tar.xz
else
wget https://github.com/facebookresearch/DCPerf/releases/download/hhvm/hhvm-3.30-multplatform-binary-ubuntu.tar.xz
tar -Jxf hhvm-3.30-multplatform-binary-ubuntu.tar.xz
apt-get update
apt-get install -y libpcre3 libunwind8
fi
cd hhvm || return 1
bash -x ./pour-hhvm.sh
cd .. || return 1
}