... | ... | @@ -36,3 +36,162 @@ GCC finishes under 80 minutes, and uses at most slightly below 3 GB. On the othe |
|
|
|
|
|
## Parallel algorithms
|
|
|
graph-tool can run several of its algorithms in [parallel](http://en.wikipedia.org/wiki/Parallel_programming). It makes use of [OpenMP](http://en.wikipedia.org/wiki/Openmp) to do this, which provides a straightforward way of converting serial code into parallel code. OpenMP is an extension to the Fortran, C and C++ languages, which uses compiler directives to achieve automated code parallelization. Since it uses [compiler directives](http://en.wikipedia.org/wiki/Compiler_directive) (`#pragma `in C/C++), it maintains backwards compatibility with compilers that do not support OpenMP, and the code is then compiled cleanly as regular serial code. Thus, support for parallel code in graph-tool is quite optional. If you wish to enable it, just pass the option `--enable-openmp` to the configure script.
|
|
|
|
|
|
<a name="note-macos></a>
|
|
|
## Note for MacOS X users
|
|
|
|
|
|
Although graph-tool is a Python library, it is implemented in C++, and thus has C++ dependencies such as [Boost](http://www.boost.org/), [CGAL](http://www.cgal.org/) and [expat](http://expat.sourceforge.net/), which are not installable via Python-only package management systems such as [pip](http://www.pip-installer.org/) or [EasyInstall](http://pypi.python.org/pypi/setuptools). Unlike most GNU/Linux distributions, the MacOS X system does not include integrated package management with automated dependency tracking, which means that the dependencies would have to be installed individually by hand. Since they also have their own dependencies, this would trigger the manual installation of many libraries, which is quite time consuming, error-prone and is not recommended for inexperienced users. Instead, the best option is to use one of the third-party package management software available, such as [Macports](http://www.macports.org/) or [Homebrew](http://brew.sh/).
|
|
|
|
|
|
Macports allows for the installation of graph-tool with a single command:
|
|
|
|
|
|
```
|
|
|
port install py-graph-tool
|
|
|
```
|
|
|
|
|
|
With Homebrew the installation is also straightforward:
|
|
|
|
|
|
```
|
|
|
brew tap homebrew/science
|
|
|
brew install graph-tool
|
|
|
```
|
|
|
See [below](#macos) for more notes on installing on MacOS X, as well as the [FAQ](#faq).
|
|
|
|
|
|
If you encounter an error installing graph-tool via Macports or Homebrew, please file a bug report via each respective project, not to graph-tool directly.
|
|
|
|
|
|
# Pre-compiled Packages
|
|
|
## Debian & Ubuntu
|
|
|
|
|
|
For [Debian](http://www.debian.org/), add the following lines to your `/etc/apt/sources.list`,
|
|
|
|
|
|
```
|
|
|
deb http://downloads.skewed.de/apt/DISTRIBUTION DISTRIBUTION main
|
|
|
deb-src http://downloads.skewed.de/apt/DISTRIBUTION DISTRIBUTION main
|
|
|
```
|
|
|
where `DISTRIBUTION` can be any one of
|
|
|
|
|
|
```
|
|
|
stretch, sid
|
|
|
```
|
|
|
|
|
|
For [Ubuntu](http://www.ubuntu.com/), add the following lines
|
|
|
|
|
|
```
|
|
|
deb http://downloads.skewed.de/apt/DISTRIBUTION DISTRIBUTION universe
|
|
|
deb-src http://downloads.skewed.de/apt/DISTRIBUTION DISTRIBUTION universe
|
|
|
```
|
|
|
where `DISTRIBUTION` can be any one of
|
|
|
|
|
|
```
|
|
|
wily, xenial, yakkety, zesty
|
|
|
```
|
|
|
|
|
|
After running `apt-get update`, the package can be installed with
|
|
|
|
|
|
```
|
|
|
apt-get install python-graph-tool
|
|
|
```
|
|
|
or if you want to use Python 3
|
|
|
```
|
|
|
apt-get install python3-graph-tool
|
|
|
```
|
|
|
|
|
|
If you want to verify the packages, you should use the public key `612DEFB798507F25`, which can be done with the command:
|
|
|
```
|
|
|
apt-key adv --keyserver pgp.skewed.de --recv-key 612DEFB798507F25
|
|
|
```
|
|
|
Afterwards, you can run `apt-key list`, which should give you the following details about the key:
|
|
|
```
|
|
|
pub 4096R/98507F25 2013-10-17 [expires: 2018-10-16]
|
|
|
uid Tiago de Paula Peixoto <tiago@skewed.de>
|
|
|
uid Tiago de Paula Peixoto <tiago@itp.uni-bremen.de>
|
|
|
sub 4096R/1A7ECE03 2013-10-17 [expires: 2018-10-16]
|
|
|
sub 4096R/23F08CAF 2013-10-17 [expires: 2018-10-16]
|
|
|
```
|
|
|
|
|
|
## Arch
|
|
|
|
|
|
[Packages for Arch](https://aur.archlinux.org/packages/python-graph-tool/) are available in the Arch User Repository. You can install it with yaourt:
|
|
|
|
|
|
```
|
|
|
yaourt -S python2-graph-tool
|
|
|
```
|
|
|
or
|
|
|
```
|
|
|
yaourt -S python-graph-tool
|
|
|
```
|
|
|
depending on the python version.
|
|
|
|
|
|
## Gentoo
|
|
|
|
|
|
An ebuild for graph-tool is included in the default [Gentoo](https://www.gentoo.org/) repository. Just do
|
|
|
|
|
|
```
|
|
|
emerge graph-tool
|
|
|
```
|
|
|
to install it.
|
|
|
|
|
|
<a name="macos"></a>
|
|
|
## MacOS X
|
|
|
### Macports
|
|
|
|
|
|
A portfile is available for installation in MacOS X systems with [Macports](http://www.macports.org/). It is included in the [standard macports list](http://www.macports.org/ports.php?by=name&substr=graph-tool). Just run the following command to install it:
|
|
|
|
|
|
```
|
|
|
port install py-graph-tool
|
|
|
```
|
|
|
|
|
|
### Homebrew
|
|
|
|
|
|
With [Homebrew](http://brew.sh/) the installation is also straightforward, since a formula for it is included in the "science" list:
|
|
|
```
|
|
|
brew tap homebrew/science
|
|
|
brew install graph-tool
|
|
|
```
|
|
|
|
|
|
#### Compiler choice in MacOS X
|
|
|
|
|
|
TL;DR : Just use [clang](http://clang.llvm.org/) for everything.
|
|
|
|
|
|
Make sure you use the same compiler to compile the whole stack (Python, Boost, etc) or you may lead into problems. Since more recent versions of graph-tool, a compiler which supports [C++14](http://en.wikipedia.org/wiki/C++14) is required.
|
|
|
|
|
|
In an ideal world, the correct version should be the latest one from the "stock" [FSF GCC](http://gcc.gnu.org/), however it does not seem to be very well supported in the platform. The [clang](http://clang.llvm.org/) compiler seems to be the only viable option on the platform, and should therefore be used.
|
|
|
|
|
|
(If possible, a much better option would be to use a less [defective](http://www.defectivebydesign.org/apple) platform in the first place.)
|
|
|
|
|
|
<a name="faq"></a>
|
|
|
|
|
|
### FAQ for installation in MacOS X
|
|
|
|
|
|
#### Q: Why can't this be installed via pip? Why so complicated?
|
|
|
A: See [note for MacOS X users](#note-macos) above. The short answer is that it can't be done, since graph-tool depends crucially on some (excellent) C++ libraries such as Boost, which are not installable via pip.
|
|
|
|
|
|
#### Q: When importing the module, I get the following errors:
|
|
|
```
|
|
|
ERROR:root:Could not find any typelib for Gtk
|
|
|
ERROR:root:Could not find any typelib for Gdk
|
|
|
ERROR:root:Could not find any typelib for GdkPixbuf
|
|
|
```
|
|
|
A: Make sure you have [XQuartz](http://xquartz.macosforge.org/landing/) installed, as well as GTK+ 3 (gtk3 port in Macports).
|
|
|
|
|
|
#### Q: When attempting to draw a graph to the screen, I get the error:
|
|
|
|
|
|
```
|
|
|
gi._glib.GError: Couldn't recognize the image file format for file '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/draw/graph-tool-logo.svg'
|
|
|
Exception AttributeError: "'GraphWindow' object has no attribute 'graph'" in > ignored
|
|
|
```
|
|
|
|
|
|
A: You probably don't have the standard librsvg library installed. This can be installed with macports as follows:
|
|
|
```
|
|
|
port install librsvg
|
|
|
```
|
|
|
|
|
|
#### Q: I get unresolved symbol errors when importing the module, something like:
|
|
|
|
|
|
```python
|
|
|
>>> import graph_tool
|
|
|
dyld: lazy symbol binding failed: Symbol not found: __ZN5boost6python7objects23register_dynamic_id_auxENS0_9type_infoEPFNSt3__14pairIPvS2_EES5_E
|
|
|
Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so
|
|
|
Expected in: flat namespace
|
|
|
```
|
|
|
|
|
|
A: This is due to different flavors of the C++ standard library (libc++ and libstdc++) being used for Boost and graph-tool itself. This is resolved by either compiling everything using clang with c++11 mode activated (which could be cumbersome, since the same would have to be done for everything else which uses Boost), or simply by upgrading to Mavericks or newer (see [here](https://trac.macports.org/ticket/43086) for more info). |
|
|
\ No newline at end of file |