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: Konrad 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: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
This commit is contained in:
Konrad Sztyber 2022-01-05 10:14:39 +01:00 committed by Tomasz Zawadzki
parent 048fb36ac3
commit 509241cef3
6 changed files with 26 additions and 2 deletions

3
CONFIG
View File

@ -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
configure vendored
View File

@ -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)

View File

@ -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))

View File

@ -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

View File

@ -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."

View File

@ -103,6 +103,8 @@ pip3 install meson
pip3 install pyelftools
pip3 install ijson
pip3 install python-magic
pip3 install grpcio
pip3 install grpcio-tools
# Additional dependencies for SPDK CLI - not available in rhel and centos
if ! echo "$ID $VERSION_ID" | grep -E -q 'rhel 7|centos 7'; then