From: Joel Godfrey-Smith Date: Thu, 3 Apr 2025 17:34:10 +0000 (-0400) Subject: build: updated to build on RHEL-8 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F43056%2F2;p=vpp.git build: updated to build on RHEL-8 Type: improvement Makefile: updated ability to detect os version id for rhel distros and added section for rhel-8 packages names in rpm dependencies. extras/depricated/vom/vom.mk: updated path for rhel8 toolset Change-Id: If760e64a06ff9d8cbe354dc64f13f271a644263e Signed-off-by: Joel Godfrey-Smith Change-Id: I8dae5fceb6b9f370f2c53066550afb608e95e087 Signed-off-by: Joel Godfrey-Smith --- diff --git a/Makefile b/Makefile index dece4021366..792d5c4bf80 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,11 @@ GDB_ARGS= -ex "handle SIGUSR1 noprint nostop" # We allow Darwin (MacOS) for docs generation; VPP build will still fail. ifneq ($(shell uname),Darwin) OS_ID = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') +ifeq ($(OS_ID),rhel) +OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/\..*//') +else OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') +endif OS_CODENAME = $(shell grep '^VERSION_CODENAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') endif @@ -202,6 +206,20 @@ else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8) RPM_DEPENDS += infiniband-diags libibumad RPM_DEPENDS += libpcap-devel llvm-toolset RPM_DEPENDS_GROUPS = 'Development Tools' +else ifeq ($(OS_ID)-$(OS_VERSION_ID),rhel-8) + RPM_DEPENDS += yum-utils + RPM_DEPENDS += openssl-devel + RPM_DEPENDS += python3-ply # for vppapigen + RPM_DEPENDS += python36-devel + RPM_DEPENDS += python3-pip + RPM_DEPENDS += python3-virtualenv + RPM_DEPENDS += python3-jsonschema + RPM_DEPENDS += gcc-toolset-9 + RPM_DEPENDS += gcc-toolset-9-libasan-devel + RPM_DEPENDS += cmake + RPM_DEPENDS += llvm-toolset + RPM_DEPENDS += infiniband-diags + RPM_DEPENDS += autoconf automake bison byacc libtool else ifeq ($(OS_ID)-$(OS_VERSION_ID),anolis-8) RPM_DEPENDS += yum-utils RPM_DEPENDS += compat-openssl10 openssl-devel @@ -382,7 +400,7 @@ ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID)) exit 0 else ifneq ("$(wildcard /etc/redhat-release)","") @for i in $(RPM_DEPENDS) ; do \ - RPM=$$(basename -s .rpm "$${i##*/}" | cut -d- -f1,2,3,4) ; \ + RPM=$$(basename -s .rpm "$${i##*/}") ; \ MISSING+=$$(rpm -q $$RPM | grep "^package") ; \ done ; \ if [ -n "$$MISSING" ] ; then \ @@ -404,7 +422,11 @@ ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID)) @sudo -E apt-get update @sudo -E apt-get $(APT_ARGS) $(CONFIRM) $(FORCE) install $(DEB_DEPENDS) else ifneq ("$(wildcard /etc/redhat-release)","") -ifeq ($(OS_ID),rhel) +ifeq ($(OS_ID)-$(OS_VERSION_ID),rhel-8) + @sudo -E dnf install $(CONFIRM) https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm + @sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS) + @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs zlib +else ifeq ($(OS_ID)-$(OS_VERSION_ID),rhel-7) @sudo -E yum-config-manager --enable rhel-server-rhscl-7-rpms @sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS) @sudo -E yum install $(CONFIRM) $(RPM_DEPENDS) diff --git a/extras/deprecated/vom/vom.mk b/extras/deprecated/vom/vom.mk index 97fa900b842..10f7f9668fc 100644 --- a/extras/deprecated/vom/vom.mk +++ b/extras/deprecated/vom/vom.mk @@ -15,6 +15,18 @@ vom_configure_depend = vpp-install vom_source = extras vom_configure_subdir = vom +# OS Detection +# +# We allow Darwin (MacOS) for docs generation; VPP build will still fail. +ifneq ($(shell uname),Darwin) +OS_ID = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') + ifeq ($(OS_ID),rhel) + OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/\..*//') + else + OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') + endif +endif + ifneq ($(shell which cmake3 2>/dev/null),) CMAKE?=cmake3 else @@ -27,9 +39,16 @@ vom_cmake_args += -DCMAKE_CXX_FLAGS="$($(TAG)_TAG_CPPFLAGS)" vom_cmake_args += -DCMAKE_SHARED_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)" vom_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(PACKAGE_INSTALL_DIR)/../vpp" -# Use devtoolset on centos 7 -ifneq ($(wildcard /opt/rh/devtoolset-9/enable),) -vom_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-9/root/bin" +# Use devtoolset +ifeq ($(OS_ID)-$(OS_VERSION_ID),rhel-8) + ifneq ($(wildcard /opt/rh/gcc-toolset-9/enable),) + vom_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/gcc-toolset-9/root/bin" + endif +else + # Use devtoolset on centos 7 + ifneq ($(wildcard /opt/rh/devtoolset-9/enable),) + vom_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-9/root/bin" + endif endif vom_configure = \