Commit fc144e0b authored by Raphael Defosseux's avatar Raphael Defosseux

fix(build): compilation errors with gcc-g++ v11

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@openairinterface.org>
parent 2fc1fc12
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
# file build_helper.fb_folly
# brief
# author Lionel GAUTHIER
#
#######################################
SCRIPT=$(readlink -f ${BASH_SOURCE})
THIS_SCRIPT_PATH=`dirname $SCRIPT`
source $THIS_SCRIPT_PATH/build_helper
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_fb_folly_from_source(){
echo "Starting to install folly"
if [ $1 -eq 0 ]; then
OPTION=""
read -p "Do you want to install FaceBook folly (github)? <y/N> " prompt
else
prompt='y'
OPTION="-y"
fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi
if [[ $prompt =~ [yY](es)* ]]
then
if [[ "$OS_BASEDISTRO" == "fedora" ]]; then
$SUDO $INSTALLER install $OPTION \
gcc-c++ \
$CMAKE \
boost-devel \
libevent-devel \
double-conversion-devel \
glog-devel \
gflags-devel \
snappy-devel \
make \
lz4-devel \
zlib-devel \
binutils-devel \
jemalloc-devel \
openssl-devel \
pkg-config
ret=$?;[[ $ret -ne 0 ]] && return $ret
elif [[ $OS_DISTRO == "ubuntu" ]]; then
$SUDO $INSTALLER install $OPTION \
g++ \
cmake \
libboost-all-dev \
libevent-dev \
libdouble-conversion-dev \
libgoogle-glog-dev \
libgflags-dev \
libiberty-dev \
liblz4-dev \
liblzma-dev \
libsnappy-dev \
make \
zlib1g-dev \
binutils-dev \
libjemalloc-dev \
libssl-dev \
pkg-config
ret=$?;[[ $ret -ne 0 ]] && return $ret
fi
pushd /tmp
if [ $debug -eq 1 ]; then
# For advanced debugging options
$SUDO $INSTALLER install $OPTION \
libunwind8-dev \
libelf-dev \
libdwarf-dev
ret=$?;[[ $ret -ne 0 ]] && return $ret
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz && \
tar zxf release-1.8.0.tar.gz && \
rm -f release-1.8.0.tar.gz && \
cd googletest-release-1.8.0 && \
$CMAKE . && \
make && \
$SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
cd ..
fi
$SUDO rm -rf /tmp/folly
git clone https://github.com/facebook/folly.git
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
cd folly
if [[ "$OS_BASEDISTRO" == "fedora" ]]; then
git checkout -f v2019.06.17.00
echo 'diff --git a/build/fbcode_builder/CMake/FindGflags.cmake b/build/fbcode_builder/CMake/FindGflags.cmake' > patch.diff
echo 'index 246ceac..3b96716 100644' >> patch.diff
echo '--- a/build/fbcode_builder/CMake/FindGflags.cmake' >> patch.diff
echo '+++ b/build/fbcode_builder/CMake/FindGflags.cmake' >> patch.diff
echo '@@ -34,6 +34,9 @@ IF (LIBGFLAGS_INCLUDE_DIR)' >> patch.diff
echo ' ENDIF ()' >> patch.diff
echo '' >> patch.diff
echo ' find_package(gflags CONFIG QUIET)' >> patch.diff
echo '+get_filename_component (_LIB_PATH "${gflags_CONFIG}/../../../" ABSOLUTE)' >> patch.diff
echo '+unset(gflags_LIBRARIES)' >> patch.diff
echo '+find_library(gflags_LIBRARIES gflags PATHS ${_LIB_PATH})' >> patch.diff
echo ' if (gflags_FOUND)' >> patch.diff
echo ' if (NOT Gflags_FIND_QUIETLY)' >> patch.diff
echo ' message(STATUS "Found gflags from package config ${gflags_CONFIG}")' >> patch.diff
git apply patch.diff
else
git checkout -f v2019.11.11.00
fi
mkdir _build && cd _build
if [[ "$OS_BASEDISTRO" == "fedora" ]]; then
cmake3 ..
else
cmake ..
fi
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make -j $(nproc)
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
echo_success "folly installation complete"
return 0
}
......@@ -52,6 +52,7 @@
using namespace oai::nrf::app;
using namespace oai::nrf::model;
using namespace std::chrono;
using namespace boost::placeholders;
extern nrf_app* nrf_app_inst;
extern nrf_config nrf_cfg;
......
......@@ -43,6 +43,7 @@
using namespace Pistache::Http;
using namespace Pistache::Http::Mime;
using namespace oai::nrf::app;
using namespace boost::placeholders;
using json = nlohmann::json;
extern nrf_client* nrf_client_inst;
......
......@@ -39,6 +39,7 @@
using namespace std;
using namespace oai::nrf::app;
using namespace boost::placeholders;
//------------------------------------------------------------------------------
void nrf_profile::set_nf_instance_id(const std::string& instance_id) {
......
......@@ -35,6 +35,7 @@
#include "logger.hpp"
using namespace oai::nrf::app;
using namespace boost::placeholders;
//------------------------------------------------------------------------------
void nrf_subscription::set_subscription_id(const std::string& sub) {
......
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