简体   繁体   English

将预制的OpenCV安装移至另一台Linux计算机

[英]Moving a pre-made OpenCV installation to another Linux computer

I installed OpenCV for C++ on Linux by using this guide . 我使用本指南在Linux上安装了OpenCV for C ++。

And then made it work with Eclipse with this guide . 然后通过本指南使其与Eclipse一起使用。

However, I need to be able to use OpenCV for a few different Linux computers and this is where I have an issue. 但是,我需要能够在几台不同的Linux计算机上使用OpenCV,这是我遇到的问题。

The installation worked fine but it took a lot of time to make the file (over 3 hours) and therefore I would like to skip the installation when moving OpenCV to another Linux computer. 安装工作正常,但是制作文件花费了很多时间(超过3个小时),因此,当我将OpenCV移至另一台Linux计算机时,我想跳过安装过程。 I tried to copy over the pre-made OpenCV directory from my first installation to another computer, but when trying to find the OpenCV installation with this commando from the guide: 我尝试将预制的OpenCV目录从我的第一次安装复制到另一台计算机,但是当尝试从指南中使用此突击队查找OpenCV安装时:

pkg-config --cflags opencv

I get this error message: 我收到此错误消息:

Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found

I just want to make sure before I spend a half a day making OpenCV installations on every computer, is there a way to copy a pre-made OpenCV installation to another computer? 我只想确保在花半天的时间在每台计算机上进行OpenCV安装之前,是否可以将预制的OpenCV安装复制到另一台计算机上? It would save me a ton of time. 这将为我节省大量时间。 Or do I simply need to follow the installation guide for each and every computer I want to use OpenCV on? 还是我只需要遵循要在其上使用OpenCV的每台计算机的安装指南?

Thanks in advance, 提前致谢,

Some of the parts of OpenCV have to be compiled for the specific processor. OpenCV的某些部分必须针对特定处理器进行编译。 This means you have to install compile them on the specific machine. 这意味着您必须在特定计算机上安装编译它们。 I'm assuming cmake is taking the majority of the time. 我假设cmake将花费大部分时间。 To enhance this process you can add an option -j followed by the number of threads the machine has. 为了增强此过程,您可以添加-j选项,后跟计算机具有的线程数。 For example -j4 for a machine with 4 threads or -j8 for a machine with 8 threads. 例如, -j4对于具有4个线程的计算机,或-j8对于具有8个线程的计算机。 If you don't know how many threads your machine has you can use the command lscpu to get information about the CPU. 如果您不知道计算机有多少个线程,则可以使用命令lscpu获取有关CPU的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM