从现在开始,使用Cmake进行编译OAI

来源:互联网 发布:linux可以用来干什么 编辑:程序博客网 时间:2024/06/05 08:52


从现在开始,使用Cmake进行编译OAI


进入2015年,OAI团队摒弃了之前的Makefile系统,采用更高级的Cmake作为编译工具。这对初学者来说,可能会不适应。下面我从Maillist中的一封邮件来简单介绍一下新的编译过程。

截至今天(2015-04-22),最新的trunk中还保存了之前的Makefile,但是后续肯定会删除的。


So what is new:
     - .c, .h files, and the two external patches files (for asn1c and for freediameter) are kept with no change
     - all other Makefiles , Makefile.inc, autotools, pre-ci, autotests... are replaced by a cmake based building directive file and cleaned up scripts (no more support of old RF cards, ...)

The new code is in trunk/cmake_targets

The utilities are in cmake_targets/tools: as much as possible, same name as before (like init_exmimo shell script).

./build_oai still exist, options are similar, nevertheless cleaned up:
     - no more negative options such as "do not install xxx"
     - options and all the tool chain are consistent  example: the option Rel8 is exactly the same string as in the code (#if defined(Rel8))


因此,第一步,需要安装linux系统,建议安装Ubuntu 14.04,因为后续可能会抛弃12.04的支持。

两点需要注意:

1.Do "apt-get update, apt-get dist-upgrade" periodically to stay consistent with ubuntu updates (no more need to do the "kernel link" as per today twiki and today Makefile)

不需要编译内核了,但是需要定期跟进Ubuntu官方的更新就可以了。

2.OAI "LOWLATENCY" option calls the new Linux kernel scheduler called "deadline scheduler", for this, you need a kernel version >= 3.14 (regardless it is "lowlatency").

需要升级一下内核版本,最好是3.17,这个可以在twiki上找到指引。


第二步,需要安装OAI的代码。

这个跟之前的没有什么区别,就不多讲了。


第三步,编译,运行。

设置环境变量

# add in your file ~/.bashrcsource <absolute path to directory where you have the svn co>/cmake_targets/tools/build_helper ; set_openair_env
# (do the same command in your xterm, or open a new one to update your environement).

安装一些必须的库
# install all external packages
cd <your root>/cmake_targets; ./build_oai -I It will ask for a passord for MySQL: set it to "linux"

根据需要进行编译
# compile what you need
./build_oai -h
# read the options and use it.


编译完成之后,在cmake_targets目录下,会生成所有的可执行文件。选择相应的进行仿真就可以了。


最后,Cmakelist是一个全局的配置文件,这个需要每个使用者去学习的。这个后续我会把我的理解也贴出来。



欢迎跟帖讨论,或者微博交流@军宁June-LTE

0 0
原创粉丝点击