Commit bdcd5f7c authored by chen2022's avatar chen2022

修改源

parent 753c9246
...@@ -28,7 +28,6 @@ INSTALL_DIR=/usr/local/bin ...@@ -28,7 +28,6 @@ INSTALL_DIR=/usr/local/bin
################################ ################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source ${THIS_SCRIPT_PATH}/build_helper.amf source ${THIS_SCRIPT_PATH}/build_helper.amf
#source ${THIS_SCRIPT_PATH}/build_helper.local
function help() function help()
{ {
......
...@@ -50,7 +50,8 @@ install_fmt() { ...@@ -50,7 +50,8 @@ install_fmt() {
cd /tmp cd /tmp
echo "Downloading fmt" echo "Downloading fmt"
$SUDO rm -rf /tmp/fmt* $SUDO rm -rf /tmp/fmt*
git clone https://github.com/fmtlib/fmt.git #git clone https://github.com/fmtlib/fmt.git
git clone http://git.opensource5g.org/openxg/fmt.git
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
cd fmt cd fmt
cmake -DFMT_TEST=FALSE . cmake -DFMT_TEST=FALSE .
...@@ -84,7 +85,8 @@ install_spdlog_from_git() { ...@@ -84,7 +85,8 @@ install_spdlog_from_git() {
if [[ $prompt =~ [yY](es)* ]] if [[ $prompt =~ [yY](es)* ]]
then then
GIT_URL=https://github.com/gabime/spdlog.git #GIT_URL=https://github.com/gabime/spdlog.git
GIT_URL=http://git.opensource5g.org/openxg/spdlog.git
echo "Install spdlog from $GIT_URL" echo "Install spdlog from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext pushd $OPENAIRCN_DIR/build/ext
echo "Downloading spdlog" echo "Downloading spdlog"
...@@ -123,7 +125,8 @@ install_pistache_from_git() { ...@@ -123,7 +125,8 @@ install_pistache_from_git() {
if [[ $prompt =~ [yY](es)* ]] if [[ $prompt =~ [yY](es)* ]]
then then
GIT_URL=https://github.com/oktal/pistache.git #GIT_URL=https://github.com/oktal/pistache.git
GIT_URL=http://git.opensource5g.org/openxg/pistache.git
echo "Install Pistache from $GIT_URL" echo "Install Pistache from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext pushd $OPENAIRCN_DIR/build/ext
echo "Downloading Pistache" echo "Downloading Pistache"
...@@ -168,7 +171,8 @@ install_nlohmann_from_git() { ...@@ -168,7 +171,8 @@ install_nlohmann_from_git() {
if [[ $prompt =~ [yY](es)* ]] if [[ $prompt =~ [yY](es)* ]]
then then
GIT_URL=https://github.com/nlohmann/json.git #GIT_URL=https://github.com/nlohmann/json.git
GIT_URL=http://git.opensource5g.org/openxg/json.git
echo "Install Nlohmann Json from $GIT_URL" echo "Install Nlohmann Json from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext pushd $OPENAIRCN_DIR/build/ext
echo "Downloading Nlohmann" echo "Downloading Nlohmann"
......
...@@ -79,7 +79,11 @@ install_fb_folly_from_source(){ ...@@ -79,7 +79,11 @@ install_fb_folly_from_source(){
libdwarf-dev libdwarf-dev
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz && \ # wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz && \
cd /tmp
git clone http://git.opensource5g.org/openxg/openxg-cnlibs.git
cd /tmp/openxg-cnlibs/
tar zxf release-1.8.0.tar.gz && \ tar zxf release-1.8.0.tar.gz && \
rm -f release-1.8.0.tar.gz && \ rm -f release-1.8.0.tar.gz && \
cd googletest-release-1.8.0 && \ cd googletest-release-1.8.0 && \
...@@ -92,7 +96,8 @@ install_fb_folly_from_source(){ ...@@ -92,7 +96,8 @@ install_fb_folly_from_source(){
$SUDO rm -rf /tmp/folly $SUDO rm -rf /tmp/folly
git clone https://github.com/facebook/folly.git #git clone https://github.com/facebook/folly.git
git clone http://git.opensource5g.org/openxg/folly.git
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
cd folly cd folly
mkdir _build && cd _build mkdir _build && cd _build
......
# file build_helper.local ################################################################################
# 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.amf
# brief
#
#######################################
################################
# include helper functions
################################
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.fb_folly
#--------openxg-cnlibs----------------------------------------------------------- #-------------------------------------------------------------------------------
#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)
install_cnlibs() { install_fmt() {
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
read -p "Do you want to install open-source cnlibs for C++ ? <y/N> " prompt read -p "Do you want to install open-source formatting library for C++ ? <y/N> " prompt
OPTION="" OPTION=""
else else
prompt='y' prompt='y'
OPTION="-y" OPTION="-y"
fi fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi
echo "Install cnlibs from source" echo "Install fmt from source"
##----------------------------------------------------------------
if [[ $prompt =~ [yY](es)* ]] if [[ $prompt =~ [yY](es)* ]]
then then
cd /tmp cd /tmp
echo "Downloading cnlibs" echo "Downloading fmt"
$SUDO rm -rf /tmp/openxg-cnlibs* $SUDO rm -rf /tmp/fmt*
git clone http://git.opensource5g.org/openxg/openxg-cnlibs.git #git clone https://github.com/fmtlib/fmt.git
git clone http://git.opensource5g.org/openxg/fmt.git
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
cd fmt
##fmt
cd openxg-cnlibs/fmt
cmake -DFMT_TEST=FALSE . cmake -DFMT_TEST=FALSE .
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
make -j `nproc` make -j `nproc`
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
$SUDO make install $SUDO make install
cd /tmp
rm -rf /tmp/fmt*
fi
return 0
}
##json #-------------------------------------------------------------------------------
cd openxg-cnlibs/json #arg1 is force (0 or 1) (no interactive script)
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret #arg2 is debug (0 or 1) (install debug libraries)
mkdir _build && cd _build install_spdlog_from_git() {
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF .. if [ $1 -eq 0 ]; then
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret read -p "Do you want to install spdlog ? <y/N> " prompt
make OPTION=""
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret else
$SUDO make install prompt='y'
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret OPTION="-y"
popd fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi
##pistache
cd openxg-cnlibs/pistache
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
##spdlog if [[ $prompt =~ [yY](es)* ]]
cd openxg-cnlibs/spdlog then
#GIT_URL=https://github.com/gabime/spdlog.git
GIT_URL=http://git.opensource5g.org/openxg/spdlog.git
echo "Install spdlog from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext
echo "Downloading spdlog"
if [[ $OPTION =~ -[yY](es)* ]]
then
$SUDO rm -rf spdlog
fi
git clone $GIT_URL
cd spdlog && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
# enable syslog, Useless (defined in SMF code) # enable syslog, Useless (defined in SMF code)
sed -i '/#define SPDLOG_ENABLE_SYSLOG/s/^\/\///g' include/spdlog/tweakme.h sed -i '/#define SPDLOG_ENABLE_SYSLOG/s/^\/\///g' include/spdlog/tweakme.h
popd popd
fi
return 0
}
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_pistache_from_git() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install Pistache ? <y/N> " prompt
OPTION="-y"
else
prompt='y'
OPTION="-y"
fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi
if [[ $prompt =~ [yY](es)* ]]
then
#GIT_URL=https://github.com/oktal/pistache.git
GIT_URL=http://git.opensource5g.org/openxg/pistache.git
echo "Install Pistache from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext
echo "Downloading Pistache"
if [[ $OPTION =~ -[yY](es)* ]]
then
$SUDO rm -rf pistache
fi
##folly git clone $GIT_URL
cd openxg-cnlibs/folly git submodule update --init
cd pistache && git checkout e18ed9baeb2145af6f9ea41246cf48054ffd9907
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build mkdir _build && cd _build
cmake .. cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make -j $(nproc) make
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
fi
return 0
}
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_nlohmann_from_git() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install Nlohmann Json ? <y/N> " prompt
OPTION=""
else
prompt='y'
OPTION="-y"
fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi fi
##https://github.com/google/googletest/archive/release-1.8.0.tar.gz --------------
if [[ $prompt =~ [yY](es)* ]] if [[ $prompt =~ [yY](es)* ]]
then then
$SUDO apt-get install $OPTION \ #GIT_URL=https://github.com/nlohmann/json.git
g++ \ GIT_URL=http://git.opensource5g.org/openxg/json.git
cmake \ echo "Install Nlohmann Json from $GIT_URL"
libboost-all-dev \ pushd $OPENAIRCN_DIR/build/ext
libevent-dev \ echo "Downloading Nlohmann"
libdouble-conversion-dev \ if [[ $OPTION =~ -[yY](es)* ]]
libgoogle-glog-dev \ then
libgflags-dev \ $SUDO rm -rf json
libiberty-dev \ fi
liblz4-dev \
liblzma-dev \
libsnappy-dev \
make \
wget \
zlib1g-dev \
binutils-dev \
libjemalloc-dev \
libssl-dev \
pkg-config
ret=$?;[[ $ret -ne 0 ]] && return $ret
pushd /tmp
if [ $debug -eq 1 ]; then
# For advanced debugging options
$SUDO apt-get install $OPTION \
libunwind8-dev \
libelf-dev \
libdwarf-dev
ret=$?;[[ $ret -ne 0 ]] && return $ret
tar zxf release-1.8.0.tar.gz && \ git clone $GIT_URL
rm -f release-1.8.0.tar.gz && \ git submodule update --init
cd googletest-release-1.8.0 && \ cd json && git checkout master
cmake . && \ ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make && \ mkdir _build && cd _build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
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
cd .. popd
fi
fi fi
return 0
##
cd /tmp
rm -rf /tmp/openxg-cnlibs*
} }
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#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)
...@@ -262,8 +324,20 @@ check_install_amf_deps(){ ...@@ -262,8 +324,20 @@ check_install_amf_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
# Use cnlibs # Use fmt lib included in spdlog
install_cnlibs $1 $2 install_fmt $1
ret=$?;[[ $ret -ne 0 ]] && return $ret
install_spdlog_from_git $1 $2
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
ret=$?;[[ $ret -ne 0 ]] && return $ret
install_nlohmann_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret ret=$?;[[ $ret -ne 0 ]] && return $ret
$SUDO ldconfig $SUDO ldconfig
......
...@@ -60,7 +60,7 @@ AMF = ...@@ -60,7 +60,7 @@ AMF =
# AMF binded interface for N1/N2 interface (NGAP) # AMF binded interface for N1/N2 interface (NGAP)
NGAP_AMF: NGAP_AMF:
{ {
INTERFACE_NAME = "ens3"; # YOUR NETWORK CONFIG HERE INTERFACE_NAME = "ens3"; # YOUR NETWORK CONFIG HERE ens3
IPV4_ADDRESS = "read"; IPV4_ADDRESS = "read";
PORT = 38412; # YOUR NETWORK CONFIG HERE PORT = 38412; # YOUR NETWORK CONFIG HERE
PPID = 60; # YOUR NETWORK CONFIG HERE PPID = 60; # YOUR NETWORK CONFIG HERE
......
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