OpenCV multiple version on Linux ENV script of setting
2016-06-28 03:27
459 查看
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:
You can run it with
and you have to create two files: OpenCV-2.4.13.conf and OpenCV-3.1.0 to set the path of runtime libraries of the specified OpenCV.
For example:
Have fun!
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-2.4.13.conf and OpenCV-3.1.0 to set the path of runtime libraries of the specified OpenCV.
For example:
/usr/local/opencv/2.4.13/lib
Have fun!
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- Linux socket 初步
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- ubuntu下chrome无法同步问题解决
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验