Building Gearman: cannot find the flags to link with boost thread

While running ./configure things may bail out with the message “cannot find the flags to link with boost thread”. This is cause by configure not being able to find the development version of the libboost-thread libraries on the current library path. If you’ve not built libboost from source, you probably need to install the -dev version of the libboost-thread package for your distribution.

For ubuntu this package is named libboost-thread-dev (you’ll find specific versions under names such as “libboost-thread1.46-dev”. Do apt-cache search libboost-thread to see which packages are available).

For Gentoo the package is named dev-libs/boost, so just emerge that one (thanks to J/#gearman).

3 thoughts on “Building Gearman: cannot find the flags to link with boost thread”

  1. I build boost 1.50 from scratch and installed it and I have this problem

    configure: Detected BOOST_ROOT; continuing with –with-boost=/usr/local
    checking for Boost headers version >= 1.35.0… /usr/local/include
    checking for Boost’s header version… 1_50
    checking boost/bind.hpp usability… yes
    checking boost/bind.hpp presence… yes
    checking for boost/bind.hpp… yes
    checking for the toolset name used by Boost for g++… gcc46 -gcc
    checking boost/date_time/posix_time/posix_time.hpp usability… yes
    checking boost/date_time/posix_time/posix_time.hpp presence… yes
    checking for boost/date_time/posix_time/posix_time.hpp… yes
    checking for the Boost date_time library… yes
    checking boost/function.hpp usability… yes
    checking boost/function.hpp presence… yes
    checking for boost/function.hpp… yes
    checking boost/scoped_ptr.hpp usability… yes
    checking boost/scoped_ptr.hpp presence… yes
    checking for boost/scoped_ptr.hpp… yes
    checking boost/shared_ptr.hpp usability… yes
    checking boost/shared_ptr.hpp presence… yes
    checking for boost/shared_ptr.hpp… yes
    checking for the flags needed to use pthreads… -pthread
    checking boost/thread.hpp usability… yes
    checking boost/thread.hpp presence… yes
    checking for boost/thread.hpp… yes
    checking for the Boost thread library… no
    configure: error: cannot find the flags to link with Boost thread

  2. Checking the config.log file I determined I should have build boost 1.50 using
    ./bjam –layout=versioned install

  3. Attempting to build 0.33 here on Debian jessie, my ./configure failed with the same error. config.log contained:

    configure:21242: g++ -o conftest -pthread -L/lib64 conftest.o -lboost_thread -pthread >&5
    /usr/bin/ld: conftest.o: undefined reference to symbol ‘_ZN5boost6system15system_categoryEv’

    http://stackoverflow.com/a/20059671/345716 led me to:

    CPPFLAGS=-lboost_system ./configure

    which made ./configure work for me.

Leave a Reply

Your email address will not be published.