xref: /spdk/scripts/pkgdep/mariner.sh (revision 6fac5aab5832d709761d179d82103f29c33031ed)
1#!/usr/bin/env bash
2
3#  SPDX-License-Identifier: BSD-3-Clause
4#  All rights reserved.
5
6additional_dependencies() {
7	# Additional dependencies for SPDK CLI
8	tdnf install -y python3-pexpect
9	# Additional dependencies for ISA-L used in compression
10	tdnf install -y help2man
11	# Additional dependencies for DPDK
12	if [[ "$(uname -m)" != "aarch64" ]]; then
13		tdnf install -y nasm
14	fi
15	tdnf install -y libnuma-devel
16	# Additional dependencies for USDT
17	tdnf install -y systemtap-sdt-devel
18	if [[ $INSTALL_DEV_TOOLS == "true" ]]; then
19		# Tools for developers
20		devtool_pkgs=(git sg3_utils pciutils bash-completion ruby-devel)
21		devtool_pkgs+=(gcovr python3-pycodestyle)
22		tdnf install -y "${devtool_pkgs[@]}"
23	fi
24	if [[ $INSTALL_PMEM == "true" ]]; then
25		# Additional dependencies for building pmem based backends
26		tdnf install -y libpmemobj-devel || true
27	fi
28	if [[ $INSTALL_FUSE == "true" ]]; then
29		# Additional dependencies for FUSE and NVMe-CUSE
30		tdnf install -y fuse3-devel
31	fi
32	if [[ $INSTALL_RBD == "true" ]]; then
33		# Additional dependencies for RBD bdev in NVMe over Fabrics
34		tdnf install -y librados-devel librbd-devel
35	fi
36	if [[ $INSTALL_RDMA == "true" ]]; then
37		# Additional dependencies for RDMA transport in NVMe over Fabrics
38		tdnf install -y libibverbs librdmacm
39	fi
40	if [[ $INSTALL_DOCS == "true" ]]; then
41		# Additional dependencies for building docs
42		tdnf install -y mscgen || echo "Warning: couldn't install mscgen via tdnf. Please install mscgen manually."
43		tdnf install -y doxygen graphviz
44	fi
45	if [[ $INSTALL_DAOS == "true" ]]; then
46		echo "Unsupported. Skipping installation of DAOS bdev dependencies."
47	fi
48	# Additional dependencies for Avahi
49	if [[ $INSTALL_AVAHI == "true" ]]; then
50		# Additional dependencies for Avahi
51		tdnf install -y avahi-devel
52	fi
53	if [[ $INSTALL_LZ4 == "true" ]]; then
54		tdnf install -y liblz4
55	fi
56}
57
58tdnf install -y ca-certificates build-essential
59tdnf install -y CUnit-devel \
60	clang \
61	clang-devel \
62	cmake \
63	json-c-devel \
64	libaio-devel \
65	libcmocka-devel \
66	libiscsi-devel \
67	libuuid-devel \
68	ncurses-devel \
69	openssl-devel \
70	procps-ng \
71	python \
72	python3-devel \
73	python3-pip \
74	tar \
75	unzip
76
77if [[ ! -e /usr/bin/python ]]; then
78	ln -s /usr/bin/python3 /usr/bin/python
79fi
80
81pips=(
82	meson
83	ninja
84	pyelftools
85	ijson
86	python-magic
87	pyyaml
88	grpcio
89	grpcio-tools
90	Jinja2
91	tabulate
92)
93
94if ((EUID == 0)); then
95	cat <<- WARNING
96		Warning: Running as root. You may want to install the pip packages
97		as a non-root user if you wish to build SPDK as a non-root user.
98
99		Required packages:
100		$(printf '  %s\n' "${pips[@]}")
101
102	WARNING
103fi
104
105pip3 install "${pips[@]}"
106
107additional_dependencies
108