On 07/19/2018 05:30 PM, Xiaozhu Meng wrote:
> The cmake error log is misleading and I was misled by it before. CMake will try multiple linking flags to test the available of pthread library, including -lpthread, -lpthreads, and -pthread. So, there will always be errors messages about pthread.
>
> Unfortunately, the real reason that causes the cmake failure sometimes only is shown on the terminal.
>
>
>
> On Thu, Jul 19, 2018 at 4:10 PM William Cohen <wcohen@xxxxxxxxxx <mailto:wcohen@xxxxxxxxxx>> wrote:
>
> I was trying to build a git checkout of dyninst on Fedora 28 and the cmake failed. Below is the cmake that I copied from the the rpmbuild of dyninst-9.3.2 srpm on Fedora 28:
>
> Â/usr/bin/cmake -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -DENABLE_STATIC_LIBS=1 -DINSTALL_LIB_DIR:PATH=/usr/lib64/dyninst -DINSTALL_INCLUDE_DIR:PATH=/usr/include/dyninst -DINSTALL_CMAKE_DIR:PATH=/usr/lib64/cmake/Dyninst -DCMAKE_BUILD_TYPE=None -DCMAKE_SKIP_RPATH:BOOL=YES
>
>
> Attached is the CMakeError.log file saying that it was unable to test for pthread_create because -lpthreads could not be found. Shouldn't that be "-lpthread"?
>
>
> /usr/lib64/ccache/cc -DCHECK_FUNCTION_EXISTS=pthread_create  -rdynamic CMakeFiles/cmTC_6b097.dir/CheckFunctionExists.c.o -o cmTC_6b097 -lpthreads
> /usr/bin/ld: cannot find -lpthreads
>
>
> A git bisect showed the failure is triggered by the following patch:
>
> commit 45feff81435754b317f980e33a9bad7de4846de5
> Author: Xiaozhu Meng <xmeng@xxxxxxxxxxx <mailto:xmeng@xxxxxxxxxxx>>
> Date:Â ÂFri Dec 29 10:26:49 2017 -0600
>
> Â Â Add unstrip and codeCoverage to the example dir. Will build and install
> Â Â them with Dyninst
>
> Anyone else noticed this type of problem before? Maybe a bug with cmake on Fedora 28?
>
> -Will
>
Hi,
Thanks for the pointer. Here is the output of the cmake command that look to be related to the problem:
CMake Error at examples/CMakeLists.txt:12 (file):
file COPY cannot copy file
"/home/wcohen/research/profiling/dyninst/dyninst/examples/unstrip/ddb.db"
to "/usr/bin/ddb.db".
CMake Error at examples/CMakeLists.txt:13 (file):
file COPY cannot copy file
"/home/wcohen/research/profiling/dyninst/dyninst/examples/unstrip/params.db"
to "/usr/bin/params.db".
CMake Error at examples/CMakeLists.txt:14 (file):
file COPY cannot copy file
"/home/wcohen/research/profiling/dyninst/dyninst/examples/unstrip/unistd.db"
to "/usr/bin/unistd.db".
-Will
|