SMF 编译安装

硬件配置需求

以下为参考配置:

  • 18.04.1-Ubuntu SMP x86 64 GNU/Linux

  • 建议 4C/8G

部署教程

国内地址:http://git.opensource5g.org/nkrd/amf.git 国外地址:https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf.git

git clone http://git.opensource5g.org/nkrd/amf.git

# 进入脚本目录
cd oai-cn5g-smf/build/scripts

# 安装依赖环境
sudo ./build_smf -I -f

# 编译
sudo ./build_smf -V -b Debug -j

# 运行 SMF(使用默认配置文件)
sudo smf -c ~/smf/etc/smf.conf -o

如果需要修改 SMF 的配置,需要修改 etc/smf.conf。

问题

问题 1: 需要 Python > 3.8

解决:将 Python 版本升级到 3.8,参考:https://segmentfault.com/a/1190000021967408

问题 2: Could not link test program to Python. Maybe the main Python library has been   installed in some non-standard library path

apt install python3.8-dev

问题 3: 在安装 nghttp2 时,出现 error: 'PyThreadState {aka struct _ts}' has no member named 'exc_value'

# 原因是使用的 Cython 版本与生成 .c 文件的版本不一致,需要使用 Cython 重新生成 .c 文件,重新生成仍然报错,需要将目录下已生成的 .c 文件删除。
# 安装 Cython
pip3 install Cython

# 重新删除掉已生成的 .c 文件,建议直接重新下载安装
cd ~/smf/build/ext
git clone https://github.com/nghttp2/nghttp2.git
cd nghttp2
git submodule update --init
autoreconf -i
automake
autoconf
./configure --enable-asio-lib
make
make install

问题 4: error: ‘const struct spdlog::details::log_msg’ has no member named ‘raw’

解决:在安装 fmt 时,默认安装的是 master 分支,已经不支持以上处理方法,需要重新 安装 4.x 分支版本

cd ~/smf/build/ext
git clone https://github.com/fmtlib/fmt.git
cd fmt
git checkout 4.x
cmake .
make
make install