Skip to content

Instantly share code, notes, and snippets.

@edjdavid
Last active November 22, 2017 10:10
Show Gist options
  • Save edjdavid/581adb6ef73a6bbac2965d6ba33e73c9 to your computer and use it in GitHub Desktop.
Save edjdavid/581adb6ef73a6bbac2965d6ba33e73c9 to your computer and use it in GitHub Desktop.
Installing graph-tool in a pure conda environment

Linux

Add conda-forge and salford_systems (for gcc5) to the conda channels

~/.condarc

channels:
  - defaults
  - conda-forge
  - salford_systems

Create and activate a new environment

conda create -n gt35 python=3.5

source activate gt35

conda install -c salford_systems boost-gcc5=1.59 gcc-5 libgcc-5
conda install cairo matplotlib scipy libsigcpp cairomm xorg-renderproto pycairo sparsehash xorg-libxrender xorg-libxau m4 pthread-stubs system xorg-util-macros xorg-libxdmcp libtool
conda install -c conda-forge readline

Build CGAL using GCC-5

wget https://github.com/CGAL/cgal/releases/download/releases/CGAL-4.11/CGAL-4.11.zip
unzip CGAL-4.11.zip
cd CGAL-4.11
cmake \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_PREFIX_PATH=${CONDA_PREFIX} \
  -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
  -DCGAL_INSTALL_LIB_DIR=lib \
  -DWITH_CGAL_ImageIO=OFF -DWITH_CGAL_Qt5=OFF .
make

Build Graph Tool

wget https://downloads.skewed.de/graph-tool/graph-tool-2.26.tar.bz2
tar xvjf graph-tool-2.26.tar.bz2
cd graph-tool-2.26

export ENV_DIR=$CONDA_PREFIX
PACKAGE_DATA_DIR='share/graph-tool' LIBRARY_PATH=$ENV_DIR'/lib' LD_LIBRARY_PATH=$ENV_DIR'/lib' LDFLAGS='-L'$ENV_DIR'/lib' PKG_CONFIG_PATH=$ENV_DIR'/lib/pkgconfig:'$PKG_CONFIG_PATH CXXFLAGS='-I'$ENV_DIR'/include' CFLAGS='-I'$ENV_DIR'/include' BOOST_ROOT=$ENV_DIR'/include' BOOST_CPPFLAGS='-L'$ENV_DIR'/include/boost' CPPFLAGS='-I'$ENV_DIR'/usr/local/include' BOOST_LDFLAGS='-L'$ENV_DIR'/lib' ./configure --with-boost=$ENV_DIR/lib --prefix=$ENV_DIR --with-cgal=$ENV_DIR/lib/ --with-expat=$ENV_DIR/lib --with-gnu-ld

make
make install

OSX

Create and activate a new environment

conda create -n gt36 -c conda-forge python=3.6 matplotlib scipy readline boost cgal cairo libsigcpp cairomm pycairo sparsehash m4 pthread-stubs expat fontconfig

Build Graph Tool

wget https://downloads.skewed.de/graph-tool/graph-tool-2.26.tar.bz2
tar xvjf graph-tool-2.26.tar.bz2
cd graph-tool-2.26

export ENV_DIR=$CONDA_PREFIX

PACKAGE_DATA_DIR='share/graph-tool' LIBRARY_PATH=$ENV_DIR LD_LIBRARY_PATH=$ENV_DIR'/lib' LDFLAGS='-L'$ENV_DIR'/lib' PKG_CONFIG_PATH=$ENV_DIR'/lib/pkgconfig:'$PKG_CONFIG_PATH CXXFLAGS='-I'$ENV_DIR'/include' CFLAGS='-I'$ENV_DIR'/include' CPPFLAGS='-I'$ENV_DIR'/usr/local/include -I'$ENV_DIR'/include -I'$ENV_DIR'/include/pycairo -I'$ENV_DIR'/include/cairo -I'$ENV_DIR'/include/cairomm-1.0/cairomm'  CAIROMM_LIBS=$ENV_DIR'/lib/cairomm-1.0/include '$ENV_DIR'/include/cairomm-1.0' CAIROMM_CFLAGS='-I'$ENV_DIR'/include -I'$ENV_DIR'/include/cairomm-1.0 -I'$ENV_DIR'/lib/cairomm-1.0/include -I'$ENV_DIR'/include/sigc++-2.0 -I'$ENV_DIR'/lib/sigc++-2.0/include -I'$ENV_DIR'/include/freetype2' ./configure --prefix=$ENV_DIR --exec-prefix=$ENV_DIR --with-cgal=$ENV_DIR --with-expat=$ENV_DIR --enable-openmp --with-boost=$ENV_DIR --with-boost-thread=boost_thread-mt --enable-static
 
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment