Skip to content

Instantly share code, notes, and snippets.

@floriangeigl
Forked from v-pravin/graph-tool_installation.md
Last active February 18, 2018 23:07
Show Gist options
  • Save floriangeigl/ee222e581b04a0d7922c to your computer and use it in GitHub Desktop.
Save floriangeigl/ee222e581b04a0d7922c to your computer and use it in GitHub Desktop.
Installation of graph-tool from source

INSTALLATION OF GRAPH-TOOL FROM SOURCE

System

If you have gcc > 5.0 installed on your server you can use my anaconda package which I compiled with openmp and boost 1.60: just use conda install graph-tool -c floriangeigl -c msarahan -c conda-forge -c bioconda -c ostrokach -c vgauthier -c salford_systems to install it.

How to install gcc-5 on Ubuntu 14.04: http://askubuntu.com/questions/618474/how-to-install-the-latest-gcurrently-5-1-in-ubuntucurrently-14-04

Requirements as given under - http://graph-tool.skewed.de/download
  1. GCC, version 4.8 or above (version 4.9 is recommended). For MacOS X, the clang compiler is required.
    • sudo apt-get install gcc-4.8
  2. The Boost libraries, version 1.54 or above.
  3. Python version 2.7 or 3 and above.
    • bash Anaconda-2.1.0-Linux-x86_64.sh
  4. The expat library.
  5. The SciPy python module.
    • Included in Anaconda's Python distribution (conda list | grep numpy)
  6. The Numpy python module.
    • Included in Anaconda's Python distribution (conda list | grep scipy)
  7. The CGAL C++ geometry library, version 3.5 or above.
  8. The sparsehash template library (optional, but recommended).
  9. The cairomm, pycairo and matplotlib libraries, used for graph drawing (optional).
  10. The Graphviz packaged for graph drawing, with the python bindings enabled (optional, deprecated).
    • I am not installing this as it is optional.
Download graph-tool
  • wget http://downloads.skewed.de/graph-tool/graph-tool-2.2.35.tar.bz2
  • cd ./graph-tool-2.2.35.tar.bz2
  • ./configure CPPFLAGS=-I$(find /PATH_TO_ANACONDA/pkgs -regextype posix-extended -regex ".*py[0-9]+cairo.*/include" -type d | head -1) --enable-openmp
    • add if you compiled boost on your own --with-boost=/opt/boost LDFLAGS="-L/opt/boost/lib" CPPFLAGS="-I/opt/boost/lib"
  • make
  • make install

DONE

@eXcuvator
Copy link

eXcuvator commented May 19, 2017

I have gcc 5.4 installed and installed your anaconda package with conda install graph-tool -c floriangeigl -c msarahan -c conda-forge -c bioconda -c ostrokach -c vgauthier -c salford_systems -n graph-tool

I can import graph_tool without problems, but from_graph_tool import inference will give

ImportError: libCGAL.so.12: cannot open shared object file: No such file or directory

What's happening here? (installed packages as follows:)

#
boost                     1.63.0              np112py36_6    conda-forge
boost-cpp                 1.63.0                        1    conda-forge
bzip2                     1.0.6                         1    conda-forge
cairo                     1.14.6                        3    conda-forge
expat                     2.1.0                         2    conda-forge
fontconfig                2.12.1                        3    conda-forge
freetype                  2.7                           1    conda-forge
gettext                   0.19.7                        1    conda-forge
glib                      2.51.4                        0    conda-forge
gmp                       6.1.2                         0    conda-forge
libffi                    3.2.1                         3    conda-forge
libiconv                  1.14                          4    conda-forge
libpng                    1.6.28                        0    conda-forge
libsigcpp                 2.8.0                         3    conda-forge
libxml2                   2.9.4                         3    conda-forge
mpfr                      3.1.5                         0    conda-forge
pcre                      8.39                          0    conda-forge
pixman                    0.34.0                        0    conda-forge
pycairo                   1.11.0                   py36_0    conda-forge
sparsehash                2.0.3                         0    conda-forge
cairomm                   1.12.0                        3    floriangeigl
cgal                      4.8.1                         0    floriangeigl
icu                       56.1                          3    floriangeigl
libgfortran               3.0.0                         1  
mkl                       2017.0.1                      0  
libgcc                    5.2.0                         0    msarahan
numpy                     1.12.1                   py36_0  
openssl                   1.0.2k                        2  
graph-tool                2.22                     py36_1    ostrokach
libgcc-5                  5.4.0                         2    ostrokach
pip                       9.0.1                    py36_1  
python                    3.6.1                         2  
readline                  6.2                           2  
scipy                     0.19.0              np112py36_0  
setuptools                27.2.0                   py36_0  
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
wheel                     0.29.0                   py36_0  
xz                        5.2.2                         1  
zlib                      1.2.8                         3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment