<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10055</bug_id>
          
          <creation_ts>2016-07-31 21:40:30 +0000</creation_ts>
          <short_desc>pthread.h is not found by CMake 3.4</short_desc>
          <delta_ts>2016-08-10 21:04:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>2.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>tiktokoptik</reporter>
          <assigned_to>tiktokoptik</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>maxin.john</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>64706</commentid>
    <comment_count>0</comment_count>
    <who name="">tiktokoptik</who>
    <bug_when>2016-07-31 21:40:30 +0000</bug_when>
    <thetext>System:
BitBake Build Tool Core version 1.30.0
korogoth from git, July 18, commit f73006031ef8bca7b8851724832c6f37ed63ec89

The build fails finding pthread.h:

-- Looking for pthread.h
| -- Looking for pthread.h - not found
| CMake Error at /home/Build/embedded_distribution/poky/build/tmp/sysroots/x86_64-linux/usr/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
|   Could NOT find Threads (missing: Threads_FOUND)
| Call Stack (most recent call first):
|   /home/Build/embedded_distribution/poky/build/tmp/sysroots/x86_64-linux/usr/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
|   /home/Build/embedded_distribution/poky/build/tmp/sysroots/x86_64-linux/usr/share/cmake-3.4/Modules/FindThreads.cmake:223 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
|   /home/Build/embedded_distribution/poky/build/tmp/sysroots/x86_64-linux/usr/share/cmake-3.4/Modules/FindCUDA.cmake:755 (find_package)
|   CMakeLists.txt:36 (find_package)
| 
| 
| -- Configuring incomplete, errors occurred!
| See also &quot;/home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/build/CMakeFiles/CMakeOutput.log&quot;.
| See also &quot;/home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/build/CMakeFiles/CMakeError.log&quot;.
| WARNING: /home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/temp/run.do_configure.20599:1 exit 1 from &apos;cmake ${OECMAKE_SITEFILE} /home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/git -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_BINDIR:PATH=/usr/bin -DCMAKE_INSTALL_SBINDIR:PATH=/usr/sbin -DCMAKE_INSTALL_LIBEXECDIR:PATH=/usr/libexec -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=/com -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/var -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib -DCMAKE_INSTALL_INCLUDEDIR:PATH=/usr/include -DCMAKE_INSTALL_DATAROOTDIR:PATH=/usr/share -DCMAKE_INSTALL_SO_NO_EXE=0 -DCMAKE_TOOLCHAIN_FILE=/home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/toolchain.cmake -DCMAKE_VERBOSE_MAKEFILE=1 -DCUDA_TOOLKIT_ROOT_DIR=/home/Build/embedded_distribution/poky/build/tmp/sysroots/jetson-tx1/usr/local/cuda-7.0 ${PACKAGECONFIG_CONFARGS} -Wno-dev&apos;
| ERROR: Function failed: do_configure (log file is located at /home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/temp/log.do_configure.20599)
ERROR: Task 6 (/home/Build/embedded_distribution/poky/meta-sensition/recipes-sensition-apps/sensorpro/sensorpro_0.0.1.bb, do_configure) failed with exit code &apos;1&apos;
DEBUG: Teardown for bitbake-worker
NOTE: Tasks Summary: Attempted 2071 tasks of which 2070 didn&apos;t need to be rerun and 1 failed.
No currently running tasks (1772 of 2079)

Summary: 1 task failed:
  /home/Build/embedded_distribution/poky/meta-sensition/recipes-sensition-apps/sensorpro/sensorpro_0.0.1.bb, do_configure
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.


This is not related to earlier error concerning old-style-definition and main() as the function is now updated to main(void). Closer look at the error in poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/build/CMakeFiles/CMakeError.log shows:

Determining if the include file pthread.h exists failed with the following output:
Change Dir: /home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/build/CMakeFiles/CMakeTmp

Run Build Command:&quot;/usr/bin/gmake&quot; &quot;cmTC_06107/fast&quot;
make -f CMakeFiles/cmTC_06107.dir/build.make CMakeFiles/cmTC_06107.dir/build
make[1]: Entering directory &apos;/home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/build/CMakeFiles/CMakeTmp&apos;
Building C object CMakeFiles/cmTC_06107.dir/CheckIncludeFile.c.o
/home/Build/embedded_distribution/poky/build/tmp/sysroots/x86_64-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc    -fPIC    -o CMakeFiles/cmTC_06107.dir/CheckIncludeFile.c.o   -c /home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:21: fatal error: pthread.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_06107.dir/build.make:65: recipe for target &apos;CMakeFiles/cmTC_06107.dir/CheckIncludeFile.c.o&apos; failed
make[1]: *** [CMakeFiles/cmTC_06107.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory &apos;/home/Build/embedded_distribution/poky/build/tmp/work/aarch64-poky-linux/sensorpro/0.0.1-r0/build/CMakeFiles/CMakeTmp&apos;
Makefile:126: recipe for target &apos;cmTC_06107/fast&apos; failed
gmake: *** [cmTC_06107/fast] Error 2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64714</commentid>
    <comment_count>1</comment_count>
    <who name="Maxin B. John">maxin.john</who>
    <bug_when>2016-08-01 09:04:41 +0000</bug_when>
    <thetext>Hi,

Is it possible to share the meta-sensition layer location or sensorpro recipe to recreate this error ? It will be great if we had access to &quot;MakeFiles/CMakeError.log&quot; error log for debugging as well..

Thanks,
Maxin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65040</commentid>
    <comment_count>2</comment_count>
    <who name="">tiktokoptik</who>
    <bug_when>2016-08-10 21:04:16 +0000</bug_when>
    <thetext>Hi
The issue was solved by adding TARGET_CC_ARCH += &quot;-pthread&quot;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>