I'm using yocto 3.1(dunfell) to create a recipe called (eeel) which depends on hdf5.
In my recipe, hdf5
is listed in DEPENDS
:
DEPENDS += " zlib protobuf protobuf-native curl asio tclap hdf5"
When I bitbake eeel
(my recipe), I got this error:
| CMake Error at /home/concc/yocto-tegra/build/tmp/work/aarch64-poky-linux/eeel/5.8-r0/recipe-sysroot/usr/share/cmake/hdf5/hdf5-targets.cmake:219 (message):
| The imported target "hdf5::h5diff" references the file
|
| "/home/concc/yocto-tegra/build/tmp/work/aarch64-poky-linux/eeel/5.8-r0/recipe-sysroot/usr/bin/h5diff"
|
| but this file does not exist. Possible reasons include:
|
| * The file was deleted, renamed, or moved to another location.
|
| * An install or uninstall procedure did not complete successfully.
|
| * The installation package was faulty and contained
|
| "/home/concc/yocto-tegra/build/tmp/work/aarch64-poky-linux/eeel/5.8-r0/recipe-sysroot/usr/share/cmake/hdf5/hdf5-targets.cmake"
|
| but not all the files it references.
|
| Call Stack (most recent call first):
| /home/concc/yocto-tegra/build/tmp/work/aarch64-poky-linux/eeel/5.8-r0/recipe-sysroot/usr/share/cmake/hdf5/hdf5-config.cmake:127 (include)
| CMakeLists.txt:12 (find_package)
|
|
| -- Configuring incomplete, errors occurred!
it seems that build/tmp/work/aarch64-poky-linux/eeel/5.8-r0/recipe-sysroot/usr/bin/h5diff
is expected. I checked the folder, h5diff
is not there. So I guess the error message is correct.
Then I checked build/tmp/work/aarch64-poky-linux/eeel/5.8-r0/recipe-sysroot/usr/lib
, libhdf5.a and libhdf5.so and other libhdf5* files are there, which is a sign of success build of hdf5?
I also checked build/tmp/work/aarch64-poky-linux/hdf5/1.8.21-r0/image/usr/bin
, which is the output of hdf5, h5diff
is there. so h5diff is generated.
So here is my conclusion:
hdf5 is successfully compiled, installed, its lib files are copied to my recipe's recipe-sysroot/usr/lib
, but its executables are not copied to my recipe-sysroot/usr/bin
.
I's not sure if it's a bug of hdf5's recipe file (http://layers.openembedded.org/layerindex/recipe/123207/), or I missed something in my eeel's .bb file.
Anyway to copy the h5diff
files into my recipe-sysroot/usr/bin
?
Is it related to do_prepare_recipe_sysroot
(https://docs.yoctoproject.org/singleindex.html#ref-tasks-prepare-recipe-sysroot)?
Thanks
Binaries to be run on target are not part of the sysroot because the sysroot is only for build time dependencies and target binaries cannot be used at build time. SYSROOT_DIRS
specifies which files/directories are installed in a sysroot (c.f. https://docs.yoctoproject.org/ref-manual/variables.html#term-SYSROOT_DIRS).
If hdf5
is supposed to be executed at build time, you'll need to DEPENDS
on hdf5-native
so that the binary built for the host architecture can be run at build time. SYSROOT_DIRS_NATIVE
specifies which files/directories are installed in a sysroot-native (compiled for the host architecture; c.f. https://docs.yoctoproject.org/ref-manual/variables.html#term-SYSROOT_DIRS_NATIVE). If you need to link against hdf5
or need its binary at runtime too, you'll have both hdf5-native
and hdf5
in DEPENDS
.