CentOS 6 comes with an outdated version of Gearman, version 0.14 released July 2010. (Ubuntu ships the same version; I wonder if it’s because the gearman.org download page incorrectly lists 0.14 as the latest version of
libgearman?) The latest version is currently 0.27, so I tried compiling it on a fresh install of CentOS. I came across this error:
I installed the
boost-devel package and tried again… and got the exact same result. The version of
boost-devel in CentOS 6 is 1.41, so everything should have been fine. A quick google search revealed some posts by people having trouble compiling Gearman on older CentOS versions because
boost was out of date, but that shouldn’t apply here.
I finally found this bug report which revealed the real problem: I didn’t install g++ (found in the
gcc-c++ package). Installing the
gcc-c++ package fixed the issue. If you’re starting with a fresh CentOS 6 install, make sure to install the
make packages, too.
Finally, if you want to rebuild the CentOS RPM with the newer upstream version, here are the changes I made to the
.spec file. Beware: I haven’t tested the RPM or Gearman 0.27 at all yet, I just got it building. Update: I just posted a spec file for the gearman PECL extension, too.