If libgomp-dev is installed in the SDK, omp.h is installed in /opt/poky/1.7/sysroots/core2-64-poky-linux/usr/lib/gcc/x86_64-poky-linux/4.9.1/include, however gcc complains it cannot be found: $ $CC -fopenmp -o temp.o temp.c temp.c:1:17: fatal error: omp.h: No such file or directory #include <omp.h> ^ compilation terminated. Indeed -Wp,-v shows that gcc doesn't look in that directory at all: $ $CC -Wp,-v -o test5 test5.c ignoring nonexistent directory "/opt/poky/1.7/sysroots/core2-64-poky-linux/usr/local/include" ignoring nonexistent directory "/opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/../../../../../x86_64-poky-linux/include" #include "..." search starts here: #include <...> search starts here: /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/include /opt/poky/1.7/sysroots/x86_64-pokysdk-linux/usr/lib/x86_64-poky-linux/gcc/x86_64-poky-linux/4.9.1/include-fixed /opt/poky/1.7/sysroots/core2-64-poky-linux/usr/include End of search list. omp.h is installed as part of the target sysroot, not nativesdk, so we need to account for this additional directory.
I have reproduced the problem locally as well. The fix in poky-contrib with commit ID: d3d5ec821fdf3e117ba76ad93cbff8bb7fd80727 is working for me as fix.
OK, thanks. I ran that fix past Richard and he has asked me to eliminate the exposure of target_libdir to the build environment, which I think I can do by instead stripping the sysroot from libdir. I should be able to send a new patch early next week.
I've sent an updated patch that takes care of Richard's earlier concerns: http://cgit.openembedded.org/openembedded-core-contrib/commit/?h=paule/gcc-omp-fix&id=c452114d4c6cb205336bc729d3fc2f57fd821bab
Fix now merged to master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8bef63373d605576779adef3ebd34c52f72632ef I'm assuming we'd want to backport this to dizzy / daisy as well.
Fix merged to dizzy as well: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dizzy&id=ceb5a66d0b378fe4898bf7ccc5945246bbe332fc I think we can mark this one as resolved now.