在CentOS 7 Linux上安裝graph-tool. Building and Installing graph-tool on CentOS 7

在CentOS 7 Linux上安裝graph-tool. Building and Installing graph-tool on CentOS 7

最近因為使用需求而要在CentOS 7上頭安裝graph-tool,這是graph-tool官網對環境以及套件需求,只有倒數3項是不必要的: (I have to use graph-tool in CentOS 7, the following are the requirements for system environmentsand software packages. Only the last three are not necessary.)

Graph-tool was tested extensively only on GNU/Linux and MacOS X systems, but should also be usable on other systems where the below requirements are met.

  • A C++14 compiler (GCC version 5 or above, or clang version 3.4 or above).
  • The Boost libraries, version 1.54 or above.
  • Python version 2.7, 3 or above.
  • The expat library.
  • The SciPy python module.
  • The Numpy python module, version 1.7 or above.
  • The CGAL C++ geometry library, version 3.5 or above.
  • The sparsehash template library (optional, but recommended).
  • The GTK+ 3, cairomm, pycairo and matplotlib libraries, used for graph drawing (optional).
  • The Graphviz packaged for graph drawing, with the python bindings enabled (optional, deprecated).

但是CentOS7的gcc版本是gcc-4.8.5-4.el7.x86_64,比要求的gcc 5還舊,另外內建的boost是boost-1.53.0-25.el7.x86_64,比要求的1.54還舊;在安裝過程又遇到一堆dependency的問題,已經很久沒裝套件搞得這麼痛苦了,最後終於搞定,在此記錄一下:(However, the default gcc of CentOS7 is gcc-4.8.5-4.el7.x86_64 which is older than the required gcc 5. The built-in boost version is boost-1.53.0-25.el7.x86_64, which is older than boost 1.54. Besides, there are lot of dependency problems… This is a very hard way to setup all these tools for graph-tool. The following are the records to build and install graph-tool in CentOS 7 Linux.)

Continue reading