SNAP how to use dynamic linker ldconfig or LD_LIBRARY_PATH

Good Morning,

i have a applikation /binary which i want to pack to a SNAP. I setup a Linux VM on my PC (amd64).

to execute my app directly i have to setup the dynamic-runtime linker in order to copy my own config file with lib pathes to

cp myConfigFileWithPathes.conf /etc/ld.so.conf.d/
ldconfig

after thas.  i can create a SNAP on my VM target ,  and i can this snap...

So my question:

But how can i do this for a SNAP on a xCtrl Hardware? How can i setup my snapcraft, that the dynamic linker pathes will autmatice setup according to the target!?  I read about the $LD_CONFIG_PATH

I tried so something like that in my app in the snap yaml (but it does not work)

environment:
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:my_pathes_from_the_config_file
 
But wenn i build the snap i still get the followed warnings: (but this libs normal resolve from the dynamic link in the conf file)
 
This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft:
- home/xctrlvm/AppEngine/drivers/halcon/libhalcon.so.20.11.1
- home/xctrlvm/AppEngine/drivers/halcon/libhalconc.so.20.11.1
- home/xctrlvm/AppEngine/drivers/halcon/libhalconcpp.so.20.11.1
- home/xctrlvm/AppEngine/drivers/halcon/libhdevenginecpp.so.20.11.1
- home/xctrlvm/AppEngine/libeuler_log_frontend.so.1
- home/xctrlvm/AppEngine/libeuler_plugin_loader.so.1
Best reply by JohannesA

Hi 

maybe you are looking for "stage-packages" ? 

 

If you have to add own libraries you can dump it into the snap using the dump plugin.

$SNAP/lib:$SNAP/usr/lib:$SNAP/usr/lib/x86_64-linux-gnu (on amd64 architecture) are default part of the LD_LIBRARY_PATH

If you add your library to another directory within your snap you have to extend the environment variable e.g.:

apps:
example-app:
 [...]
 environment:
    LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/<example-directory>

 

Regards

Johannes

View original
4 replies