Commit 509241ce authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

configure: add switch for enabling SMA



The SMA requires some extra python packages during the build to generate
the protobuf interface, so this option will select whether it's enabled
or not.  Additionally, the dependencies are added to `pkgdep.sh` in this
patch.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib0d75c86d4d8575ec1245b219b4e96edb773b366
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10974


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarMonica Kenguva <monica.kenguva@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
parent 048fb36a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -204,3 +204,6 @@ CONFIG_HAVE_LIBBSD=n

# Path to IPSEC_MB used by DPDK
CONFIG_IPSEC_MB_DIR=

# Generate Storage Management Agent's protobuf interface
CONFIG_SMA=n
+16 −0
Original line number Diff line number Diff line
@@ -106,6 +106,8 @@ function usage() {
	echo "                           Path to clang_rt.fuzzer_no_main library required."
	echo "                           Requires setting CC and CXX to clang."
	echo "                           (Typically /usr/lib/llvm-VER/lib/clang/VER/lib/linux/libclang_rt.fuzzer_no_main-ARCH.a)"
	echo " --with-sma                Generate Storage Management Agent's protobuf interface"
	echo " --without-sma             No path required."
	echo ""
	echo "Environment variables:"
	echo ""
@@ -623,6 +625,12 @@ for i in "$@"; do
			CONFIG[FUZZER]=n
			CONFIG[FUZZER_LIB]=
			;;
		--with-sma)
			CONFIG[SMA]=y
			;;
		--without-sma)
			CONFIG[SMA]=n
			;;
		--)
			break
			;;
@@ -1109,6 +1117,14 @@ if [[ "${CONFIG[ISAL]}" = "y" ]]; then
	cd $rootdir
fi

if [[ "${CONFIG[SMA]}" = "y" ]]; then
	if ! python3 -c 'import grpc; import grpc_tools' 2> /dev/null; then
		echo "--with-sma requires grpcio and grpcio-tools python packages."
		echo "Please install then re-run this script."
		exit 1
	fi
fi

# For ARM Neoverse-N1 platform, debug build needs gcc version newer than 8.4
if [[ "${CONFIG[DEBUG]}" = "y" && $arch = aarch64* && "$CC_TYPE" = "gcc" ]]; then
	GCC_VERSION=$($CC -dumpfullversion)
+1 −2
Original line number Diff line number Diff line
@@ -40,8 +40,7 @@ $(1)/%_pb2.py $(1)/%_pb2_grpc.py: $(1)/%.proto
		--grpc_python_out=$(1) --proto_path=$(1) $$^
endef

# Check for the required modules here until there's a configure option for SMA
ifeq ($(shell python3 -c 'import grpc; import grpc_tools' && echo 0),0)
ifeq ($(CONFIG_SMA),y)
protodirs = spdk/sma/proto
protodefs = $(foreach protodir,$(protodirs),$(wildcard $(protodir)/*.proto))
protopy = $(foreach proto,$(basename $(protodefs)),$(addprefix $(proto),_pb2.py _pb2_grpc.py))
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ pip install configshell_fb
pip install pyelftools
pip install ijson
pip install python-magic
pip install grpcio
pip install grpcio-tools
# Additional dependencies for DPDK
pacman -Sy --needed --noconfirm numactl nasm
# Additional dependencies for ISA-L used in compression
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ fi
pip3 install pyelftools
pip3 install ijson
pip3 install python-magic
pip3 install grpcio
pip3 install grpcio-tools
# Additional dependencies for SPDK CLI - not available on older Ubuntus
apt-get install -y python3-configshell-fb python3-pexpect || echo \
	"Note: Some SPDK CLI dependencies could not be installed."
Loading