[graph-tool] Building graph-tool on CentOS 7

Steve stsmith at ll.mit.edu
Fri Oct 28 16:48:42 CEST 2016


I hit this issue again and found the fix. I'm posting the steps in case it's
useful to others in the future.

When upgrading (or downgrading) to a new version of Boost, it's necessary to
rebuild the entire stack in order (gcc, Boost, CGAL, graph-tool) by hand on
CentOS. It's also necessary to start with fresh cmake or autoconf
configurations, otherwise, there will be pointers somewhere in the stack to
old Boost versions.

Here's what I did on a fresh CentOS image:

*Necessary Packages and Environment*

sudo -E yum -y groupinstall 'Development Tools'
sudo -E yum -y install python-pip cairomm-devel pycairo-devel bzip2-devel
# dependency troubleshooting
sudo -E yum whatprovides */bzlib.h

export PATH="/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/lib64/:/usr/local/boost/stage/lib/"

*gcc*
https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2

cd ~/Downloads
curl ftp://ftp.gnu.org/pub/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2 -O
curl ftp://ftp.gnu.org/pub/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2.sig -O
gpg --verify gcc-5.4.0.tar.bz2.sig gcc-5.4.0.tar.bz2
tar xjfp gcc-5.4.0.tar.bz2
cd gcc-5.4.0
./configure --with-system-zlib --disable-multilib --enable-languages=c,c++
make -j 4
sudo make install
cd
rm -fr ~/Downloads/gcc-5.4.0/
gcc --version
g++ --version

*Boost* http://www.boost.org/users/download/

cd ~/Downloads
tar xfjp boost_1_61_0.tar.bz2
cd boost_1_61_0
./bootstrap.sh
./b2
# make sure latest gcc is in root's PATH
sudo bash -c 'export PATH=/usr/local/bin:$PATH; ./b2 install'
cd ~/Downloads
sudo mv ./boost_1_61_0 /usr/local
sudo ln -s /usr/local/boost_1_61_0 /usr/local/boost
ls -ld /usr/local/boost

# locate old Boost dynamic libraries and rm
sudo bash -c 'cd / ; updatedb'
locate 1.60 | grep boost

*CGAL* https://github.com/CGAL/cgal/releases

tar xfJp CGAL-4.9.tar.xz 
cd CGAL-4.9
cmake .
make
sudo bash -c 'export PATH=/usr/local/bin:$PATH; make install'

*graph-tool* https://graph-tool.skewed.de/

cd ~/Downloads
tar xfjp graph-tool-2.18.tar.bz2
cd graph-tool-2.18
./configure --with-sparsehash-prefix=google --with-boost=/usr/local/boost
--with-boost-libdir=/usr/local/boost/stage/lib CPPFLAGS="-I/usr/local/boost"
LDFLAGS="-L/usr/local/boost/stage/lib"
less config.log # Make sure graph-tool points at the correct boost
directories
make
sudo make install
cd

# CentOS issues with matplotlib versions,
https://stackoverflow.com/questions/33720656/python-2-import-error-cannot-import-name-unpack-labeled-data/

sudo -E pip uninstall matplotlib
sudo -E pip uninstall matplotlib
sudo -E pip install --upgrade matplotlib
sudo -E yum -y install python

ipython

import graph_tool.all as gt
g = gt.Graph()
v = g.add_vertex()
u = g.add_vertex()
e = g.add_edge(v,u)
gt.graph_draw(g)




--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Building-graph-tool-on-CentOS-7-tp4025761p4026809.html
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.



More information about the graph-tool mailing list