Commit e83c17c2 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(build): removing folly dependency

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@openairinterface.org>
parent fc144e0b
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
# #
####################################### #######################################
#SUPPORTED_DISTRO="Ubuntu 18.04, CentOS 7, RHEL 7" #SUPPORTED_DISTRO="Ubuntu 18.04, CentOS 7, RHEL 7"
SUPPORTED_DISTRO="Ubuntu 18.04,RHEL8" SUPPORTED_DISTRO="Ubuntu 18.04,20.04,22.04, RHEL8"
if [ ! -f /etc/os-release ]; then if [ ! -f /etc/os-release ]; then
echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro." echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro."
fi fi
...@@ -128,6 +128,8 @@ check_supported_distribution() { ...@@ -128,6 +128,8 @@ check_supported_distribution() {
local distribution=$(get_distribution_release) local distribution=$(get_distribution_release)
case "$distribution" in case "$distribution" in
"ubuntu18.04") return 0 ;; "ubuntu18.04") return 0 ;;
"ubuntu20.04") return 0 ;;
"ubuntu22.04") return 0 ;;
"rhel8") return 0 ;; "rhel8") return 0 ;;
"rhel8.2") return 0 ;; "rhel8.2") return 0 ;;
"rhel8.3") return 0 ;; "rhel8.3") return 0 ;;
...@@ -164,7 +166,10 @@ clean_kernel() { ...@@ -164,7 +166,10 @@ clean_kernel() {
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
disable_ipv6() { disable_ipv6() {
$SUDO sysctl -w net.ipv6.conf.all.disable_ipv6=1 if [ $IS_CONTAINER -eq 0 ]
then
$SUDO sysctl -w net.ipv6.conf.all.disable_ipv6=1
fi
} }
......
...@@ -30,45 +30,7 @@ ...@@ -30,45 +30,7 @@
SCRIPT=$(readlink -f ${BASH_SOURCE}) SCRIPT=$(readlink -f ${BASH_SOURCE})
THIS_SCRIPT_PATH=`dirname $SCRIPT` THIS_SCRIPT_PATH=`dirname $SCRIPT`
source $THIS_SCRIPT_PATH/build_helper source $THIS_SCRIPT_PATH/build_helper
source $THIS_SCRIPT_PATH/build_helper.libconfig
source $THIS_SCRIPT_PATH/build_helper.fb_folly
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_fmt() {
echo "Starting to install fmt"
if [ $1 -eq 0 ]; then
read -p "Do you want to install open-source formatting library for C++ ? <y/N> " prompt
OPTION=""
else
prompt='y'
OPTION="-y"
fi
echo "Install fmt from source"
if [[ $prompt =~ [yY](es)* ]]
then
cd /tmp
echo "Downloading fmt"
$SUDO rm -rf /tmp/fmt*
git clone https://github.com/fmtlib/fmt.git
ret=$?;[[ $ret -ne 0 ]] && return $ret
cd fmt
# Looks like since Nov 11 commits, we cannot build
git checkout -f 1936dddc3c53c1c0db55a665cf419dc7a257ba62
$CMAKE -DFMT_TEST=FALSE .
ret=$?;[[ $ret -ne 0 ]] && return $ret
make -j `nproc`
ret=$?;[[ $ret -ne 0 ]] && return $ret
$SUDO make install
cd /tmp
rm -rf /tmp/fmt*
fi
echo "fmt installation complete"
return 0
}
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script) #arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries) #arg2 is debug (0 or 1) (install debug libraries)
...@@ -144,21 +106,23 @@ install_pistache_from_git() { ...@@ -144,21 +106,23 @@ install_pistache_from_git() {
cd pistache && git checkout e18ed9baeb2145af6f9ea41246cf48054ffd9907 cd pistache && git checkout e18ed9baeb2145af6f9ea41246cf48054ffd9907
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build mkdir _build && cd _build
$CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. $CMAKE -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release \
-DPISTACHE_BUILD_EXAMPLES=false \
-DPISTACHE_BUILD_TESTS=false \
-DPISTACHE_BUILD_DOCS=false \
..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make make -j $(nproc)
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install $SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd popd
rm -Rf $OPENAIRCN_DIR/build/ext/pistache/_build
fi fi
echo "pistache installation complete" echo "pistache installation complete"
return 0 return 0
} }
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script) #arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries) #arg2 is debug (0 or 1) (install debug libraries)
...@@ -200,6 +164,7 @@ install_nlohmann_from_git() { ...@@ -200,6 +164,7 @@ install_nlohmann_from_git() {
$SUDO make install $SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd popd
rm -Rf $OPENAIRCN_DIR/build/ext/json/_build
fi fi
echo "Nlohmann Json installation complete" echo "Nlohmann Json installation complete"
return 0 return 0
...@@ -229,7 +194,7 @@ install_nghttp2_from_git() { ...@@ -229,7 +194,7 @@ install_nghttp2_from_git() {
if [[ $OS_DISTRO == "ubuntu" ]]; then if [[ $OS_DISTRO == "ubuntu" ]]; then
PACKAGE_LIST="\ PACKAGE_LIST="\
g++ \ g++ \
cmake \ $CMAKE \
binutils \ binutils \
autoconf \ autoconf \
automake \ automake \
...@@ -240,7 +205,7 @@ install_nghttp2_from_git() { ...@@ -240,7 +205,7 @@ install_nghttp2_from_git() {
libcunit1-dev \ libcunit1-dev \
libssl-dev \ libssl-dev \
libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev \ libxml2-dev libev-dev libevent-dev libjansson-dev libc-ares-dev \
libjemalloc-dev libsystemd-dev cython python3-dev python-setuptools" libjemalloc-dev libsystemd-dev python3-dev python-setuptools"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\ PACKAGE_LIST="\
gcc-c++ \ gcc-c++ \
...@@ -260,7 +225,7 @@ install_nghttp2_from_git() { ...@@ -260,7 +225,7 @@ install_nghttp2_from_git() {
echo_fatal "$OS_DISTRO is not a supported distribution." echo_fatal "$OS_DISTRO is not a supported distribution."
fi fi
echo "Install build tools" echo "Install build tools"
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST $SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
GIT_URL=https://github.com/nghttp2/nghttp2.git GIT_URL=https://github.com/nghttp2/nghttp2.git
...@@ -283,20 +248,21 @@ install_nghttp2_from_git() { ...@@ -283,20 +248,21 @@ install_nghttp2_from_git() {
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
autoconf autoconf
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
./configure --enable-asio-lib ./configure --enable-asio-lib --enable-lib-only
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make make -j $(nproc)
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install $SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO ldconfig
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
git clean -x -d -ff .
popd popd
fi fi
echo "nghttp2 installation complete" echo "nghttp2 installation complete"
return 0 return 0
} }
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script) #arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries) #arg2 is debug (0 or 1) (install debug libraries)
...@@ -365,6 +331,7 @@ install_cpp_jwt_from_git() { ...@@ -365,6 +331,7 @@ install_cpp_jwt_from_git() {
$SUDO make install $SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd popd
rm -Rf $OPENAIRCN_DIR/build/ext/cpp-jwt/_build
fi fi
echo "cpp_jwt installation complete" echo "cpp_jwt installation complete"
return 0 return 0
...@@ -395,7 +362,9 @@ check_install_nrf_deps() { ...@@ -395,7 +362,9 @@ check_install_nrf_deps() {
#$SUDO systemctl mask apt-daily.timer #$SUDO systemctl mask apt-daily.timer
#$SUDO systemctl mask apt-daily-upgrade.service #$SUDO systemctl mask apt-daily-upgrade.service
#$SUDO systemctl mask apt-daily-upgrade.timer #$SUDO systemctl mask apt-daily-upgrade.timer
$SUDO sed -i 's/1/0/g' /etc/apt/apt.conf.d/10periodic if [ $IS_CONTAINER -eq 0 ]; then
$SUDO sed -i 's/1/0/g' /etc/apt/apt.conf.d/10periodic
fi
fi fi
update_package_db update_package_db
...@@ -408,24 +377,16 @@ check_install_nrf_deps() { ...@@ -408,24 +377,16 @@ check_install_nrf_deps() {
PACKAGE_LIST="\ PACKAGE_LIST="\
autoconf \ autoconf \
automake \ automake \
bison \
build-essential \ build-essential \
$CMAKE \ $CMAKE \
daemon \
doxygen \
flex \
gdb \
git" git"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\ PACKAGE_LIST="\
autoconf \ autoconf \
automake \ automake \
bison \ gcc-c++ \
$CMAKE \ $CMAKE \
make \ make \
doxygen \
flex \
gdb \
git" git"
else else
echo_fatal "$OS_DISTRO is not a supported distribution." echo_fatal "$OS_DISTRO is not a supported distribution."
...@@ -434,45 +395,44 @@ check_install_nrf_deps() { ...@@ -434,45 +395,44 @@ check_install_nrf_deps() {
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST $SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
# Libraries # Libraries
if [[ $OS_DISTRO == "ubuntu" ]]; then if [[ $OS_DISTRO == "ubuntu" ]]; then
case "$(get_distribution_release)" in case "$(get_distribution_release)" in
"ubuntu18.04") "ubuntu18.04")
specific_packages="libconfig++-dev libasio-dev libboost-all-dev" # Currently Ubuntu18.04 has boost 1.65 as the latest
;; # We need at least 1.66
# PPA has 1.67
$SUDO $INSTALLER install $OPTION software-properties-common
$SUDO add-apt-repository ppa:mhier/libboost-latest --yes
$SUDO $INSTALLER update
specific_packages="libconfig++-dev libasio-dev libboost-all-dev libasan4"
;;
"ubuntu20.04")
specific_packages="libconfig++-dev libasio-dev libboost-all-dev libasan5"
;;
"ubuntu22.04")
specific_packages="libconfig++-dev libasio-dev libboost-all-dev libasan6"
;;
esac esac
# removed libspdlog-dev # removed libspdlog-dev
PACKAGE_LIST="\ PACKAGE_LIST="\
$specific_packages \ $specific_packages \
guile-2.0-dev \
libcurl4-gnutls-dev \ libcurl4-gnutls-dev \
libevent-dev \ libevent-dev \
libgcrypt11-dev \
libgmp-dev \
libhogweed? \
libidn2-0-dev \
libidn11-dev \
libpthread-stubs0-dev \
libssl-dev \ libssl-dev \
libtool \ libtool \
libxml2 \ libxml2 \
libxml2-dev \ libxml2-dev \
openssl \ openssl \
python \
nettle-dev \ nettle-dev \
libcurl4 \ libcurl4 \
net-tools \ net-tools \
pkg-config" pkg-config \
ninja-build"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\ PACKAGE_LIST="\
guile-devel \
libconfig-devel \ libconfig-devel \
libgcrypt-devel \ libgcrypt-devel \
gmp-devel \
libidn-devel \
lksctp-tools \
lksctp-tools-devel \
openssl-devel \ openssl-devel \
libtool \ libtool \
libxml2 \ libxml2 \
...@@ -482,28 +442,35 @@ check_install_nrf_deps() { ...@@ -482,28 +442,35 @@ check_install_nrf_deps() {
nettle-devel \ nettle-devel \
libcurl-devel \ libcurl-devel \
python2 \ python2 \
pkgconfig" pkgconfig \
ninja-build \
libasan"
else else
echo_fatal "$OS_DISTRO is not a supported distribution." echo_fatal "$OS_DISTRO is not a supported distribution."
fi fi
echo "Install distro libs" echo "Install distro libs"
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST $SUDO $INSTALLER install $OPTION $PACKAGE_LIST
# fix issue with libboost in U18 for a bare metal deployment
if [[ $OS_DISTRO == "ubuntu" ]]; then
case "$(get_distribution_release)" in
"ubuntu18.04")
$SUDO $INSTALLER remove $OPTION libboost1.65-dev || true
$SUDO $INSTALLER autoremove $OPTION || true
$SUDO $INSTALLER install $OPTION libboost1.67-dev
;;
esac
fi
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
echo "distro libs installation complete" echo "distro libs installation complete"
# Use fmt lib included in spdlog
#install_fmt $1
#ret=$?;[[ $ret -ne 0 ]] && return $ret
install_spdlog_from_git $1 $2 install_spdlog_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
install_fb_folly_from_source $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
install_pistache_from_git $1 $2 install_pistache_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
install_nlohmann_from_git $1 $2 install_nlohmann_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
......
...@@ -464,8 +464,6 @@ class HtmlReport(): ...@@ -464,8 +464,6 @@ class HtmlReport():
section_end_pattern = 'build_nrf --clean --Verbose --build-type Release --jobs' section_end_pattern = 'build_nrf --clean --Verbose --build-type Release --jobs'
section_status = False section_status = False
package_install = False package_install = False
folly_build_start = False
folly_build_status = False
spdlog_build_start = False spdlog_build_start = False
spdlog_build_status = False spdlog_build_status = False
pistache_build_start = False pistache_build_start = False
...@@ -501,12 +499,6 @@ class HtmlReport(): ...@@ -501,12 +499,6 @@ class HtmlReport():
result = re.search('spdlog installation complete', line) result = re.search('spdlog installation complete', line)
if result is not None and spdlog_build_start: if result is not None and spdlog_build_start:
spdlog_build_status = True spdlog_build_status = True
result = re.search('Starting to install folly', line)
if result is not None:
folly_build_start = True
result = re.search('folly installation complete', line)
if result is not None and folly_build_start:
folly_build_status = True
result = re.search('Starting to install pistache', line) result = re.search('Starting to install pistache', line)
if result is not None: if result is not None:
pistache_build_start = True pistache_build_start = True
...@@ -554,12 +546,6 @@ class HtmlReport(): ...@@ -554,12 +546,6 @@ class HtmlReport():
cell_msg += ' ** spdlog Installation: OK\n' cell_msg += ' ** spdlog Installation: OK\n'
else: else:
cell_msg += ' ** spdlog Installation: KO\n' cell_msg += ' ** spdlog Installation: KO\n'
if base_image:
cell_msg += ' ** folly Installation: N/A\n'
elif folly_build_status:
cell_msg += ' ** folly Installation: OK\n'
else:
cell_msg += ' ** folly Installation: KO\n'
if base_image: if base_image:
cell_msg += ' ** pistache Installation: N/A\n' cell_msg += ' ** pistache Installation: N/A\n'
elif pistache_build_status: elif pistache_build_status:
......
...@@ -291,5 +291,4 @@ IF(STATIC_LINKING) ...@@ -291,5 +291,4 @@ IF(STATIC_LINKING)
ENDIF(STATIC_LINKING) ENDIF(STATIC_LINKING)
target_link_libraries (nrf ${ASAN} target_link_libraries (nrf ${ASAN}
-Wl,--start-group NRF 3GPP_COMMON_TYPES NRF_API CN_UTILS -lnettle ${NETTLE_LIBRARIES} ${CRYPTO_LIBRARIES} -lnghttp2_asio -lboost_system -lboost_thread -lboost_date_time -lssl -lcrypto gflags glog dl double-conversion folly -Wl,--end-group pthread m rt config++ event boost_system pistache curl) -Wl,--start-group NRF 3GPP_COMMON_TYPES NRF_API CN_UTILS -lnettle ${NETTLE_LIBRARIES} ${CRYPTO_LIBRARIES} -lnghttp2_asio -lboost_system -lboost_thread -lboost_date_time -lssl -lcrypto dl -Wl,--end-group pthread m rt config++ event boost_system pistache curl)
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment