在Ubuntu 10.04上安装Gearman。缺少boost库。

3
我正在尝试在Ubuntu上安装Gearman,但在执行make命令时遇到了一些困难。我正在尝试安装1.1.2版本。
这是make命令的输出结果。
CXX    bin/error.o
CXXLD  bin/gearadmin
bin/bin_gearadmin-gearadmin.o: In function `main':
/home/john/gearmand/gearmand-1.1.2/bin/gearadmin.cc:129: undefined reference to `boost::program_options::options_description::options_description(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
collect2: ld returned 1 exit status
  CXX    libtest/libtest_unittest-unittest.o
make[1]: *** [bin/gearadmin] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/john/gearmand/gearmand-1.1.2'
make: *** [all] Error 2

我已经按照这篇博客文章的步骤进行安装 - http://rdstash.blogspot.com/2012/02/installing-gearman-101-on-ubuntu-1104.html

我运行了以下命令来安装boost,但好像没有起作用。

sudo apt-get install libboost-program-options1.40-dev libboost-thread1.40-dev -y

有什么建议可以让它在我的系统上运行吗?如果需要进一步的信息,请告诉我。

更新

我运行了apt-get remove并尝试使用此处列出的步骤安装旧版本 - http://moffe42.blogspot.com/2011/12/installing-gearman-on-ubuntu-1004.html

运行以下命令给了我这个结果

sudo apt-get install gearman gearman-job-server gearman-tools libgearman4 libgearman-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  libgearman4: Conflicts: libgearman-server0
  libgearman6: Conflicts: libgearman-server0
E: Broken packages

我尝试安装libgearman-server0,但是我收到了以下消息

The following packages have unmet dependencies:
  gearman-tools: Depends: libgearman6 (= 0.32-0~598-1~lucid1) but it is not going to be installed
  libgearman-dev: Depends: libgearman6 (= 0.32-0~598-1~lucid1) but it is not going to be installed
E: Broken packages

当我安装这个软件包时,它只会给我以前的消息(它只是不断交替)。

可能是您正在尝试编译的_gearman_版本(1.1.2)需要比Ubuntu 10.04上可用的_boost_更高版本的_boost_(您提到的说明适用于1.0.2,要求可能已经发生变化)。对于旧版本的_gearman_(0.10),Ubuntu 10.04有可用的_gearman_软件包,您真的需要最新的_gearman_版本吗? - Pedro Romano
嗯,你可能是对的。不,我不需要最新版本。我应该尝试一些来自0.2分支的东西吗? - JohnP
我建议首先安装Ubuntu 10.04中与_gearman_相关的软件包。这应该是最简单的解决方案。如果不符合您的要求,则尝试编译版本1.0.2或1.0.x分支中的最新版本。 - Pedro Romano
2
这是我在编译时安装的命令:"apt-get install gearman build-essential libboost-dev libevent-dev uuid-dev libboost-program-options-dev libboost-thread-dev"。希望这可以帮到您。 - Simon Bennett
1个回答

3

我并没有找到一个确切的答案。当我回到这个问题时,我决定将我的操作系统更新到12.04版本,然后再运行安装程序。这次安装非常顺利。

以下是我在12.04上安装gearmand的步骤:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gcc autoconf bison flex libtool make libboost-all-dev libcurl4-openssl-dev curl libevent-dev memcached uuid-dev libsqlite3-dev libmysqlclient-dev
sudo apt-get install gperf
sudo apt-get install libcloog-ppl0
cd /tmp/
wget https://launchpad.net/gearmand/1.2/1.1.9/+download/gearmand-1.1.9.tar.gz
tar xvzf gearmand-1.1.9.tar.gz
cd gearmand-1.1.9/
./configure
sudo make
sudo make install

sudo ldconfig
sudo pecl install gearman  #you will need to install pecl if you don't have it

#Edit INI files and add extension=gearman.so to it 
#/etc/php5/cli/php.ini
#/etc/php5/apache2/php.ini 

sudo ldconfig

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接