Doxygen fails to use Graphviz to generate dependency graph - doxygen

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)

Related

My OpenCV lib path does not return when I try to find it

I am using Eclipse C++ and try to using OpenCV for the first time, everything is normal until when I use the command $ pkg-config --libs opencv to locating my library path of OpenCV, it return me like this:
-lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_datasets -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_line_descriptor -lopencv_optflow -lopencv_video -lopencv_plot -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_viz -lopencv_surface_matching -lopencv_text -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core
And at what I have seen in the document of OpenCV or some instruction videos, its should be the the path at the head, but with mine is not. And since I don't know where is my library path is, I cannot add the path into my program properties and run my first simple program on OpenCV. If anyone can give me solution or advise, I will very be grateful.

MATLAB - Error creating maxmaci64 from jpeg_write.c

I had problems making mexmaci64 files using Mex from both jpeg_read.c and jpeg_write.c from jpeg toolbox. I asked my question here and the problem for jpeg_read solved.
but I still have a different error when I compile jpeg_write.c.
everything is the same and I didn't change any path or anything.
I don't understand why Matlab console returns this error.
Is this familiar to anybody? please let me know.
>> mex -compatibleArrayDims -I/usr/local/Cellar/jpeg/9d/include jpeg_write.c -L/usr/local/Cellar/jpeg/9d/lib -ljpeg
Building with 'Xcode with Clang'.
Error using mex
/Users/folder/jpeg_toolbox/jpeg_write.c:56:10: fatal error: 'jpegint.h' file not found
#include <jpegint.h>
^~~~~~~~~~~
1 error generated.
First off:
By pointing at the /usr/local/Cellar/jpeg/<version>/include location of the jpeg or other libraries, you're dependent on the specific version that is currently installed. You probably want to use /usr/local/opt/jpeg/include/ etc instead. /usr/local/opt is where Homebrew exposes its non-versioned presentations of its installed package contents.
So:
mex -compatibleArrayDims -I/usr/local/Cellar/jpeg/9d/include ...
This is pointing at the jpeg library. Does the jpeg library supply jpegint.h?
$ ls /usr/local/Cellar/jpeg/9d/include/
jconfig.h jerror.h jmorecfg.h jpeglib.h
Nope. So that's why it's not found. So you have to figure out where you can actually get jpegint.h from. Hit Google and consult your documentation to figure out what library you're actually trying to pull jpegint.h from, and pull that in, too, with the appropriate -I, -L, and -l flags.
If you think you have it already installed, you can use find /usr/local/Cellar -name jpegint.h to look for it. I found it in the gdcm package.
[~] $ find /usr/local/Cellar -name jpegint.h
/usr/local/Cellar/gdcm/3.0.8_1/include/gdcm-3.0/gdcmjpeg/jpegint.h
So you probably want something like:
mex -compatibleArrayDims -I/usr/local/opt/jpeg/include ...
-I/usr/local/opt/gdcm/include/gdcm-3.0/gdcmjpeg ...
jpeg_write.c ...
-L/usr/local/opt/jpeg/lib -L/usr/local/opt/gdcm/lib ...
-ljpeg -lgdcmjpeg16
(I don't know if you actually want -lgdcmjpeg8, -lgdcmjpeg12, or -lgdcmjpeg16, or maybe something else. I'm just guessing here. Consult the GDCM documentation.)

Matlab: invalid mex file library not loaded

I have created a mex function (more specifically, using CUDA)
the compilation was successful, and I got a mex file zMul.mexmaci64
but on the execution, matlab reported an error:
Invalid MEX-file '/Users/zlw/Documents/MATLAB/lowComplexity/cbased/matMulGPU/zMul.mexmaci64':
dlopen(/Users/zlw/Documents/MATLAB/lowComplexity/cbased/matMulGPU/zMul.mexmaci64, 1):
Library not loaded: #rpath/libcublas.6.0.dylib
Referenced from: /Users/zlw/Documents/MATLAB/lowComplexity/cbased/matMulGPU/zMul.mexmaci64
Reason: image not found
What should I do do solve it?
additional info
setting the environment vars (PATH,LD_LIBRARY_PATH,DYLD_LIBRARY_PATH) in Matlab and in .bash_profile doesn't work for me
I'm pretty sure that the environment vars are set correctly because when I created an alias to the dylib file, Matlab detected it, tried to load it, but failed with message:no suitable image found
Thanks!
Use otool -L in both Matlab and UNIX console.
In Matlab:
!otool -L /path/to/zMul.mexmaci64
In UNIX console:
otool -L /path/to/zMul.mexmaci64
Try to find the difference between them. If there is a difference in dependency, that is probably breaking the MEX binary. You might need to apply the same technique for the dependent dylib objects recursively. Typically, enforcing the one appearing in UNIX console using DYLD_INSERT_LIBRARIES solves the problem.
Another possibility is the C++ runtime compatibility. If you're using OS X Mavericks, you should check that your MEX command is using libc++ but not libstdc++ in mexopts.sh. Below is my configuration example in mexopts.sh:
CC='clang'
CXX='clang++'
SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/'
MACOSX_DEPLOYMENT_TARGET='10.9'
CFLAGS="$CFLAGS -Dchar16_t=uint16_t"
CXXFLAGS="$CXXFLAGS -std=c++11 -stdlib=libc++ -DCHAR16_T"
CXXLIBS="$MLIBS -lc++"
This post might help: http://www.seaandsailor.com/matlab-xcode6.html
It was easier than I thought. Just replace all 10.x with your OS X version and add -Dchar16_t=UINT16_T to CLIBS in mexopts.sh file.

sh: dot: command not found + doxygen + Lion

MacOS version: 10.7.2 (Lion)
Doxygen version: 1.7.5.1
Graphviz version: 2.29
Doxygen configuration:
DOT_PATH = ../../../../Applications/Contents/MacOS/Graphviz
HAVE_DOT = YES
SHORT_NAMES = YES
From the log console, first line it gives a warning:
warning: the dot tool could not be found at ../../../../Applications/Contents/MacOS/Graphviz
I have tried various combinations but the warning does not go away, although it does generate the images.
Generating dot graphs using 9 parallel threads...
Running dot for graph 1/68
sh: dot: command not found
Problems running dot: exit code=127, command='dot', arguments='"/Users/salilk/Documents/project/DoxygenDocs/html/a00033.dot" -Tpng -o "/Users/salilk/Documents/project/DoxygenDocs/html/a00033.png"'
In the html directory the .dot files have been generated but no .png.
Now if I execute the same command from the Terminal the .png file gets generated and is displayed in its .html file.
Another error from the console is:
error: problems opening map file /Users/salilk/Documents/A2O Collaborate/DoxygenDocs/html/a00032.map for inclusion in the docs!
If you installed Graphviz/dot after a previous failing run, try deleting the output directory and rerun doxygen.
Is this related to the above problem ?
I have used Doxygen before on a Windows machine and didn't have these errors, do we need to do any configurations specific for Mac?
Set the DOT_PATH to: /usr/local/bin
set DOT_PATH in your doxygen.conf to blank. That works because doxygen will look in your path for.
I installed doxygen with macports, so dot is at /opt/local/bin/dot
For those who call CMake's configure_file() on their Doxfile, an alternative is:
DOT_PATH = ${DOXYGEN_DOT_PATH}
For me, even though dot's path was in $PATH, the above is the only way I could make it work. Go figure.
The DOT_PATH must be set withing quotes else the paths with whitespaces won't work
DOT_PATH = "#DOXYGEN_DOT_PATH#"

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'