PlantUml Graphviz generates 2 duplicate diagrams - doxygen

I have this markdown code that is going to be generated into an html file using plantuml and graphviz.
#image html Module23Static.png TC3
#startuml{Module23Static.png}
caption Module Dependencies and Interfaces of Module 23
skinparam componentStyle uml2
package "SW_Component"{
[Module 1\n--\n provided interfaces:\n func1\n data1\n--\n required interfaces:\n Module2\n Module3] as M1
[Module 2\n--\n provided interfaces:\n func2\n--\n required interfaces:\n interface_3\n Module4] as M2
[Module 4\n--\n provided interfaces:\n func7\n func8] as M4
M1 ..> M2 : use
M2 ..> M4 : use
}
#enduml
This block of code will generate the same diagram twice, one after the other. I want it to create the diagram once only.
If I remove the line "#image html Module23Static.png TC3", it gives me a "Dot Executable: File does not exist Cannot find Graphviz..." error. I already have Graphviz 2.50 and Doxygen 1.8.14 installed, and I have also set the GRAPHVIZ_DOT variable.
I am running on Windows, and using a batch file to generate the doxygen with plantuml and graphviz installed.
What am I missing here? Anyone encountered the same issue before?

Doxygen will, based on the #startuml ... #enduml create an image with the name Module23Static.png and add it to the output. Beforehand you also use #image html Module23Static.png TC3 and this also adds the same image, hence you get twice the image.
So you can remove the image html Module23Static.png TC3

Related

Doxygen fails to use Graphviz to generate dependency graph

I am trying to use Doxygen to generate the documentation of my c++ program, and I wish to have the dependency graph as well. So I installed graphviz-2.40.1, the path to graphviz is shown below:
which dot
/usr/local/bin/dot
I turned on the HAVE_DOT to YES, and also set the DOT_PATH to be /usr/local/bin/.
However if I run doxygen, it fails to generate the dependency graph and throws me the error:
Format: "png" not recognized. Use one of: canon cmap cmapx cmapx_np dot dot_json eps fig gv imap imap_np ismap json json0 mp pic plain plain-ext pov ps ps2 svg svgz tk vml vmlz xdot xdot1.2 xdot1.4 xdot_json
error: Problems running dot: exit code=1, command='/usr/local/bin/dot', arguments='"/home/shiqihe/Documents/code/cpp/docs/doxygen/html/dg__main_8cpp__incl.dot" -Tpng -o "/home/shiqihe/Documents/code/cpp/docs/doxygen/html/dg__main_8cpp__incl.png"'
I have searched for the solution and find this: soluiton
I tried sudo dot -c but it did not work. Still gave me the same error.
Any help? Thank you!
You already mentioned the "solution" which says:
It looks like there is a bug in the official install. After running the command 'dot -c', the problem has been solved.
The version you use does not support png, so:
search for an executable that contains the png format
create an executable yourself based on the graphviz dot code
use another format in doxygen (when you use HTML as output you can use e,g. svg as DOT_IMAGE_FORMAT. (see documentation in e.g. http://doxygen.nl/manual/customize.html#minor_tweaks_dynsection)

Including a .tag file for a library which itself includes a .tag file can provoke duplicate anchor warnings

I have three libraries - libA, libB and libC.
libA has a .dox file, which contains the following anchors:
\section First_Section First Section
\subsection First_Subsection First Subsection
libB includes the tag file for libA as follows:
#TAGFILES = $(DOXY_OUTPUT)/../libA/libA.tag=../libA
libC includes the tag files for libA and libB, as follows:
#TAGFILES = $(DOXY_OUTPUT)/../libA/libA.tag=../libA \
$(DOXY_OUTPUT)/../libB/libB.tag=../libB
However, when I run doxygen on libC in order to generate the documentation for libC, I see the following warning messages:
libB.tag: warning: Duplicate anchor First_Section found
libB.tag: warning: Duplicate anchor First_Subsection found
It seems that, because libB uses the tagfile for libA, that when libC tries to use the tagfile for libB, it has in fact already obtained the anchors from libA and so it considers those it finds in libB relating to libA to be duplicates.
I am using Doxygen 1.8.10.
With the example provided by OP. at https://bugzilla.gnome.org/show_bug.cgi?id=793088 OP. had no problem with version 1.8.13. My tests also revealed that with 1.8.14 there was no warning anymore.
Solution: upgrade to a newer version.

SwiftPM: How to setup Swift module.map referring to two connected C libraries

I'm trying to build a Swift Package Manager system package (a module.modulemap)
making available two system C libraries where one includes the other.
That is, one (say libcurl) is a base module and the other C library is including
that (like so: #include "libcurl.h"). On the regular C side this works, because
the makefiles pass in proper -I flags and all is good (and I could presumably
do the same in SPM, but I'd like to avoid extra flags to SPM).
So what I came up with is this module map:
module CBase [system] {
header "/usr/include/curl.h"
link "curl"
export *
}
module CMyLib [system] {
use CBase
header "/usr/include/mylib.h"
link "mylib"
export *
}
I got importing CBase in a Swift package working fine.
But when I try to import CMyLib, the compiler complains:
error: 'curl.h' file not found
Which is kinda understandable because the compiler doesn't know where to look
(though I assumed that use CBase would help).
Is there a way to get this to work w/o having to add -Xcc -I flags to the
build process?
Update 1: To a degree this is covered in
Swift SR-145
and
SE-0063: SwiftPM System Module Search Paths.
The recommendation is to use the Package.swift pkgConfig setting. This seems to work OK for my specific setup. However, it is a chicken and egg if there is no .pc file. I tried embedding an own .pc file in the package, but the system package directory isn't added to the PKG_CONFIG_PATH (and hence won't be considered during the compilation of a dependent module). So the question stands: how to accomplish that in an environment where there libs are installed, but w/o a .pc file (just header and lib).

CMake macro inclusion issue

The aim is to have small and useful libraries included into a main application.
I create a CMakeLists.txt file to create three different library : image, utils_dir and utils_geom. The thing that bother me is the horrible redundancy with the target definition. So I tried to create some macro and I'm confronted to an inclusion issue.
The pattern of my project is presented below.
src/CMakeLists.txt (main CMakeLists including subdirs)
src/cmake/Macro.cmake (containing macro)
src/libs/core/CMakeLists.txt (library def and macro use)
I can't include my Macro.cmake file which contain the macro definition.
With the following code in the top level CMakeLists.txt (in src/) :
include(Macro.cmake)
test_macro()
And in the Macro.cmake :
macro( test_macro )
MESSAGE("Success !")
endmacro
I've got :
CMake Error at libs/core/CMakeLists.txt:8 (include):
include could not find load file:
Macro.cmake
CMake Error at libs/core/CMakeLists.txt:9 (test_macro):
Unknown CMake command "test_macro".
Did someone is using a likely configuration ?

How to build levmar using MATLAB?

I am using Windows XP and matlab version is 7.10.0.
I have the levmar(Levenberg Marquardt) package from http://www.ics.forth.gr/~lourakis/levmar/levmar-2.5.tgz
In the README file, we are told to compile in matlab using mex using the following command:
mex -DHAVE_LAPACK -I.. -O -L -L levmar.c -llevmar -lclapack -lblas -lf2c.
I downloaded lapack.lib , blas.lib and f2c.lib for windows
UPDATE:
The original error got resolved after I built a vc project file given in the package.
But now there are some error messages like :
levmar.lib(misc.obj) : error LNK2019: unresolved external symbol _dgemm_ referenced in function _dlevmar_trans_mat_mat_mult
Did you create a file with a mex-function gateway? You can't just compile a c-function for Matlab; you need to do a little bit of work to take care of the I/O between Matlab and the c-code.
If you follow the steps outlined in this document, you should do fine.
You may have a look at immoptibox, which comprises Levenberg-Marquardt algorithm as well.
I just figured it out after searching a while and noticed that the levmar package included a vc project file which i needed to build and it created a file called levmar.lib .
But now I am getting some errors which involves messages like 'unable to resolve external symbols'