国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > php教程 > OpenCV multiple version on Linux ENV script of setting

OpenCV multiple version on Linux ENV script of setting

来源:程序员人生   发布时间:2016-07-27 09:09:28 阅读次数:2410次

I have multiple version of OpenCV, 2.4.13 and 3.1.0, on my Ubuntu 14.04.4 LTS. The developted applications depends on either one. To keep all the OpenCV versions, I wrote a script to set corresponding environment.

The body of my script is showing below:

#!/bin/bash CV_PREFIX=/usr/local/opencv if [ $# -eq 0 ] ; then echo "Usage : setcv.sh 2.4.13 or setcv.sh 3.1.0" else if [ $1 != 2.4.13 -a $1 != 3.1.0 ] ; then echo "wrong version" else echo Setting for OpenCV-$1 cp ${CV_PREFIX}/$1/lib/pkgconfig/opencv.pc /usr/local/lib/pkgconfig/opencv.pc cp ${CV_PREFIX}/OpenCV-$1.conf /etc/ld.so.conf.d/ ldconfig fi fi

You can run it with sudo

and you have to create two files: OpenCV⑵.4.13.conf and OpenCV⑶.1.0 to set the path of runtime libraries of the specified OpenCV.

For example:

/usr/local/opencv/2.4.13/lib

Have fun!

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生