OpenVINO - Inference library plugin libMKLDNNPlugin.so cannot resolve dependency - c++

I am experimenting with OpenVINO APIs and below is the sample code snippet:
plugin = InferenceEngine::PluginDispatcher(<params>).getPluginByDevice("CPU");
However, I get the below error:
Cannot find plugin to use :Tried load plugin : MKLDNNPlugin, error: Plugin MKLDNNPlugin cannot be loaded: cannot load plugin: MKLDNNPlugin from /opt/intel/openvino_2019.3.376/inference_engine/lib/intel64: Cannot load library '/opt/intel/openvino_2019.3.376/inference_engine/lib/intel64/libMKLDNNPlugin.so': libmkl_tiny_tbb.so: cannot open shared object file: No such file or directory
I looked for the above missing library and it actually exists:
$ ls /opt/intel/openvino_2019.3.376/inference_engine/external/mkltiny_lnx/lib/
libmkl_tiny_tbb.so
It looks like some internal dependency is not resolved by inference engine lib/plugin. Could anyone help figure out why it doesn't work?

Add/Update this path
/opt/intel/openvino_2019.3.376/inference_engine/external/mkltiny_lnx/lib/
libmkl_tiny_tbb.so
into
LD_LIBRARY_PATH

Run a script setupvars.sh before you run your program. The script resolves all dependencies needed for running OpenVINO applications.
The script located in <openvino-install-dir>/bin/setupvars.sh

Related

Error while loading shared object file: No such file or directory

I am trying to generate a usable binary for GCBM, a C++ carbon accounting tool. The binary has been generated from a GitHub Action workflow which is available as an artifact here: https://nightly.link/HarshCasper/moja.canada/actions/runs/1999997115/GCBM.zip
I downloaded the ZIP, unzipped it inside a gcbm directory, cd inside it, and tried launching the binary through:
./moja.cli
I got the following error:
./moja.cli: error while loading shared libraries: libmoja.flint.so.1: cannot open shared object file: No such file or directory
I have tried various ways to fix it by following other StackOverflow threads but nothing really has worked out. Can anyone please help me solve it?
From the error, it's clear library path that the executable looking for is not present. It happens sometimes if the executable compiled on another system takes a hardcoded library path that is not present on your system. The solution is you have to compile source on your system. Better compile it with a STATIC library. Make changes to Cmake(https://github.com/HarshCasper/moja.canada/blob/bffb196222e118e6797afa2bedab02dbe29dd330/Source/CMakeLists.txt#L47). or copy shared library to proper path.
Example, how to run GCBM/moja.cli with the ~40 internal shared libraries
mkdir GCBM && cd GCBM/
unzip GCBM.zip
chmod +x moja.cli
## create a script moja.sh to run moja.cli :
#!/bin/sh
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
exec ./moja.cli
## make the script executable and run ./moja.sh

libgsl.so.25: cannot open shared object file: No such file or directory Google Colab project

I'm using Google Colab to compile and run some code in CUDA and C++ (mostly because I dont have a CUDA capable GPU). For reference, the project Im trying to replicate is here:
https://github.com/franrruiz/shopper-src
For the project I need to install and configure the GSL Library, which I have done by following these steps:
Download GSL library from ftp://ftp.gnu.org/gnu/gsl/
Upload zipped file into Colab
Run the following code in Colab
# Unzip and change directory
!unzip "gsl-2.6.zip"
%cd "/content/gsl-2.6"
# Gives permissions
!chmod 755 "/content/gsl-2.6/configure"
# Configure
!./configure
!make
!make check
!make install
Compiling the code works perfectly fine, but when I attempt to run the code on a workable dataset I get the following error:
/content/shopper: error while loading shared libraries:
libgsl.so.25: cannot open shared object file: No such file or directory
What I've already Tried
!export LD_LIBRARY_PATH="/contents/gsl-2.6/.libs"
and
!export LD_LIBRARY_PATH="/usr/local/lib/"
However, neither of them fixed the issue. If it's helpful,
!sudo find / -name "libgsl.so.25"
returns
/usr/local/lib/libgsl.so.25
/content/gsl-2.6/.libs/libgsl.so.25
So we know the files exist. I just cant seem to point my code to it correctly.
Thanks in advance
I have the same issue with a different library. I also tried the export, which does not work, seems like the python in colab does not read environmental variables.
My solution is the following
!ln -s /usr/local/lib/<your_shared_library> /usr/lib/<your_shared_library>

Error while building WSO2 Microgateway project on Windows 10

I’ve been trying to explore WSO2 Microgateway and set up a Microgateway project. Building the project in Windows 10 with the command “micro-gw build project-name” is giving this error: “Could not find or load main class org.wso2.apimgt.gateway.cli.cmd.Main”.
I’ve downloaded the Toolkit and Runtime from https://wso2.com/api-management/api-microgateway/. I've set the Path environment variable to the /bin directory of the Toolkit and Runtime extracted folders, but still the “micro-gw build project-name” command is giving error “Could not find or load main class org.wso2.apimgt.gateway.cli.cmd.Main”. I’ve also cloned the source code from Github (https://github.com/wso2/product-microgateway/) which has the Main.java class and tried setting environment variables to its path.
I also tried setting the environment variables to the path where Toolkit batch file is present. I also followed the steps mentioned here, https://github.com/wso2/product-microgateway/#running-the-microgateway.
I'm assuming the Toolkit batch file (micro-gw) would execute the Main.java class coming up in the error.
These steps did not resolve the error. I'm new to Java based product, and I'm sure I'm missing something here.
Problem is with the init command not the build command. Init command is suppose to setup the TOOLKIT after the first use. It should extract the platform.zip file and copy all of the required resources to relevant places for you.
I hope you get the Project ___ successfully initialized message after running the init command. Just check $TOOLKIT_HOME/logs/ directory to see if there are any information on the log file.
If the log file also doesn't help, as a workaround, copy all the .jar files inside $TOOLKIT_HOME/lib/gateway/platform and $TOOLKIT_HOME/lib/gateway/cli to $TOOLKIT_HOME/lib/platform/bre/lib and try again, that should work.
Also please report this issue at https://github.com/wso2/product-microgateway/issues

Running Lambda Function written in Go on AWS - error while loading shared libraries

My question is similar to: libtensorflow.so: cannot open shared object file: No such file or directory but I do not see an answer for it, so I would appreciate any kind of help.
Once I print my LD_LIBRARY_PATH I get the following output:
/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib
I have created and deployed TensorFlow Lambda Layer.
To my knowledge Lambda Layers should be cached in /opt/bin directory, right? But on documentation:https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html I see that default cache directory is ~/.aws-sam/layers-pkg.
Once I try to run my Lambda function with AWS SAM, and once I uncomment code which uses package in which I import tensorflow with go library, I get the following error:
error while loading shared libraries: libtensorflow.so.1: cannot open shared object file: No such file or directory
I have even tried to include these libraries in lib directory, and I've made that lib directory as part of LD_LIBRARY_PATH. Same result.

Ogre SDK exception occured

I've setup Ogre and dependencies on my PC, and downloaded some Ogre applications. When I launch my new exe file of the project I just downloaded it generates the following error:
05:37:59: Loading library C:/OgreSDK_vc9_v1-7-1/bin/debug\RenderSystem_Direct3D9_d
05:37:59: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library C :/OgreSDK_vc9_v1-7-1/bin/debug\RenderSystem_Direct3D9_d. System Error: The specified module could not be found.
in DynLib::load at ..\..\..\..\OgreMain\src\OgreDynLib.cpp (line 91)
Any help would be appreciated.
Thanks in advance.
Upon creation of the central Ogre3D class Ogre::Root, you need to pass the name of a *.CFG file that contains all to be loaded Ogre plugins, such as the above mentioned D3D9 Render System.
That file needs to be next to your *.EXE by default and should look like this (in a minimal form where only the D3D9 Render System is loaded and the matching DLL file resides next to this CFG file):
# Defines plugins to load
# Define plugin folder
PluginFolder=.
# Define plugins
Plugin=RenderSystem_Direct3D9
For more information, have a look at this section in the Ogre3D tutorial 1
This took me a while until I figured it out. The dll (RenderSystem_Direct3D9_d) is missed because you didn't build it - it's the project with the same name (RenderSystem_Direct3D9) in the OGRE.sln
I'm using OGRE 2.1, so the dll I missing is RenderSystem_Direct3D11_d.dll instead of RenderSystem_Direct3D9_d.dll like yours, but the fix is similar, just build that dll's project, like the image below.
Anyway, as a beginner, to avoid any trouble, just hit F6 to build whole solution.