joshdoe / gst-plugins-vision

GStreamer plugins related to the field of machine vision
Other
134 stars 50 forks source link

Pylonsrc for arm64 ubuntu 18.04 with pylon version 6 or version 5 displays libpylonc-6.2.0.so: cannot open shared object file: No such file or director #58

Open ILENIMARIUS opened 3 years ago

ILENIMARIUS commented 3 years ago

Hello, When compiling and running pylonsrc with arm64 ubuntu 18.04 on both pylon version 6 or pylon version 5 I got: Error -> Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstpylon.so': libpylonc-6.2.0.so: cannot open shared object file: No such file or directory

Please see below the steps used: _Pylon + gst-plugins-vision build/compilation steps:

  1. install latest Pylon6 version:

    Download

    • pylon 6.2.0 Camera Software Suite Linux ARM 64 bit - Debian Installer Package 6.2.0 .deb, 69 MB pylon Software

    install on linux arm64:

    • sudo apt-get install ./pylon_6.2.0.21487-deb0_arm64.deb
  2. download and build the new gst-plugins-vision: git clone https://github.com/joshdoe/gst-plugins-vision.git

  3. adapt the modules .make to match the latest pylon version of folder naming:

    • cd ~/Downloads/gst-plugins-vision-1.17.1/cmake/modules

    • sudo nano FindPylon.cmake else () set (_PYLON_DIR "/opt/pylon5") -> modify this to "/opt/pylon" endif ()

    &

    find_library (_PylonCLib NAMES PylonC_MD_VC120 pylonc PATHS "${PYLON_DIR}/Development/lib/x64" "${PYLON_DIR}/lib64") modify this to -> "/lib"

  4. modify the sistem location where gst-pylon-plugin should be installed:

    • cd ~/Downloads/gst-plugins-vision-1.17.1
    • sudo nano CMakeLists.txt
    • go to line 131 else () set(_PREFIX "/usr/lib") modify to -> "/usr/lib/aarch64-linux-gnu" endif ()
  5. build gst-plugins-vision cd gst-plugins-vision mkdir build cd build cmake .. make

    sudo make install

Result:

(gst-inspect-1.0:27087): GStreamer-WARNING **: 17:51:15.211: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstpylon.so': libpylonc-6.2.0.so: cannot open shared object file: No such file or directory Could not load plugin file: Opening module failed: libpylonc-6.2.0.so: cannot open shared object file: No such file or directory pes@pes-desktop:~/Downloads/gst-plugins-vision-1.17.1/build$

This plugin displays the same error for Pylon5 also._

thortom commented 3 years ago

I encountered the same issue when loading the installed (make install) pylonsrc.

I am now using pylonsrc with pylon version 6 with similar modifications as you ILENIMARIUS and I am able to use the pylonsrc by loading the pylonsrc from my build directory by setting export GST_PLUGIN_PATH=/<MY_PATH>/gst-plugins-vision/build

ILENIMARIUS commented 3 years ago

Hello Thor, Thank you for your answer. There is only one mention for a gstreamer similar plugin path in /gst-plugins-vision/CMakeLists.txt at line 129 for windows version: _get_filename_component(_PREFIX "${GSTREAMER_PLUGIN_DIR}/../" REALPATH) else ()
set(PREFIX "/usr/lib") endif ()

Additional I haven't found a system env variable called "GST_PLUGIN_PATH" .

Could you be more specific for instance, are you using from gst-plugins-vision -> libgstpylon (as plugin) with pylon6? or old pylonsrc plugin from zingmars repo with pylon6?

Could you be more specific with the steps and versions? Thank you!

thortom commented 3 years ago

I am using the GStreamer GST_PLUGIN_PATH env variable to load the libgstpylon plugin from the build directory, see more information here https://developer.gnome.org/gstreamer/stable/gst-running.html You can also try different GStreamer plugin directories by running: gst-launch-1.0 -e --gst-plugin-path=<PathToGstPluginVisionBuildDir> pylonsrc ! bayer2rgb ! videoconvert ! xvimagesink

This is just a work around. Of course we would want the installed plugin to work which is installed with the make install command.

mrstecklo commented 3 years ago

@ILENIMARIUS, in order to make libpylonc visible add /opt/pylon/lib to LD_LIBRARY_PATH. Or use the solution described here https://github.com/joshdoe/gst-plugins-vision/issues/55. Your step 3 can be turned into pull request as CMake's find_library can resolve different paths. Step 4 is wrong, you should use cmake -DCMAKE_INSTALL_PREFIX=/usr/lib/aarch64-linux-gnu .. in step 5 instead. GST_PLUGIN_PATH is not needed in this case. libgstpylon is visible, as it is in a standard location, but libpylonc is not. That is why you should use LD_LIBRARY_PATH

thortom commented 3 years ago

I can confirm that adding /opt/pylon/lib to LD_LIBRARY_PATH works, thanks @mrstecklo