1. 程式人生 > >gearman安裝,提示錯誤:configure: error: could not find boost

gearman安裝,提示錯誤:configure: error: could not find boost

開發十年,就只剩下這套架構體系了! >>>   

背景及最終解決方案

在CentOS 7上安裝gearman時,提示錯誤:configure: error: could not find boost,最終解決方案是:

先安裝:

# yum install -y boost boost-devel

發現問題還是沒解決,最終通過Bing找到了正確的答案,還要繼續安裝:

# yum install gcc-c++.x86_64 gperf

最後,再執行 ./configure  完美通過。

 

安裝與排查過程詳細說明

1、下載gearman

進入:https://github.com/gearman/gearmand/releases ,下載: gearmand-1.1.18.tar.gz

2、本地解壓

tar -xzvf ./gearmand-1.1.18.tar.gz

3、執行

./configure

 

錯誤來了,提示:could not find boost

checking for boostlib >= 1.39... configure: We could not detect the boost libraries (version 1.39 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
configure: error: could not find boost

網上找了一圈,很多答案都只是寫著:

解決辦法

# yum install -y boost boost-devel

即可

 摘自:http://www.bubuko.com/infodetail-448566.html

 

根據提示,進行安裝,並確保已經安裝boost:

[root@iz8vbetvcrpn38l0x1kd06z gearmand-1.1.18]# yum install -y boost boost-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * remi-php71: mirrors.tuna.tsinghua.edu.cn
 * remi-safe: mirrors.tuna.tsinghua.edu.cn
Package boost-1.53.0-27.el7.x86_64 already installed and latest version
Package boost-devel-1.53.0-27.el7.x86_64 already installed and latest version
Nothing to do

 

安裝的目錄位於:/usr/include/boost,並且根據上面英文的錯誤提示,檢視安裝的boost版本號為:

#define BOOST_VERSION 105300

#define BOOST_LIB_VERSION "1_53"

版本為1.53,是高於1.39的。但為什麼依然找不到呢?

 

繼續再重新看多幾遍英文錯誤提示,繼續在/etc/environment追加環境變數:

export BOOST_ROOT=/usr/include/boost

source後依舊不行。

 

轉機

繼續查了一通,在眾多資料中找到了:

搞定了,zypper in gcc gcc-c++,後面這個gcc-c++沒安裝。

摘自:http://tieba.baidu.com/p/3481148738?traceid=

 

但是還是有點迷糊。

 

轉用Bing,在國外找到了解決方案:

I had the same issue compiling 1.1.12
boost-devel was installed but wasn't being detected, even when I pass --with-boost

For whatever reason installing these packages allowed it to compile

yum install gcc-c++.x86_64 gperf

摘自:https://github.com/gearman/gearmand/issues/68

 

完美解決

至此,問題已經解決,並且./configure 通過。

 

config.status: executing libtool commands
---
Configuration summary for gearmand version 1.1.18

   * Installation prefix:       /usr/local
   * System type:               pc-linux-gnu
   * Host CPU:                  x86_64

 

附:

php7的gearman擴充套件安裝,請參考:https://segmentfault.com/a/1190000011692431