ns3使用doxygen生成离线api文档
2016-04-07 22:25
579 查看
原文链接
doxygen的维基介绍:
[plain]view
plain
copy
Doxygen是一个编写软件参考文檔的工具。该文檔是直接写在源代码中,因此比较容易保持更新。Doxygen可以交叉引用文檔和源代码,使文件的读者可以很容易地引用实际的源代码。
ns3的官方也有doxygen生成的文档,参见:ns3官方doxygen
但是由于网络或者其它原因,我们有本地离线访问的需求,于是doxygen就派上用场了。下面来看看怎么使用doxygen:
1. 官方的方法如下:
[plain]view
plain
copy
ns-3 requires Doxygen version 1.5.4 or greater to fully build all items, although earlier versions of Doxygen will mostly work.
Type "./waf --doxygen" or "./waf --doxygen-no-build" to build the documentation. The doc/ directory contains configuration for Doxygen (doxygen.conf) and main.h. The Doxygen build process puts html files into the doc/html/ directory, and latex filex into the doc/latex/ directory.
也就是我们使用命令:
[plain]view
plain
copy
./waf --doxygen
即可。
2. 使用上面命令报错:
[plain]view
plain
copy
waf configure did not detect doxygen in the system -> cannot build api docs
需要做两个工作:
(1)安装doxygen:
[plain]view
plain
copy
sudo apt-get install doxygen
(2)重新配置waf,这个步骤参见谷歌的ns3论坛帖子:
[plain]view
plain
copy
./waf configure --enable-examples --enable-tests
然后我的配置还遇到一个问题:
[plain]view
plain
copy
AttributeError: 'BuildContext' object has no attribute 'add_subdirs'
我曾经添加了一个模块--vanet-highway,估计是这个模块的问题,找到报错的那个语句,目前注释掉这个语句。
3. 再次使用步骤1的命令来生成文档,我的生成目录是:/home/zy/code/NS3/ns3/ns-3.20/doc/html
怎么使用这个文档? 两种方法:
(1) 文件浏览器:但是由于文件太多,文件浏览器会一直加载文件,这时点击右下方的叉叉可以停止加载,然后用浏览器打开一个就可以了,效果如下:
(2) 终端打开,终端不用加载啦。先看一下到底生成了多少个文件:
[plain]view
plain
copy
zy@zy:~/code/NS3/ns3/ns-3.20/doc/html$ ls -lR | grep "^-" | wc -l
68170
这么多文件,怪不得加载这么久了。然后使用命令,用浏览器打开即可(ps:仅此处与原文不同):
[plain]view
plain
copy
打开terminal,利用cd命令转到/ns-allinone-3.25/ns-3.25/doc文件夹,输入:
chromium-browser html/annotated.html(本人用的浏览器是 chromium-browser)
这样就可以用chromium查看帮助文件了
参考帖子:
使用Doxygen获取NS3的帮助文档
本地编译并查看NS3帮助文档
doxygen的维基介绍:
[plain]view
plain
copy
Doxygen是一个编写软件参考文檔的工具。该文檔是直接写在源代码中,因此比较容易保持更新。Doxygen可以交叉引用文檔和源代码,使文件的读者可以很容易地引用实际的源代码。
ns3的官方也有doxygen生成的文档,参见:ns3官方doxygen
但是由于网络或者其它原因,我们有本地离线访问的需求,于是doxygen就派上用场了。下面来看看怎么使用doxygen:
1. 官方的方法如下:
[plain]view
plain
copy
ns-3 requires Doxygen version 1.5.4 or greater to fully build all items, although earlier versions of Doxygen will mostly work.
Type "./waf --doxygen" or "./waf --doxygen-no-build" to build the documentation. The doc/ directory contains configuration for Doxygen (doxygen.conf) and main.h. The Doxygen build process puts html files into the doc/html/ directory, and latex filex into the doc/latex/ directory.
也就是我们使用命令:
[plain]view
plain
copy
./waf --doxygen
即可。
2. 使用上面命令报错:
[plain]view
plain
copy
waf configure did not detect doxygen in the system -> cannot build api docs
需要做两个工作:
(1)安装doxygen:
[plain]view
plain
copy
sudo apt-get install doxygen
(2)重新配置waf,这个步骤参见谷歌的ns3论坛帖子:
[plain]view
plain
copy
./waf configure --enable-examples --enable-tests
然后我的配置还遇到一个问题:
[plain]view
plain
copy
AttributeError: 'BuildContext' object has no attribute 'add_subdirs'
我曾经添加了一个模块--vanet-highway,估计是这个模块的问题,找到报错的那个语句,目前注释掉这个语句。
3. 再次使用步骤1的命令来生成文档,我的生成目录是:/home/zy/code/NS3/ns3/ns-3.20/doc/html
怎么使用这个文档? 两种方法:
(1) 文件浏览器:但是由于文件太多,文件浏览器会一直加载文件,这时点击右下方的叉叉可以停止加载,然后用浏览器打开一个就可以了,效果如下:
(2) 终端打开,终端不用加载啦。先看一下到底生成了多少个文件:
[plain]view
plain
copy
zy@zy:~/code/NS3/ns3/ns-3.20/doc/html$ ls -lR | grep "^-" | wc -l
68170
这么多文件,怪不得加载这么久了。然后使用命令,用浏览器打开即可(ps:仅此处与原文不同):
[plain]view
plain
copy
打开terminal,利用cd命令转到/ns-allinone-3.25/ns-3.25/doc文件夹,输入:
chromium-browser html/annotated.html(本人用的浏览器是 chromium-browser)
这样就可以用chromium查看帮助文件了
参考帖子:
使用Doxygen获取NS3的帮助文档
本地编译并查看NS3帮助文档
相关文章推荐
- 解决android子控件与父控件滑动冲突的问题
- ARM linux的启动部分源代码简略分析【转】
- java 集合
- WTL for Visual Studio 2012 配置详解
- Problem 1001
- Hbase使用
- Android:inputType常用取值
- IAccessiable的学习和使用
- 对象存储
- 直接插入排序
- Java中Object有哪些公共类
- 吴超老师课程--HBASE的集群安装
- Eclipse常用配置及常用快捷键
- D3.js 学习( 一)
- 以c++的方式实现单链表
- C++四则运算代码
- LeetCode 27. Remove Element
- 笔试题(2016.4.7)
- 解决s:iterator嵌套s:radio的传值问题
- ServletContext的讲解和使用