Skip to content
ugeorge edited this page Mar 13, 2016 · 2 revisions

The tool has been developed in Python and it is distributed as either a distutils installer or as a pre-built binary file.

To install the tool, you can follow the instructions on any of the following sections.

Pre-built binary releases

A set of pre-built binary distributions for different OS can be found in the releases. They are self-sufficient, since they include both interpreter and dependencies.

To install a binary release, just unpack the file f2dot from the folder associated with your OS into a local directory, and run it from command line.

Building your own binary

If your OS is not specified among the pre-built distributions, or would like to build it on your own, the tool comes with a distutils installer.

The source files can be acquired from:

  • the releases, for the latest stable release
  • the repository, by checking it out using an git client, for the full-featured program under development

As a prerequisite, a Python interpreter is needed (>=2.7) and the Graphviz tool chain (libgraphviz-dev).

As administrator

To install f2dot, you need to run the command as su:

python setup.py install

distutils should take care of the dependencies and install them in their default (system) paths. For example, on a Linux machine having Python 2.7, the runner will be installed in /usr/local/bin/ and the packages in /usr/local/lib/python2.7/dist-packages/.

If distutils links everything properly, the f2dot program can be run from the system path using

f2dot

As local user

To build f2dot you need to run the command

python setup.py bdist

which will create the build folder, which contains a libraries subfolder (lib.[...]) and a scripts subfolder (scripts-[...]). The runner binary is found in the scripts folder, and it can be run once the libraries path is added to the PYTHONPATH environment variable.

The command to run the program is

./[path/to/your/]f2dot

Using the source scripts

If you would like to use the source scripts directly, instead of building a binary distribution, the installer provides this option as well. In this case, the user needs to take care of all the dependencies herself.

As in the previous section, the source installer can be acquired from:

  • the releases, for the latest stable release
  • the repository, by checking it out using an git client, for the full-featured program under development

To be able to run these scripts, one needs to fulfill the following conditions:

  1. have a Python interpreter (>=2.7) 1. install the Graphviz development libraries. On a Debian distribution of Linux, one can install it with the command:
sudo apt-get install libgraphviz-dev
  1. have installed the pygraphviz Python API library. Using thepip package manager, one can install pygraphviz using the command:
    pip install pygraphviz
    

or, using a Debian package manager, an alternative way would be: sudo apt-get install python-pygraphviz

The installation is done by running the following command from the destination directory:

python [path/to/]setup.py scripts

The program may be run as a Python script using the command

python [path/to/scripts/]f2dot.py

(Optional) Visualizer tool

To visualize the graphs as dot files, one needs to have a DOT file reader installed. One such reader is XDot. Otherwise, the output can be specified to another format, like pdf or png.

Clone this wiki locally