[yocto] CMake issue - missing header files

Martin Kiepfer martin.kiepfer at gmail.com
Wed Oct 14 01:14:52 PDT 2015


Hi there,

I noticed a curious problem when trying to build a cmake based recipe.
During configuration phase pthead.h is found.

 cmake
> /opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/src
> -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_BINDIR:PATH=/usr/bin
> -DCMAKE_INSTALL_SBINDIR:PATH=/usr/sbin
> -DCMAKE_INSTALL_LIBEXECDIR:PATH=/usr/lib/vs100k
> -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=/opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/toolchain.cmake
> -DCMAKE_VERBOSE_MAKEFILE=1 -Wno-dev
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is GNU 5.2.0
> -- Check for working C compiler:
> /opt/ZX3/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
> -- Check for working C compiler:
> /opt/ZX3/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
> -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Check for working CXX compiler:
> /opt/ZX3/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
> -- Check for working CXX compiler:
> /opt/ZX3/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
> -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Looking for include file pthread.h
> -- Looking for include file pthread.h - found
> -- Looking for pthread_create


But during build phase some header files can not be found?!

/opt/ZX3/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
>    -lrt
> -I/opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/build
> -I/opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/src/.
> -I/opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/src/log
> -I/opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/src/fpga
>    -o CMakeFiles/vs100k.dir/log/Log.cpp.o -c
> /opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/src/log/Log.cpp
> In file included from
> /opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/src/VS100K.cpp:8:0:
> /opt/ZX3/yocto/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/vs100k/0.1-r0/src/VS100K.h:4:21:
> fatal error: pthread.h: No such file or directory
> make[2]: *** [CMakeFiles/vs100k.dir/log/LogToSyslog.cpp.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> compilation terminated.


Also socket.h can not be found.
My receipe is very rudimentary:

>
>
> #SECTION = "package"
> LICENSE = "CLOSED"
> PR = "r0"
> PV = "0.1"
> DEPENDS = "cmake-native"
> S = "${WORKDIR}/src"
> inherit pkgconfig cmake
> SRC_URI = " file://CMakeLists.txt \
>             file://src/fpga/VS100K.h \
>             file://src/log/LogToConsole.h \
>             file://src/log/LogIf.h \
>             file://src/log/LogToSyslog.h \
>             file://src/fpga/Fpga.h \
>             file://src/main.cpp \
>             file://src/fpga/VS100K.cpp \
>             file://src/log/LogToSyslog.cpp \
>             file://src/log/LogToConsole.cpp \
>             file://src/fpga/Fpga.cpp \
>              "
> do_install() {
>     install -m 0755 -d ${D}${bindir}
>     install -m 0755 vs100k ${D}${bindir}
> }


Any idea how to resolve this?
Building the same application using Yocto Eclipse plugins works properly.

regards,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20151014/3d616a99/attachment.html>


More information about the yocto mailing list