« Back to Technical Questions

Shared library dependency

Combination View Flat View Tree View
Hi All,
 
I encountered some problem when running application file on AXP. It showed that some library linking missing.
I attached my application in zip format. 
 
I am developing the application under Ubuntu 10.04 LTS. I have no issue in installing and running HelloWorld sample application.
My package contains 2 independent sample application replicated from AXP Developer Guide; app_cmd (run "show run") and app_eem (run EEM manager).
The structure of package is as following:
* build 
  - app_cmd: example.cc, Makefile, run_example
  - app_eem: example.cc, Makefile, run_example
  - bin: post-install.sh
  - lib: all library from axp-1.6.1 sdk
* package
* PackagingParameters.txt
 
With above information, I can build, install package on AXP. 
 
Question 1:
I try to run application (axp> app_cmd/run_example) on AXP, it failed and returned error: "error while loading shared libraries: libiosapi.so.1: cannot open shared object file: No such file or directory". What else do I miss out to include ?
 
I used ldd command on development machine, it shows:

linux-gate.so.1 =>  (0x00d64000)
libappreapi.so.1 => not found
libaxpsystemapi.so.1 => not found
libeventapi.so.1 => not found
libiosapi.so.1 => not found
liblocal_socket.so.1 => not found
libutilserviceapi.so => not found
libxerces-c.so => /usr/lib/libxerces-c.so (0x00110000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x004c5000)
libcli_distribution_vm.so.1 => not found
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x004c9000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x005bf000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00d43000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x005e5000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x0073f000)
libicuuc.so.42 => /usr/lib/libicuuc.so.42 (0x0085b000)
libicudata.so.42 => /usr/lib/libicudata.so.42 (0xb686c000)
/lib/ld-linux.so.2 (0x0083e000)


Hence, I created soft links for AXP SDK libraries on AXP. 
/usr/lib > ln -s /lib/lib<xxx>.so lib<xxx>.so.1
This does not print any error when running application.


Question 2: 
Must I create soft links to AXP SDK libraries on AXP ?


Regards,
Zoebir Bong



 
Attachments:

Hi Zoebir Bong,
 
The following UUID's must be specified during packaging of the application as a dependencies.
 
# iosapi: 8cec8ee5-54c3-4667-b62e-d4a31805d44a,all
# eventapi: 545c3671-c4bc-43b8-bce4-690123ab9d4d,all
 
Thanks,
Raghavendra

RE: Shared library dependency
Answer
6/7/11 4:35 AM as a reply to Raghavendra Gutty Veeranagappa.
Hi Raghavendra,

May I know where to specifiy the dependencies ?

Also, do I have to include dependencies for apprepapi and other libraries ?

Regards,
Zoebir

Hi Zoebir,

To be dependent on iosapi and eventapi, use the following line in PackagingParameters.txt file or in package command.
deps=8cec8ee5-54c3-4667-b62e-d4a31805d44a,all:545c3671-c4bc-43b8-bce4-690123ab9d4d,all

/axp-sdk.1.5.2/tools/pkg_build.sh --project-dir '/apps/system_check_app/package' --auth-bundle '/certs/auth_bundle.sig' --private-key '/certs/private.key' --name 'system_check' --version '1.0' --description 'system check calls!' --uuid '96f47128-fb8a-4444-a7ef-3401b4e79b95' --source-dir '/system_check_app/build' --deps 'deps=8cec8ee5-54c3-4667-b62e-d4a31805d44a,all:545c3671-c4bc-43b8-bce4-690123ab9d4d,all' --disk-limit '100M' --memory-limit '128M' --cpu-limit '1100' --disk-wildcard --memory-wildcard --postinstall 'bin/post-install.sh'

you don't need to include dependencies for apprepapi, you can refer "Cisco AXP Optional Features" section in developer guide for more information

Thanks,
Raghavendra

RE: Shared library dependency
Answer
6/9/11 7:55 AM as a reply to Raghavendra Gutty Veeranagappa.
Hi Zoebir,

In the Packaging script use dependencies --deps '8cec8ee5-54c3-4667-b62e-d4a31805d44a,all: 545c3671-c4bc-43b8-bce4-690123ab9d4d,all'

instead of --deps 'deps=8cec8ee5-54c3-4667-b62e-d4a31805d44a,all:545c3671-c4bc-43b8-bce4-690123ab9d4d,all'


Thanks,
Raghavendra