1. 程式人生 > >編譯安裝mysql時報缺少boost1.59後,編譯安裝boost1.59

編譯安裝mysql時報缺少boost1.59後,編譯安裝boost1.59

boost1.59源碼安裝

1、下載:

網址:https://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz

2、編譯:

2.1 快速安裝Boost:

在Linux內核的操作系統下安裝boost 1.59.0很容易,最簡單的方式是在Boost解壓縮後的目錄下直接執行命令:

   ./bootstrap.sh

   ./b2 install

第一條命令語句booststrap.sh是編譯前的配置工作,第二條命令b2開始真正的編譯並安裝Boost。由於未指定額外選項,Boost將編譯Release版本的庫文件,把頭文件安裝到/usr/local/include,庫文件安裝到/usr/local/lib。

2.2 完整安裝Boost:

完整編譯Boost,使用buildtype選項指定編譯類型(如不指定默認使用release模式),在bootstrap.sh之後執行如下命令:

   ./b2 --buildtype=complete install

這樣將開始對Boost的完整編譯,安裝所有調試版、發行版的靜態庫和動態庫。

2.3 定制安裝Boost:

完整編譯Boost費時費力,在實際開發中這些庫也不會都用到,因此,Boost也允許用戶自行選擇要編譯的庫。執行命令:

    ./b2 --show-libraries

可查看所有必須編譯才能使用的庫。

在完全編譯的基礎上,可使用--with或者--without選項打開或者關閉某個庫的編譯,如:

    ./b2 --with-date_time --buildtype=complete install

將僅編譯安裝date_time庫。

一般可使用如下安裝命令:

   sudo ./b2 link=static install       #編譯安裝所有靜態庫

error 解決:

使用需要python庫

否則出現如下error:

./boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory

compilation terminated.

"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -pthread -fPIC -m32 -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -I"/usr/include/python2.7" -c -o "bin.v2/libs/python/build/gcc-5.4.0/release/threading-multi/object/function_doc_signature.o" "libs/python/src/object/function_doc_signature.cpp"

...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-5.4.0/release/threading-multi/object/function_doc_signature.o...

..failed updating 58 targets...
...skipped 12 targets...
...updated 11810 targets...

使用

yum -y install python-dev


本文出自 “夜色” 博客,請務必保留此出處http://liuqun.blog.51cto.com/3544993/1983726

編譯安裝mysql時報缺少boost1.59後,編譯安裝boost1.59