1b Avoid getting upset by some Set Ups - rciak/zz_42_shared_notes GitHub Wiki
Overview
This page gives some hints for installing the following tools:
- cflow and dot: Get overview over C-Code by caller diagrams.
- pycflow2dot: Good addition to cflow and dot.
- Meld: A graphical difftool that combines nicely with git.
cflow and dot
Section updated on: 08.08.2024
Benefits
- Get visual overview of connection between function: Generate and see calling diagrams
SETUP on 42 Vienna machines
Preliminary remark
Consider additionally installing pycflow2dot, if you like cflow and dot and want to put the "icing on the cake".
Installation steps
-
Install capt package manager (something like apt but only for installations of the current user)
wget https://raw.githubusercontent.com/PanoramixDeDruide/Codam_apt/main/INSTALL.sh && chmod +x INSTALL.sh && ./INSTALL.sh
-
Install cflow and graphviz (containing dot program)
capt install cflow capt install graphviz dot -c
When compiling a C-Project with makefiles it is convenient to do also another step:
- Create a make diagram rule
-
Add (if not yet there) a Makefile Variable
SRCS
to yourMakefile
and store in there all project files that contain C-Code. -
Then add all or some of the following sample Makefile rules:
diagram_text: cflow -i x --omit-arguments -f dot $(SRCS) diagram_text2: cflow --omit-arguments -f dot $(SRCS) diagram: cflow --main=main --depth=2 --omit-arguments -f dot $(SRCS) | dot -Txlib
-
Make these rules
.PHONY
-
run one of the rules, e.g.
make diagram
- Modify
--main=main
and--depth=2
to your needs, cf. Options for cflow.
- Modify
-
pycflow2dot
Section created on: 08.08.2024
Benefits
- Adds nicely on top of cflow and dot for improved diagram generation:
- Better looking diagrams,
- Commands line interface seems to be quite convenient.
SETUP on 42 Vienna machines
Preliminary remarks
- Python is currently installed as Version 3.10.12.
- For more details and a use example
see David Zabalas ("davidzr") fork of pycflow2dot.
(Note that the original repository by "valbendan" has been set as archieved in on Mar 18, 2020, making it read only. Also note that the fork of the later maintainer Ioannis Filippidis ("johnyf") seems no longer to be publicly available, while he still showed some activity in some of the other forks.)
Installation steps
-
Install first cflow and dot
-
Install pycflow2dot via pip
pip install pycflow2dot
Meld
Benefits
- Shows differences between folders and files
- Can be used as plugin for git:
git difftool
andgit mergetool
are more easy to use:
meld provides a nice graphical user interface for e.g.- showing differences since the last commit,
- resolving merge conflicts.
SETUP on 42 Vienna machines
- Install meld:
- Go with the mouse to the right bottom corner and click on the Icon with 9 dots
- In listed apps: Find the 42 Package Manager and start it
- Go the line where "meld" is written and click there on "Install".
- Please note that the 42 Package Manager does installations only on the Computer that you are currently using; when switching to another computer you might therefore need to install meld there as well!
- Connect meld with git:
- Download the provided configuration file for git
- Move the file to your home directory
- Rename it to -->
.gitconfig
<-- (note the dot!) unless the filename is already used! - If you wish: Open the file and decomment and adopt user name and Emailaddress - they will be used by git when you commit something