简体   繁体   中英

Building OpenDDS with bitbake

I need to build OpenDDS-3.13.1 with bitbake for my Yocto project. Target is for now only QEMU.

However, I downloaded the sources (they configure, compile and link on the host system quite well) and linked them into my recipe. Inheriting "autoconf" causes an error in the configuration step, it can somehow not expand the default arguments (which is already odd).

After some searching I found a pretty old discussion about this topic: https://lists.yoctoproject.org/pipermail/yocto/2011-July/002126.html

My recipe currently looks as follows:

FILESEXTRAPATHS_prepend := "[PATH_TO_SOURCE]:"

PV = "3.13.1"

SRC_URI = "file://${PN}-${PV}.tar.gz"

S = "${WORKDIR}/${PN}-${PV}"
B = "${S}"

do_configure() {
    ./configure
}

do_compile() {
    make
}

At the moment the configuration step runs successfully, but compiling fails as it cannot find header files. As mentioned in the mailing list post above, I tried to add the CXXFLAGS to the configuration step. This will step over the first missing include ("features") but stops at the next one ("sting"). Both headers are available in ${S} and ${B} respectivly, therefor are also part of ${STAGING_DIR_HOST}.

What am I missing here? I actually expected all step are implicitly covered by inheriting autotools.

Edit:

as requested here is the log output:

DEBUG: Executing shell function do_compile
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ace'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ace/GNUmakefile.ACE MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ace'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ACEXML/common'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ACEXML/common/GNUmakefile.ACEXML MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ACEXML/common'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ACEXML/parser/parser'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ACEXML/parser/parser/GNUmakefile.ACEXML_Parser MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/ACEXML/parser/parser'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_FE MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE_VIS_A MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE_VIS_C MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE_VIS_E MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE_VIS_I MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE_VIS_O MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE_VIS_S MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE_VIS_U MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_BE_VIS_V MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/apps/gperf/src'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/apps/gperf/src/GNUmakefile.gperf MAKEFLAGS=w

make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/apps/gperf/src'
make[1]: Entering directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'

GNUmakefile: /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL/GNUmakefile.TAO_IDL_EXE MAKEFLAGS=w

x86_64-poky-linux-g++  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/recipe-sysroot -fvisibility=hidden -fvisibility-inlines-hidden -Wnon-virtual-dtor -ggdb -pthread -fno-strict-aliasing -Wall -W -Wpointer-arith -pipe  -D_GNU_SOURCE   -I/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers -D__ACE_INLINE__ -I../.. -I../TAO_IDL/fe -I../TAO_IDL/include -I.. -Iinclude -Ibe_include -Ife -I.. -DTAO_IDL_PREPROCESSOR=\"x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/recipe-sysroot\"  -c -o .obj/driver/drv_args.o driver/drv_args.cpp
<command-line>:0:22: warning: missing terminating " character
driver/drv_args.cpp:69:10: fatal error: string: No such file or directory
 #include <string>
          ^~~~~~~~
compilation terminated.
/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/include/makeinclude/rules.local.GNU:134: recipe for target '.obj/driver/drv_args.o' failed
make[1]: *** [.obj/driver/drv_args.o] Error 1
make[1]: Leaving directory '/media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/OpenDDS-3.13.1/ACE_wrappers/TAO/TAO_IDL'
GNUmakefile.dist:568: recipe for target 'TAO_IDL_EXE' failed
make: *** [TAO_IDL_EXE] Error 2
WARNING: exit code 2 from a shell command.
ERROR: Function failed: do_compile (log file is located at /media/work/10_Projects/Yocto/blub/build/tmp/work/core2-64-poky-linux/OpenDDS/3.13.1-r0/temp/log.do_compile.15963)

For openDDS the usual cross-compiling approach does not work out of the box. Here you need to run the compile process on and within your host machines context and reference your cross compiler which will than be used by the build system of openDDS.

Here is how to get it run:

The configure script from the openDDS sources does not accept additional arguments to the cross-compilers which are needed by bitbake. Therefore I wrapped them into scripts which replace the final calls to the CC, CXX, LD and AR:

Create a new task after do_unpack doing the following

  • extract the binary names from the variables (CC, CXX and AR) and create a local script with the same name
  • insert shebang into the just created wrapper script
  • append the whole value of the variable (here $CC) into the wrapper script
  • make wrapper executable
cc_wrapper=`echo ${CC} | cut -f 1 -d\\ ` echo '#!/bin/sh' > ${S}/${cc_wrapper} echo "${CC} \\"\\$@\\"" >> ${S}/${cc_wrapper} chmod +x ${S}/${cc_wrapper}
  • do the same for CXX and AR

Override the configure step

  • extract the full path to the target cross compiler
target_compiler="${S}/`echo ${CXX} | cut -f 1 -d\\ `"
  • and replace CC variable which points to the bitbake cross-compiler with the host native ones:
 export CC=$BUILD_CC
  • do the same for CXX and AR too
  • do the final call to the configure script with the expected cross compile options
./configure --target=linux-cross --target-compiler=$target_compiler

(Note the reference to $target_compiler set above)

Override the compile step

  • export again CC, CXX, AR and in addition LD to point to the hosts native instances
export CC=$BUILD_CC
  • finally just call make within the compile step, that should make it happen!

I actually expected all step are implicitly covered by inheriting autotools.

But you don't inherit autotools . Anyway that won't help because OpenDDS doesn't use autotools.

First some cleanup: FILESEXTRAPATH should be removed, call the recipe name_version.bb and you can remove PV , those S and B values are the defaults. Your do_compile is basically doing the same as the default. SRC_URI should be https://github.com/objectcomputing/OpenDDS/releases/download/DDS-3.13.1/OpenDDS-3.13.1.tar.gz surely.

The important thing is what is the output of the do_configure task. OpenDDS has a hand-coded and one-off configure which you'll need to carefully call. From glancing at the script, it looks like passing --target is a good start.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM