Skip to content

Conversation

@alexo-w
Copy link
Contributor

@alexo-w alexo-w commented May 7, 2025

First version including:

  • ACAP Code
  • Documentation
  • Open source information

Change-Id: Ia86659a120fcb728dfb1c373495ca24162416242

Describe your changes

Please include a summary of the change, a relevant motivation and context.

Issue ticket number and link

  • Fixes #(issue)

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have verified that the code builds perfectly fine on my local system
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have verified that my code follows the style already available in the repository
  • I have made corresponding changes to the documentation

alexo-w and others added 10 commits June 19, 2025 14:08
First version including:
* ACAP Code
* Documentation
* Open source information

Change-Id: Ia86659a120fcb728dfb1c373495ca24162416242
Check if the UID/GID already exist before attempting to add them to the
Docker image. Reuse their associated names in case they already exist.

Change-Id: Ie1f4aa22dd47e33f9cdfdd8865912c3eba02c349
Change-Id: I42c325178626b1775b766d7397d3d1bb899e0932
Change-Id: I3f5c729aef58cf3167ea5c4a33aba63c5e0316c2
Change-Id: I6b4f79f27098d8d5f4f17c2eeb75974b20def52e
Change-Id: I19bff150c3de803ffe12b15ca71066d3f9ed070a
Change-Id: I917e8504c72700f8ec3a3dc9058e27ba22dd8e2c
Change-Id: Ibc08dfccb2e725ff4c8992dad074fdb41b2d3063
alexo-w and others added 3 commits June 19, 2025 14:50
Change-Id: I8e4ecdd14cd0f23a0953ef13bb464a0360d655ae
Change-Id: I68edcb41f8bb51a838e250153631911547656ef5
Change-Id: I8e7aff33d29d96aff6fb466b6b7a005ad6891cb7

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the documentation there is this guide for how to install third party libraries: https://developer.axis.com/acap/develop/include-third-party-libraries/, where it is recommended to install into the opt/build directory and then move the files to opt/app/lib. Then in the Makefile you have to provide:

LDLIBS += -Llib/
CFLAGS += -Ilib/include
SHLIB_DIR = ./lib
LDFLAGS = -L$(SHLIB_DIR) -Wl,--no-as-needed,-rpath,'$$ORIGIN/lib'
SHLIBS += -lm -l[lib](linking-third-party-lib)

I am not set on that the documentation shows the "best" way, so I'm interested to learn how you install third party libraries here, and why you don't need to specify a .e.g., rpath in your Makefile?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We kind of "inherited" the example(s) provided by Core Tech Systems (including their Dockerfile) and we just went with it. In this case we use static linking to link with libopen62541.a.

* Docker - remove dobule ARG ARCH=aarch64
* README - rename section header

Change-Id: I9b247ce64f752f7414cfa902a5b6d6058798d145
CFLAGS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags $(PKGS))
LDLIBS += $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs $(PKGS))

LIB_OPEN62541 = $(SDKTARGETSYSROOT)/usr/lib/libopen62541.a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this lib already installed in the firmware on the devices listed as supported below? I cannot find it on my device and no installation of it in these makefiles either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Open62541 lib is built and installed in the dockerfile, so when building the application.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its line 94-104 in the dockerfile? Have you considered to bundle the lib with the ACAP instead? Here's an example of this: https://github.com/AxisCommunications/acap-native-sdk-examples-staging/tree/main/utility-libraries/custom_lib_example/app/custom_build

That way the library are automatically uninstalled with the ACAP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, lines 94-104 are correct. As mentioned previously in the conversation above, we went with the example provided by Core Tech Systems and haven't considered changing it since it's working. If you think it's necessary, we could of course change it.

Copy link
Contributor

@sola-ax sola-ax Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That way the library are automatically uninstalled with the ACAP

We build open62541 as a static library and link with it. It's only our ACAP that uses this library. Uninstalling the ACAP will not leave any library hanging behind on the Axis device.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we ask this question, how is the lib supposed to be removed when the ACAP is uninstalled?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then I'm fine with it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it it's still unclear but the open62541 library is built inside the development container, it will never make it as a separate library onto the Axis device. We use static linking so it will be part of the binary executable - the ACAP application itself.

status = UA_Server_run(ctx->server, &ctx->ua_server_running);

LOG_D(&ctx->logger, "UA Server exit status: %s", UA_StatusCode_name(status));
UA_Server_delete(ctx->server);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the implementation of this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which function you're referring to but both of these functions are from the open62541-lib.

sola-ax and others added 4 commits June 27, 2025 14:06
Change-Id: I8ce2dfd95db4b79ef7d3c9252dc591b972c26b70
Change-Id: I42193fec0561992e265cd7d8530863f2242fb7db
Change-Id: Ia897b0b7e928a09705e4dd294c223e31fbfe7efe
Change-Id: I8b3fc584b3af41ddb1df19f383abdfb87a1c1504
@sola-ax sola-ax merged commit 627e3ab into main Oct 24, 2025
17 checks passed
@sola-ax sola-ax deleted the first_review branch October 24, 2025 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants