Commit | Line | Data |
---|---|---|
ce1b5612 SW |
1 | #!/bin/bash |
2 | # This script expects to be invoked from the base fio directory. | |
3 | set -eu | |
4 | ||
5 | SCRIPT_DIR=$(dirname "$0") | |
6 | # shellcheck disable=SC1091 | |
7 | . "${SCRIPT_DIR}/common.sh" | |
8 | ||
9 | install_ubuntu() { | |
10 | local pkgs | |
11 | ||
12 | cat <<DPKGCFG | sudo tee /etc/dpkg/dpkg.cfg.d/dpkg-speedup > /dev/null | |
13 | # Skip fsync | |
14 | force-unsafe-io | |
15 | # Don't install documentation | |
16 | path-exclude=/usr/share/man/* | |
17 | path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo | |
18 | path-exclude=/usr/share/doc/* | |
19 | DPKGCFG | |
20 | # Packages available on i686 and x86_64 | |
21 | pkgs=( | |
22 | libaio-dev | |
23 | libcunit1-dev | |
24 | libcurl4-openssl-dev | |
25 | libfl-dev | |
ce1b5612 | 26 | libnuma-dev |
dff32ddb | 27 | libnfs-dev |
ce1b5612 SW |
28 | valgrind |
29 | ) | |
30 | case "${CI_TARGET_ARCH}" in | |
31 | "i686") | |
32 | sudo dpkg --add-architecture i386 | |
33 | pkgs=("${pkgs[@]/%/:i386}") | |
34 | pkgs+=( | |
35 | gcc-multilib | |
36 | pkg-config:i386 | |
37 | zlib1g-dev:i386 | |
38 | ) | |
39 | ;; | |
40 | "x86_64") | |
41 | pkgs+=( | |
42 | libglusterfs-dev | |
43 | libgoogle-perftools-dev | |
44 | libiscsi-dev | |
45 | libnbd-dev | |
46 | libpmem-dev | |
4e2bd713 | 47 | libpmem2-dev |
4e2bd713 | 48 | libprotobuf-c-dev |
ce1b5612 SW |
49 | librbd-dev |
50 | libtcmalloc-minimal4 | |
51 | nvidia-cuda-dev | |
b68ba328 VF |
52 | libibverbs-dev |
53 | librdmacm-dev | |
ce1b5612 | 54 | ) |
726a9585 VF |
55 | echo "Removing libunwind-14-dev because of conflicts with libunwind-dev" |
56 | sudo apt remove -y libunwind-14-dev | |
ce1b5612 SW |
57 | ;; |
58 | esac | |
59 | ||
60 | # Architecture-independent packages and packages for which we don't | |
61 | # care about the architecture. | |
62 | pkgs+=( | |
63 | python3-scipy | |
5c997f9c | 64 | python3-sphinx |
888dbd62 | 65 | python3-statsmodels |
ce1b5612 SW |
66 | ) |
67 | ||
68 | echo "Updating APT..." | |
69 | sudo apt-get -qq update | |
b68ba328 VF |
70 | echo "Installing packages... ${pkgs[@]}" |
71 | sudo apt-get install -o APT::Immediate-Configure=false --no-install-recommends -qq -y "${pkgs[@]}" | |
4e2bd713 LD |
72 | if [ "${CI_TARGET_ARCH}" == "x86_64" ]; then |
73 | # install librpma from sources | |
74 | ci/actions-install-librpma.sh | |
75 | fi | |
ce1b5612 SW |
76 | } |
77 | ||
78 | install_linux() { | |
79 | install_ubuntu | |
80 | } | |
81 | ||
82 | install_macos() { | |
83 | # Assumes homebrew and python3 are already installed | |
84 | #echo "Updating homebrew..." | |
85 | #brew update >/dev/null 2>&1 | |
86 | echo "Installing packages..." | |
02ee8a1b VF |
87 | HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs sphinx-doc |
88 | brew link sphinx-doc --force | |
888dbd62 | 89 | pip3 install scipy six statsmodels |
ce1b5612 SW |
90 | } |
91 | ||
89d08880 VF |
92 | install_windows() { |
93 | pip3 install scipy six statsmodels sphinx | |
94 | } | |
95 | ||
ce1b5612 | 96 | main() { |
9b3cc2dd BVA |
97 | case "${CI_TARGET_BUILD}" in |
98 | android*) | |
99 | echo "Installing Android NDK..." | |
100 | wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip | |
101 | unzip -q android-ndk-r24-linux.zip | |
102 | return 0 | |
103 | ;; | |
104 | esac | |
787c02a6 | 105 | |
ce1b5612 SW |
106 | set_ci_target_os |
107 | ||
108 | install_function="install_${CI_TARGET_OS}" | |
109 | ${install_function} | |
110 | ||
111 | echo "Python3 path: $(type -p python3 2>&1)" | |
112 | echo "Python3 version: $(python3 -V 2>&1)" | |
113 | } | |
114 | ||
115 | main |