I failed to compile conjugate gradient solver. I downloaded the whole archieve that contains libraries, makefile and other stuff but the compiler lacks some header files. How to include all files I downloaded? Maybe I need to add some path or copy folder "common" to /usr/local/cuda/include/
To download and build a cuda sample directly, the following steps worked for me:
wget http://developer.download.nvidia.com/compute/DevZone/CUDALibraries/Projects/x64/conjugateGradient.tar.gz
tar -xzvf conjugateGradient.tar.gz
cd 7_CUDALibraries/conjugateGradient
make
# to execute the program:
./conjugateGradient
This assumes a standard cuda 5 install is available at /usr/local/cuda.
It does not assume that any samples are previously installed.
I tested this on a machine with CUDA 5 and RHEL 5.5
If this does not work, please post details of the error output you received.
If you want to use some other sample than the example given here, the download links can be obtained here.
Related
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.
I have clang-format version 3.8.0 (tags/RELEASE_380/final) in my ~/bin folder on a Fedora machine with no root privileges. It works, but it is very old and I'd like to upgrade. I just want the clang-format tool, so I would like to avoid going through the full installation process for LLVM or clang if I can avoid it. I assume I can avoid it, since my old clang-format works without either of those installed. I don't remember how clang-format got in my ~/bin directory, and I can't figure out how to update it.
The first thing I tried was following this post which said I should be able to download a prebuilt binary from this page (I tried http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-Fedora27.tar.xz), then just set up a symlink to bin/clang-format. This did not work for me. When I type /path/to/bin/clang-format --help I get the error error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory.
The next thing I tried is downloading the clang source code and compiling that with
mkdir build && cd build && CC=$(which gcc) CXX=$(which g++) cmake ..
but when I did I got the error
CMake Error at CMakeLists.txt:36 (message):
llvm-config not found -- LLVM_CONFIG-NOTFOUND
Which I guess means I'd need to install the LLVM to go this route?
Any help getting an updated clang-format (vesion 5.0 at minimum) without root access would be appreciated. Bonus points for minimal installation (i.e. no clang or llvm).
=== EDIT ===
By downloading a bunch of different versions of prebuilt binaries, I've discovered that older versions (<4.0) have clang-formats that work out of the box, but at 4.0 and up give the same error about libtinfo. I guess that means I'll have to live with older versions unless I want to go through a painful installation process.
When you download llvm 6.0, make sure the directory structure is as follows:
llvm
|-->tools
|----->clang
|----> tools
|----> extra
If you just want to build clang-format, then you can cd into
llvm-build-dir/tools/clang/tools/extra/clang-format and then execute make -j8 all
later you can make a symbolic link in your /bin folder
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.
I want to use some function in the newly introduced opencv_contrib modules on iOS, how can I build a iOS framework with those extra modules. Thanks in advance.
I am answering this (old) question for the benefit of other developers who would like to try this on newer OpenCV versions.
It is possible to build opencv_contrib modules together with the iOS framework, in version 4 (current at the time of answering).
set path to the Xcode command line tools:
sudo ln -s /Applications/Xcode.app/Contents/Developer Developer
cd to the path above the opencv directory
cd ~/
Build the framework with the --contrib option:
python opencv/platforms/ios/build_framework.py --contrib <'relative_path_to_opencv_contrib'>/opencv_contrib/ ios
If an individual module does not get build, you should check the CMakelists.txt of that module to see if it has been disabled for iOS.
I just tested this before answering, so feel free to drop a comment or a question if there are issues.
See fficial document tutorial_ios_install!
This works well.
The official document does not include building iOS framework with opencv_contrib.
But inferring from the cmake file, you can copy the module you want (ximgproc in your case) to opencv/modules. Then run build_framework.py as usual.
You can checkout this post
I want to build vlc for iOS.
My environment is MacOS 10.8.3, Xcode4.6.2 with iOS6.1 SDK.
I cloned the vlc lib form https://github.com/videolan/vlc.git, cd into the /extras/package/ios, and run the build.sh in terminal, everything goes okay except when I start making the chromaprint, I got this error:
FFTW3 lib not found. Set FFTW3_DIR to find it.
CMake Error at CMakeLists.txt:114 (message):
Neither FFmpeg with avfft.h nor FFTW3 found
This is because chromaprint needs the fft library, it will find FFMPEG and also FFTW3.
I want to use the FFMPEG for an fft calculation, so I have download a copy of ffmpeg source code and complied it,the libs and headers are in the directories: /Users/king/ffmpeg/complied/include and /Users/king/ffmpeg/complied/lib,
then I set the FFMPEG_ROOT as /Users/king/ffmpeg/complied in the cmake/modules/FindFFmpeg.cmake, just before the FIND_PATH() function.
something like : set(${FFMPEG_ROOT} /Users/king/ffmpeg/complied)
,I hope the FIND_PATH() can find the releated libs and headers, this doesn't work.
So my question is, How do i set the FFMPEG path or FFTW3_DIR for chromaprint?
Thanks in advance, I am really run out of my head!
I have same problem on VLC Windows cross build.
After I upgrade cmake to 3.22.0, this problem is fixed.
I download latest cmake source code and build.
I also download fftw3 package and extracted under /home/[username]/fftw3.
Set FFTW3_DIR to ~/fftw3 by
export FFTW3_DIR=/home/[username]/fftw3