Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

library file cannot be found on core(opencv, pylon)

library file cannot be found on core(opencv, pylon)

always
New Poster
  • The packaged snap file is downloaded to the physical ctrlX X2 core, but the log file shows that the corresponding libraries are not found.
    • It is possible to run amd64 framework opencv in the virtual environment for image processing, but using the physical core should need to use the ARM framework libraries.
    • The opencv and pylon libraries for the ARM aarch64 framework required by the physical core have been cross-compiled in the virtual environment linked by ssh.

always_1-1691557040554.png

always_2-1691557059269.png

As we can see,in the packaged snap file,there are library files i need

always_0-1691554531390.png

but when i downloaded it into the physical core,the log file told me that it could not fing the lib files☹️

always_1-1691557498471.png

Hope to get some advice 
thanks in advance

Good luck!

6 REPLIES 6

nickH
Community Moderator
Community Moderator

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 

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

nickH
Community Moderator
Community Moderator

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.

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 

always_0-1691654640802.png

always_1-1691654640995.png

As we can see,in the packaged snap file,there are library files i need

always_2-1691654640913.png

but when i downloaded it into the physical core,the log file told me that it could not fing the lib files

always_4-1691654640808.png

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

 



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

nickH
Community Moderator
Community Moderator

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: 
stage-packages in the snapcraft.yamlstage-packages in the snapcraft.yaml

 

If you do it with stage packages it looks like this (screenshot from the unziped sdk-cpp-client-arm.snap):
2023-08-10_11h14_47.png

 

I think you should probably try it the same way. 

Best regards, 

Nick

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist