fluent / fluent-bit

Fast and Lightweight Logs and Metrics processor for Linux, BSD, OSX and Windows
https://fluentbit.io
Apache License 2.0
5.85k stars 1.58k forks source link

configure: error: cannot run C compiled programs #205

Closed naveennadhv closed 7 years ago

naveennadhv commented 7 years ago

I was trying to build the package using "fluent-bit_git.bb" , using "armv7at2hf-vfp-neon-angstrom-linux-gnueabi". got a response

"ERROR: oe_runmake failed"

More exact error message is

 include -I/home/naveen/oe-core/build/tmp-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/fluent-bit/0.1.0-r0/git/lib/mbedtls-2.4.1/include    -o CMakeFiles/mbedcrypto.dir/ccm.c.o   -c /home/naveen/oe-core/build/tmp-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/fluent-bit/0.1.0-r0/git/lib/mbedtls-2.4.1/library/ccm.c
| configure: error: in `/home/naveen/oe-core/build/tmp-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/fluent-bit/0.1.0-r0/build/onigmo-prefix/src/onigmo-build':
| configure: error: cannot run C compiled programs.
| If you meant to cross compile, use `--host'.
| See `config.log' for more details
| CMakeFiles/onigmo.dir/build.make:108: recipe for target 'onigmo-prefix/src/onigmo-stamp/onigmo-configure' failed
| make[2]: *** [onigmo-prefix/src/onigmo-stamp/onigmo-configure] Error 1
| make[2]: Leaving directory '/home/naveen/oe-core/build/tmp-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/fluent-bit/0.1.0-r0/build'
| CMakeFiles/Makefile2:70: recipe for target 'CMakeFiles/onigmo.dir/all' failed
| make[1]: *** [CMakeFiles/onigmo.dir/all] Error 2
| make[1]: *** Waiting for unfinished jobs....

I successfully build the package of fluentbit_0.7.2 using the recipe file from "

layers.openembedded.org

" Anybody please help me to solve this issue

edsiper commented 7 years ago
  1. would you please share the content of your fluent-bit_git.bb ?
  2. would you please describe how do you plan to use Fluent Bit (use case) ?
naveennadhv commented 7 years ago

my fluent-bit_git.bb file

`SUMMARY = "Data Collector tool for Embedded Linux"
DESCRIPTION = "Fluent Bit is a data collector tool for Embedded Linux, \
it support different kind of inputs and built-in metrics.              \
"

HOMEPAGE = "http://fluentbit.io"
BUGTRACKER = "https://github.com/fluent/fluent-bit/issues"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
SECTION = "net"

SRC_URI = "git://github.com/fluent/fluent-bit.git"

PR = "r0"
PV = "0.1.0"

S = "${WORKDIR}/git"
SRCREV = "master"
EXTRA_OECMAKE = "-DFLB_XBEE=1"

inherit cmake`

Use Case: Log Aggregation towards fluentD

edsiper commented 7 years ago

are you using XBEE input plugin ?

naveennadhv commented 7 years ago

TCP/Stdin Will be our input plug-in and Forward will be our output plugin,

edsiper commented 7 years ago

Since I cannot test Yocto/Poky stuff at the moment, let's take a workaround:

please rebuild with: cmake -DFLB_REGEX=Off ...

naveennadhv commented 7 years ago

thanks @edsiper for the quick response, I will try as per your suggestion

naveennadhv commented 7 years ago

@edsiper It's done' now its made the build without those errors. all is fine except some warnings from bitbake( I think which can be neglected ). Thanks!

edsiper commented 7 years ago

awesome.

just one more question, which specific compiler/toolchain you were using ?

naveennadhv commented 7 years ago

My version of gcc recipes are as follows(result of bitbake -s)

gcc                                    :linaro-5.2-r2015.11-2                          
gcc-cross-arm                          :linaro-5.2-r2015.11-2                          
gcc-cross-canadian-arm                 :linaro-5.2-r2015.11-2                          
gcc-cross-initial-arm                  :linaro-5.2-r2015.11-2                          
gcc-crosssdk-initial-x86_64            :linaro-5.2-r2015.11-2                          
gcc-crosssdk-x86_64                    :linaro-5.2-r2015.11-2                          
gcc-runtime                            :linaro-5.2-r2015.11-2                          
gcc-sanitizers                         :linaro-5.2-r2015.11-2      

My believe is it can be, https://releases.linaro.org/components/toolchain/binaries/5.2-2015.11-2/arm-linux-gnueabihf/

edsiper commented 7 years ago

thanks, If I remember correctly I saw a similar problem with an old toolchain.

Closing this issue for now.

dmamalis commented 5 years ago

Sorry for bumping a closed Issue but I am facing a quite similar problem while trying to cross compile for Yocto. The first part was successfully bypassed with @edsiper workaround but then I got stuck with something similar

[  3%] No patch step for 'backtrace'
[  3%] No update step for 'backtrace'
[  4%] Performing configure step for 'backtrace'
configure: loading site script /opt/mlinux/4.0.1/site-config-arm926ejste-mlinux-linux-gnueabi
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for gcc... arm-mlinux-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork -mtune=arm926ej-s --sysroot=/opt/mlinux/4.0.1/sysroots/arm926ejste-mlinux-linux-gnueabi
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: in `/home/testuser/fluent-bit/build/backtrace-prefix/src/backtrace-build':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
CMakeFiles/backtrace.dir/build.make:105: recipe for target 'backtrace-prefix/src/backtrace-stamp/backtrace-configure' failed
make[2]: *** [backtrace-prefix/src/backtrace-stamp/backtrace-configure] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/backtrace.dir/all' failed
make[1]: *** [CMakeFiles/backtrace.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Although the environment is set to use the correct toolchain, the make system seems to be using x86_64

checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu

Is this a cmake/make issue or couldit be a configuration setting I've missed?