Doxygen+Graphviz+Ubuntu20.04安装

Doxygen官网:https://github.com/doxygen/

Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, and to some extent D. Doxygen also supports the hardware description language VHDL.

Doxygen can help you in three ways:

  1. It can generate an on-line documentation browser (in HTML) and/or an off-line reference manual (in LaTeX) from a set of documented source files. There is also support for generating output in RTF (MS-Word), PostScript, hyperlinked PDF, compressed HTML, DocBook and Unix man pages. The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code.
  2. You can configure doxygen to extract the code structure from undocumented source files. This is very useful to quickly find your way in large source distributions. Doxygen can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically.
  3. You can also use doxygen for creating normal documentation (as I did for the doxygen user manual and doxygen web-site).

翻译:

Doxygen是从带注释的c++源生成文档的事实上的标准工具,但它也支持其他流行的编程语言,如C、Objective-C、c#、PHP、Java、Python、IDL (Corba、Microsoft和UNO/OpenOffice风格)、Fortran,在某种程度上还支持d。Doxygen还支持硬件描述语言VHDL。

Doxygen可以从三个方面帮助你:

它可以从一组文档化的源文件生成在线文档浏览器(以HTML格式)和/或离线参考手册(以LaTeX格式)。还支持在RTF (MS-Word)、PostScript、超链接PDF、压缩HTML、DocBook和Unix手册页中生成输出。文档直接从源代码中提取,这使得保持文档与源代码一致更加容易。
您可以配置doxygen以从无文档的源文件中提取代码结构。这对于在大型源代码发行版中快速找到方法非常有用。Doxygen还可以通过包括依赖图、继承图和协作图的方式可视化各种元素之间的关系,这些都是自动生成的。
您还可以使用doxygen创建普通文档(就像我为doxygen用户手册和doxygen网站所做的那样)。

1、Doxygen

sudo apt-get doxygen

sudo apt-get doxygen-gui

r**@r***********:~/opengl$ sudo apt-get install doxygen
Reading package lists... Done
Building dependency tree       
Reading state information... Done
doxygen is already the newest version (1.8.17-0ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
r**@r***********:~/opengl$ sudo apt-get install doxygen-gui
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libdouble-conversion3 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5 libqt5widgets5 libqt5xml5 libxcb-xinerama0 libxcb-xinput0 qt5-gtk-platformtheme qttranslations5-l10n
Suggested packages:
  doxygen-doc qt5-image-formats-plugins qtwayland5
The following NEW packages will be installed:
  doxygen-gui libdouble-conversion3 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5 libqt5widgets5 libqt5xml5 libxcb-xinerama0 libxcb-xinput0 qt5-gtk-platformtheme qttranslations5-l10n
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.3 MB of archives.
After this operation, 44.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libdouble-conversion3 amd64 3.1.5-4ubuntu1 [37.9 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libxcb-xinerama0 amd64 1.14-2 [5,260 B]
Get:6 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libxcb-xinput0 amd64 1.14-2 [29.3 kB]
Get:7 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5gui5 amd64 5.12.8+dfsg-0ubuntu2.1 [2,971 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5core5a amd64 5.12.8+dfsg-0ubuntu2.1 [2,006 kB]
Get:8 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5widgets5 amd64 5.12.8+dfsg-0ubuntu2.1 [2,295 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5dbus5 amd64 5.12.8+dfsg-0ubuntu2.1 [208 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5network5 amd64 5.12.8+dfsg-0ubuntu2.1 [673 kB]
Get:9 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libqt5svg5 amd64 5.12.8-0ubuntu1 [131 kB]
Get:10 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libqt5xml5 amd64 5.12.8+dfsg-0ubuntu2.1 [105 kB]
Get:11 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 doxygen-gui amd64 1.8.17-0ubuntu2 [249 kB]
Get:12 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 qt5-gtk-platformtheme amd64 5.12.8+dfsg-0ubuntu2.1 [124 kB]
Get:13 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 qttranslations5-l10n all 5.12.8-0ubuntu1 [1,486 kB]
Fetched 10.3 MB in 7s (1,480 kB/s)                                                                                                                                                                                                          
Selecting previously unselected package libdouble-conversion3:amd64.
(Reading database ... 225748 files and directories currently installed.)
Preparing to unpack .../00-libdouble-conversion3_3.1.5-4ubuntu1_amd64.deb ...
Unpacking libdouble-conversion3:amd64 (3.1.5-4ubuntu1) ...
Selecting previously unselected package libqt5core5a:amd64.
Preparing to unpack .../01-libqt5core5a_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5core5a:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5dbus5:amd64.
Preparing to unpack .../02-libqt5dbus5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5dbus5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5network5:amd64.
Preparing to unpack .../03-libqt5network5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5network5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libxcb-xinerama0:amd64.
Preparing to unpack .../04-libxcb-xinerama0_1.14-2_amd64.deb ...
Unpacking libxcb-xinerama0:amd64 (1.14-2) ...
Selecting previously unselected package libxcb-xinput0:amd64.
Preparing to unpack .../05-libxcb-xinput0_1.14-2_amd64.deb ...
Unpacking libxcb-xinput0:amd64 (1.14-2) ...
Selecting previously unselected package libqt5gui5:amd64.
Preparing to unpack .../06-libqt5gui5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5gui5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5widgets5:amd64.
Preparing to unpack .../07-libqt5widgets5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5widgets5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package libqt5svg5:amd64.
Preparing to unpack .../08-libqt5svg5_5.12.8-0ubuntu1_amd64.deb ...
Unpacking libqt5svg5:amd64 (5.12.8-0ubuntu1) ...
Selecting previously unselected package libqt5xml5:amd64.
Preparing to unpack .../09-libqt5xml5_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking libqt5xml5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package doxygen-gui.
Preparing to unpack .../10-doxygen-gui_1.8.17-0ubuntu2_amd64.deb ...
Unpacking doxygen-gui (1.8.17-0ubuntu2) ...
Selecting previously unselected package qt5-gtk-platformtheme:amd64.
Preparing to unpack .../11-qt5-gtk-platformtheme_5.12.8+dfsg-0ubuntu2.1_amd64.deb ...
Unpacking qt5-gtk-platformtheme:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Selecting previously unselected package qttranslations5-l10n.
Preparing to unpack .../12-qttranslations5-l10n_5.12.8-0ubuntu1_all.deb ...
Unpacking qttranslations5-l10n (5.12.8-0ubuntu1) ...
Setting up libdouble-conversion3:amd64 (3.1.5-4ubuntu1) ...
Setting up libxcb-xinput0:amd64 (1.14-2) ...
Setting up libxcb-xinerama0:amd64 (1.14-2) ...
Setting up qttranslations5-l10n (5.12.8-0ubuntu1) ...
Setting up libqt5core5a:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5dbus5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5network5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5xml5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5gui5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up libqt5widgets5:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up qt5-gtk-platformtheme:amd64 (5.12.8+dfsg-0ubuntu2.1) ...
Setting up doxygen-gui (1.8.17-0ubuntu2) ...
Setting up libqt5svg5:amd64 (5.12.8-0ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Processing triggers for man-db (2.9.1-1) ...

2、Graphviz

sudo apt-get install graphviz graphviz-doc

$ sudo apt-get install graphviz graphviz-doc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libann0 libcdt5 libcgraph6 libgts-0.7-5 libgts-bin libgvc6 libgvpr2 liblab-gamut1 libpathplan4
Suggested packages:
  gsfonts
The following NEW packages will be installed:
  graphviz graphviz-doc libann0 libcdt5 libcgraph6 libgts-0.7-5 libgts-bin libgvc6 libgvpr2 liblab-gamut1 libpathplan4
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,311 kB of archives.
After this operation, 14.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libann0 amd64 1.1.2+doc-7build1 [26.0 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libcdt5 amd64 2.42.2-3build2 [18.7 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libcgraph6 amd64 2.42.2-3build2 [41.3 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libgts-0.7-5 amd64 0.7.6+darcs121130-4 [150 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libpathplan4 amd64 2.42.2-3build2 [21.9 kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libgvc6 amd64 2.42.2-3build2 [647 kB]
Get:7 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libgvpr2 amd64 2.42.2-3build2 [167 kB]
Get:8 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 liblab-gamut1 amd64 2.42.2-3build2 [177 kB]
Get:9 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 graphviz amd64 2.42.2-3build2 [590 kB]
Get:10 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 graphviz-doc all 2.42.2-3build2 [4,431 kB]
Get:11 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libgts-bin amd64 0.7.6+darcs121130-4 [41.3 kB]
Fetched 6,311 kB in 5s (1,252 kB/s)   
Selecting previously unselected package libann0.
(Reading database ... 226148 files and directories currently installed.)
Preparing to unpack .../00-libann0_1.1.2+doc-7build1_amd64.deb ...
Unpacking libann0 (1.1.2+doc-7build1) ...
Selecting previously unselected package libcdt5:amd64.
Preparing to unpack .../01-libcdt5_2.42.2-3build2_amd64.deb ...
Unpacking libcdt5:amd64 (2.42.2-3build2) ...
Selecting previously unselected package libcgraph6:amd64.
Preparing to unpack .../02-libcgraph6_2.42.2-3build2_amd64.deb ...
Unpacking libcgraph6:amd64 (2.42.2-3build2) ...
Selecting previously unselected package libgts-0.7-5:amd64.
Preparing to unpack .../03-libgts-0.7-5_0.7.6+darcs121130-4_amd64.deb ...
Unpacking libgts-0.7-5:amd64 (0.7.6+darcs121130-4) ...
Selecting previously unselected package libpathplan4:amd64.
Preparing to unpack .../04-libpathplan4_2.42.2-3build2_amd64.deb ...
Unpacking libpathplan4:amd64 (2.42.2-3build2) ...
Selecting previously unselected package libgvc6.
Preparing to unpack .../05-libgvc6_2.42.2-3build2_amd64.deb ...
Unpacking libgvc6 (2.42.2-3build2) ...
Selecting previously unselected package libgvpr2:amd64.
Preparing to unpack .../06-libgvpr2_2.42.2-3build2_amd64.deb ...
Unpacking libgvpr2:amd64 (2.42.2-3build2) ...
Selecting previously unselected package liblab-gamut1:amd64.
Preparing to unpack .../07-liblab-gamut1_2.42.2-3build2_amd64.deb ...
Unpacking liblab-gamut1:amd64 (2.42.2-3build2) ...
Selecting previously unselected package graphviz.
Preparing to unpack .../08-graphviz_2.42.2-3build2_amd64.deb ...
Unpacking graphviz (2.42.2-3build2) ...
Selecting previously unselected package graphviz-doc.
Preparing to unpack .../09-graphviz-doc_2.42.2-3build2_all.deb ...
Unpacking graphviz-doc (2.42.2-3build2) ...
Selecting previously unselected package libgts-bin.
Preparing to unpack .../10-libgts-bin_0.7.6+darcs121130-4_amd64.deb ...
Unpacking libgts-bin (0.7.6+darcs121130-4) ...
Setting up liblab-gamut1:amd64 (2.42.2-3build2) ...
Setting up libgts-0.7-5:amd64 (0.7.6+darcs121130-4) ...
Setting up libpathplan4:amd64 (2.42.2-3build2) ...
Setting up libann0 (1.1.2+doc-7build1) ...
Setting up libcdt5:amd64 (2.42.2-3build2) ...
Setting up libcgraph6:amd64 (2.42.2-3build2) ...
Setting up graphviz-doc (2.42.2-3build2) ...
Setting up libgts-bin (0.7.6+darcs121130-4) ...
Setting up libgvc6 (2.42.2-3build2) ...
Setting up libgvpr2:amd64 (2.42.2-3build2) ...
Setting up graphviz (2.42.2-3build2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...

参考:

(1)安装doxygen(一个自动文档生成工具)+Graphviz图形可视化软件 - 走看看

(2)Ubuntu20.04安装Doxygen_happycrcr的博客-CSDN博客_ubuntu安装doxygen