[libcamera-devel] [PATCH 0/5] Support loading IPAs from the build tree

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Feb 6 21:39:41 CET 2020


Hi Nicolas,

On Wed, Feb 05, 2020 at 01:49:11PM -0500, Nicolas Dufresne wrote:
> Le mercredi 05 février 2020 à 14:12 +0000, Kieran Bingham a écrit :
> > On 05/02/2020 14:03, Nicolas Dufresne wrote:
> >> Le mer. 5 févr. 2020 08 h 04, Kieran Bingham a écrit :
> >>>
> >>> When developing and testing libcamera, the usual development model is to
> >>> compile and run one of the test or utility applications.
> >> 
> >> I like it. Be aware that it won't work for me. It only work if the build
> >> path matches run path, which isn't the case when cross compiling and
> >> exporting over NFS. Any suggestion ?
> > 
> > Interesting (and painful) point.
> > 
> > Ideally it would be a relative path, but the binary path
> >  (/proc/self/exe) doesn't always have to stay relative to the library
> > path ...
> > 
> > I wonder if I can get the library path at runtime... Time to dig into
> > what else is in the _DYNAMIC table perhaps.
> > 
> > Otherwise, I'm certainly open to suggestions from the list here ;-)
> 
> Note that meanwhile I can just set the env really, I'm a bit use to that anyway.
> GStreamer, GLib and Mesa (which are the kind of stuff I cross compile) all
> requires few envs already.

How about installing libcamera instead of copying binaries ? :-) You can
set the prefix to the path on your target system, and install to your
NFS directory by setting the DESTDIR variable for meson install.

> >>> IPA modules are loaded by the IPAManager, from a system path, or by
> >>> parsing an environment variable.
> >>>
> >>> Provide the build path to the library through a temporary storage in the
> >>> runpath of the ELF library strings table.  This entry is stripped at
> >>> install time, but allows us to identify the location of the recently
> >>> compiled IPA modules without the user having to manually declare paths to the
> >>> build system.
> >>>
> >>> Previously to this series the IPA tests would only be able to be run
> >>> from the root of the build tree, due to the hardcoded path relative to that
> >>> point. Now that the IPAs can be found from their build location, we no longer
> >>> need to provide this hardcoded path through the LIBCAMERA_IPA_MODULE_PATH
> >>> for tests, and as a further consequence they can be run directly without
> >>> requiring the launch to be run from the top level of the build tree.
> >>>
> >>> Kieran Bingham (5):
> >>>   libcamera: utils: Provide helper to get dynamic library runpath
> >>>   libcamera: ipa_manager: Split path handling
> >>>   libcamera: ipa_manager: Allow recursive parsing
> >>>   libcamera: ipa_manager: Search the runpath for IPA libraries
> >>>   tests: Remove IPA_MODULE_PATH environment variable
> >>>
> >>>  src/libcamera/include/ipa_manager.h |   5 +-
> >>>  src/libcamera/include/utils.h       |   1 +
> >>>  src/libcamera/ipa_manager.cpp       | 111 ++++++++++++++++++++++------
> >>>  src/libcamera/meson.build           |   1 +
> >>>  src/libcamera/utils.cpp             |  26 +++++++
> >>>  src/meson.build                     |   7 ++
> >>>  test/libtest/test.cpp               |   4 -
> >>>  7 files changed, 126 insertions(+), 29 deletions(-)

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list