Description
When building Qpid Proton on CentOS 7 in Docker, using Dockerfile
Step 8/9 : RUN cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=/root/Work/qpid-install ---> Running in 290c464d8c69 -- The C compiler identification is GNU 4.8.5 -- Check for working C compiler using: Ninja -- Check for working C compiler using: Ninja -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.2k") -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR) -- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1") -- Found CyrusSASL: /usr/lib64/libsasl2.so (found version "2.1.26") -- Found PythonInterp: /usr/bin/python3.6 (found suitable version "3.6.8", minimum required is "3.6") -- Found PythonLibs: /usr/lib64/libpython3.6m.so (found suitable exact version "3.6.8") -- Looking for a CXX compiler -- Looking for a CXX compiler - /usr/bin/c++ -- The CXX compiler identification is GNU 4.8.5 -- Check for working CXX compiler using: Ninja -- Check for working CXX compiler using: Ninja -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Build type is "RelWithDebInfo" (has debug symbols) -- PN_VERSION: 0.36.0 (SNAPSHOT) -- Looking for clock_gettime -- Looking for clock_gettime - found -- Looking for strerror_r -- Looking for strerror_r - found -- Looking for epoll_wait -- Looking for epoll_wait - found -- Building the epoll proactor -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Could NOT find JsonCpp (missing: JsonCpp_LIBRARY JsonCpp_INCLUDE_DIR) -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Configuring done -- Generating done -- Build files have been written to: /qpid-proton/build Removing intermediate container 290c464d8c69 ---> 6832cb8c68ac Step 9/9 : RUN ninja install ---> Running in 4dc6c077dce0 ninja: error: '-lpthread', needed by 'c/libqpid-proton.so.11.14.0', missing and no known rule to make it
I suspect this is because -lpthread is not an actual library on disk, but simply an alias for -pthread gcc switch. Older CMake cannot be told to prefer the switch variant, and it tries the library first, which succeeds for the purposes of the CMake project config check.
C.f. THREADS_PREFER_PTHREAD_FLAG, from https://cmake.org/cmake/help/v3.1/module/FindThreads.html
Workaround is to build project with make.
Attachments
Attachments
Issue Links
- Discovered while testing
-
PROTON-2433 The work for PROTON-2254 seems to have broken modern use of CMake
- Closed