unable to run opencv with cuda 7.0 - opencv

I have tried to build and run OpenCV on Ubuntu 14.04. I have previously installed CUDA 7.0 (which is working perfectly with other programs) and when I try to run openCV (opencv_traincascade) I get the following error:
error while loading shared libraries: libcudart.so.6.5: cannot open shared object file: No such file or directory
If I understand correctly, OpenCV expects CUDA v6.5 which is not installed. Does anyone know how to install OpenCV with CUDA 7.0?

try to find libcudart.so.6.5, use find or locate command, make sure it exists or link to the file exists.
then add path to your ~/.bashrc or ~/.profile(or sth else, I add it to bashrc on Ubuntu), like:
PATH=/usr/local/cuda-7.0/bin:$PATH
LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH
if you change your path to install cuda, use your real path instead.

Related

Dot cannot be run in Pycharm with Sphinx and Graphviz

I am trying to create a class diagram with sphinx. For this I created a virtual environment in Pycharm and added this to conf.py:
extensions = ['sphinx.ext.autodoc','sphinx.ext.inheritance_diagram']
In my spamfilter.rst file I added the following lines:
Diagrams
=================
.. inheritance-diagram:: spamfilter
The output is not a diagram and looks like this.
The following warning is displayed:
WARNING: dot command 'dot' cannot be run (needed for graphviz output), check the graphviz_dot setting
When I look into the folder C:\Users\Name\PycharmProjects\documentation\venv\Lib\site-packages\graphviz, there is a dot.py file, so I do not understand what is wrong. A similar question for Mac OS has been asked here. I tried the solution but it seems like it only works for Mac, because when I paste export PATH=$PATH:~/opt/bin to the Pycharm Terminal, it tells me that the command export could not be found. Honestly I have problems understanding why sometimes you can just use packages and other times they cannot be found even when they are installed, I am self-taught and a beginner.
The "pip install graphviz" command installs a Python package that provides an interface to Graphviz (https://pypi.org/project/graphviz). This package is not required by Sphinx.
In order to create inheritance diagrams with Sphinx, the actual Graphviz toolkit (including dot.exe) must be installed. See https://www.graphviz.org.
If dot.exe is not in the PATH, you can use the graphviz_dot configuration option.
I had the same problem where rendering a C4 model with PlantUML didn't work in the IDE (PyCharm 2022.2.1 Pro) on a newer M1 MacOS Monterey. I had it working on a Big Sur intel Mac prior to the upgrade with no extra effort, so the chip change caused me to go down a lot of paths with Rosetta and so on that were all unsuccessful.
The error was:
Dot Executable: /opt/local/bin/dot
File does not exist
Cannot find Graphviz.
Graphviz was installed correctly, and dot was on my path, but it wasn't in /opt/local/bin/dot. Since it was in /opt/homebrew/bin/dot, all I needed to do was link the actual file with the path it was searching for:
cd /opt
sudo ln -s homebrew local
et voilĂ , PyCharm is now correctly rendering the puml in the IDE.

fatal error: opencv2/xfeatures2d.hpp: No such file or directory

I am trying to build this code:
https://docs.opencv.org/3.2.0/d5/d6f/tutorial_feature_flann_matcher.html
I am using Ubuntu 16.04 with CLion 2017.3 and have OpenCV 3.4 installed.
xfeatures2d.hpp can't be found on the system.
I have looked at many different problems on the internet, but couldn't find a solution.
Any help?
You have to include cmake comiplation flag to opencv OPENCV_EXTRA_MODULES_PATH and set it to the opencv_contrib/modules.
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules
Here's what I had to do to compile OpenCV with xfeatures2d:
Download opencv_contrib (I took a release from the releases page). This step is what gives us xfeatures2d.
Unpack the tarball somewhere, e.g., ~/src/opencv_contrib-4.5.5
When configuring OpenCV (the main OpenCV source like opencv-4.5.2) with CMake, add the following option to cmake command line (adjusting the value to be your actual path to the modules subdirectory of the opencv_contrib tarball):
-DOPENCV_EXTRA_MODULES_PATH=$HOME/src/opencv_contrib-4.5.5/modules/
Now just build as you normally would and install.
The above actions gave me the expected file (among others): /usr/include/opencv4/opencv2/xfeatures2d.hpp.

Can not run lua script from Fceux emulator usnig torch

I am using Fceux 2.2.3 emulator and i am trying to run a lua script using torch while playing super mario bros. When i load the script i face this error
Lua thread bombed out: error loading module 'libpaths' from file
'/home/antonis/torch/install/lib/lua/5.1/libpaths.so':
/home/antonis/torch/install/lib/lua/5.1/libpaths.so: undefined
symbol: lua_gettop
I looked in the specific folder in the path and the libpaths.so is there.
What this error means?
You need to build tha latest FCEUX from source (https://github.com/TASVideos/fceux) using the option to use system libraries. Then you specify LuaJIT (install it first) in the SContruct file and install. After that, install torch on your system. It will be available to FCEUX through "require 'torch'". That is the way I did it (right now, tbh), but you could probably install Torch first and then link its own LuaJIT files to FCEUX.

Error installing llvm and clang from source in Linux

I am trying to install clang from source following the instructions as given in http://clang.llvm.org/get_started.html ( Steps 1-4 and 7) in Ubuntu 14.04
Inside the build directory , I ran make which succeeded. I wasn't sure what to do after that , so I ran make install inside the build directory, following which I got this cmake error:
There is no executable named clang in /build/bin folder anyway, but I can find others like clang-check, clang-query, etc. What's going wrong?
PS: My main requirment is to experiment with alpha security checkers of clang analyzer and also write my own checker later.

CMake can't find FFMPEG in custom install path

I am compiling a dependency for a project on Ubuntu 10.10, and instead of having it install to /usr/local by default, I am instead installing it to /tmp/stage/usr/local. How do I go about informing CMake of the location of this custom installed dependency when I call it to generate the build files for said project.
I am running CMake 2.8.1, and I have tried to set CMAKE_PREFIX_PATH on the cmake command line, like so
cmake -D CMAKE_PREFIX_PATH=/tmp/stage/usr/local
but this doesn't seem to make a difference - the project doesn't seem to detect the dependency.
Also, if it matters, the project in question is OpenCV 2.2, and the dependency in question is FFMPEG...
I figured out how to fix my problem, and trying to point CMake at the appropriate install location isn't the issue.
Apparently, CMake is unable to find the pkg-config files for FFMPEG (i.e. libavcodec.pc, libavdevice.pc, etc.) that tell it where the FFMPEG headers and libraries are located. In a typical install scenario, these files would be located at /usr/lib/pkgconfig. However because of the custom install location, they are instead located at /tmp/stage/usr/local/lib/pkgconfig.
So that CMake could find these files, I had to add the following environment variable:
export PKG_CONFIG_PATH=/tmp/stage/usr/local/lib/pkgconfig
After which point, OpenCV built against FFMPEG as expected.

Resources