FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
08-09-2023 07:10 AM
As we can see,in the packaged snap file,there are library files i need
but when i downloaded it into the physical core,the log file told me that it could not fing the lib files☹️
Hope to get some advice
thanks in advance
Good luck!
Solved! Go to Solution.
08-10-2023 08:29 AM
Hi @always
I'm certainly no python expert and this is something which goes beyond our SDK functionality. But I think the problem is that you are not able to cross-build the OpenCV libraries. That's why you probably need a arm64 device (not the ctrlX CORE) to build it.
I searched a little bit through the web and found this example of someone using OpenCV inside a snap. Maybe this can be usefull for you. But anyway cross-building will likely not work either. You will need to build it on an arm64 device if you want a snap for arm64 architecture.
Best regards,
Nick
08-10-2023 09:43 AM
Hello @nickH ,
Thanks for the answer.
Not quite the same as a project in a python environment
My whole project is in C++, so in my understanding I can cross compile via cmake in a virtual environment to get the library files I need for the arm framework, can I do that?
Best regards,
Yao
08-10-2023 09:54 AM
Hi @always
ok, then I misunderstood your question - sorry. But this question you should probably ask to OpenCV. But I quickly searched for you in the web and found this section in the OpenCV documentation: Cross compilation for ARM based Linux systems.
08-10-2023 10:09 AM
Hi @nickH
The opencv and pylon libraries for the ARM aarch64 framework required by the physical core have been cross-compiled in the virtual environment
As we can see,in the packaged snap file,there are library files i need
but when i downloaded it into the physical core,the log file told me that it could not fing the lib files
To be clear, my problem should be that the library file I need exists in the snap package, but is not accessible when I run it in core
Best regards,
Yao
08-10-2023 10:11 AM
So my question can also be interpreted as where should I store the required library files in order for CORE to access them from the snap file
08-10-2023 11:21 AM
You have to pack all your dependencies inside your snap. I would say, you allready did this, thats why you can see them in the unzip .snap file. When you install the snap on your ctrlX CORE everything inside of your snap will be availble at $SNAP. The directory where the snap is mounted. This is where all the files in your snap are visible in the filesystem (e.g. /snap/sdk-cpp-helloworld/current/). See also this documentation from snapcraft: https://snapcraft.io/docs/environment-variables#heading--snap
You can see from the other cpp-samples in the SDK, that we are using the stage-package mechanism from snapcraft to pack our dependencies into our snap. Here for example the Data Layer client:
If you do it with stage packages it looks like this (screenshot from the unziped sdk-cpp-client-arm.snap):
I think you should probably try it the same way.
Best regards,
Nick